mirror of
https://github.com/IAmParadox27/jellyfin-plugin-media-bar.git
synced 2026-11-13 16:54:19 +01:00
Treat main and latest as embedded, drop the unreachable 10.11 fallback
An "embedded" default only helps fresh installs: every existing server has
"main" or "latest" saved and would keep fetching a moving branch ref
forever. Those values never named a version, they meant "newest", and the
newest that matches the installed plugin is now the embedded copy. A tag
or commit still resolves to jsDelivr.
This makes the 10.11 fallback unreachable ("main" resolves to embedded
before the guard), and it was already dead: it compares
JellyfinVersionAttribute.GetVersion() to "10.11" by equality while the
assembly declares "10.11.2". Remove it, along with the config page's
client-side copy of the latest-to-main rewrite.
This commit is contained in:
3 files changed
+15
-20
No files matched your search
@@ -16,6 +16,18 @@ namespace Jellyfin.Plugin.MediaBar.Configuration
|
||||
|
||||
public string VersionString { get; set; } = EmbeddedVersion;
|
||||
|
||||
public static bool UsesEmbeddedAssets(string? version)
|
||||
{
|
||||
version = version?.Trim();
|
||||
|
||||
// main/latest predate the embedded assets; configs that saved them meant
|
||||
// "newest", which is now the embedded copy
|
||||
return string.IsNullOrWhiteSpace(version) ||
|
||||
string.Equals(version, EmbeddedVersion, StringComparison.OrdinalIgnoreCase) ||
|
||||
string.Equals(version, "main", StringComparison.OrdinalIgnoreCase) ||
|
||||
string.Equals(version, "latest", StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
public bool UseAvatarsFile { get; set; } = true;
|
||||
|
||||
public string AvatarsPlaylist { get; set; } = string.Empty;
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
<label class="inputLabel inputLabelUnfocused" for="txtVersionString">Version</label>
|
||||
<label class="inputLabel inputLabel-float inputLabelUnfocused" for="txtVersionString"></label>
|
||||
<input id="txtVersionString" type="text" is="emby-input" class="emby-input" data-id="txtVersionString" />
|
||||
<div class="fieldDescription">Where the web assets are loaded from. Leave as <code>embedded</code> to serve the copies shipped inside this plugin, which always match the installed version and need no internet access. Set a git ref (branch, tag or commit) to load that version from jsDelivr instead.</div>
|
||||
<div class="fieldDescription">Where the web assets are loaded from. <code>embedded</code> (also <code>main</code>, <code>latest</code>, or blank) serves the copies shipped inside this plugin, which always match the installed version and need no internet access. Set a tag or commit to load that exact version from jsDelivr instead.</div>
|
||||
</div>
|
||||
<div class="checkboxContainer checkboxContainer-withDescription">
|
||||
<label class="emby-checkbox-label">
|
||||
@@ -230,10 +230,6 @@
|
||||
document.querySelector("[data-id=chkUseAvatarsFile]").checked = config.UseAvatarsFile;
|
||||
document.querySelector("[data-id=txtAvatarsPlaylist]").value = config.AvatarsPlaylist;
|
||||
|
||||
if (config.VersionString === 'latest') {
|
||||
config.VersionString = 'main';
|
||||
}
|
||||
|
||||
document.querySelector("[data-id=txtVersionString]").value = config.VersionString;
|
||||
|
||||
document.querySelector("[data-id=numShuffleInterval]").value = config.WebConfig.ShuffleInterval;
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
using System.Reflection;
|
||||
using System.Text.RegularExpressions;
|
||||
using Jellyfin.Extensions;
|
||||
using Jellyfin.Plugin.MediaBar.Attributes;
|
||||
using Jellyfin.Plugin.MediaBar.Configuration;
|
||||
using Jellyfin.Plugin.MediaBar.JellyfinVersionSpecific;
|
||||
using Jellyfin.Plugin.MediaBar.Model;
|
||||
@@ -107,26 +106,14 @@ namespace Jellyfin.Plugin.MediaBar.Helpers
|
||||
|
||||
private static string ResolveAssetBaseUrl()
|
||||
{
|
||||
string version = MediaBarPlugin.Instance.Configuration.VersionString;
|
||||
string version = MediaBarPlugin.Instance.Configuration.VersionString.Trim();
|
||||
|
||||
if (string.IsNullOrWhiteSpace(version) ||
|
||||
string.Equals(version, PluginConfiguration.EmbeddedVersion, StringComparison.OrdinalIgnoreCase))
|
||||
if (PluginConfiguration.UsesEmbeddedAssets(version))
|
||||
{
|
||||
// Relative to /web/ so it resolves when Jellyfin is hosted under a base path
|
||||
return "../MediaBar";
|
||||
}
|
||||
|
||||
if (version == "latest")
|
||||
{
|
||||
version = "main";
|
||||
}
|
||||
|
||||
if (version == "main" && JellyfinVersionAttribute.GetVersion() == "10.11")
|
||||
{
|
||||
// Force 10.11 branch instead of main for now
|
||||
version = "10.11";
|
||||
}
|
||||
|
||||
return $"https://cdn.jsdelivr.net/gh/IAmParadox27/jellyfin-plugin-media-bar@{version}";
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user