From c7a4a477355d4a0375fb10d94bb855b2e5653eb5 Mon Sep 17 00:00:00 2001 From: Skyler Shaw Date: Wed, 26 Aug 2026 05:26:43 -0700 Subject: [PATCH] Serve slideshowpure.js/css from the plugin instead of jsDelivr The injected index.html loaded both files from cdn.jsdelivr.net at {{Config.VersionString}}, default "main". A branch ref is not a version: jsDelivr re-resolves it at request time, so browser-side changes reach every install the day they land, with no release and no way to decline, and the code in the browser drifts from the installed plugin version. It also leaves the media bar broken on servers without internet access. Embed the files in the assembly and serve them from the existing /MediaBar/{file} route: - slideshowpure.js/css become EmbeddedResource under the Inject namespace - Inject/index.html templates an asset base URL instead of a bare ref - VersionString defaults to "embedded", which resolves to ../MediaBar (relative, so it works when Jellyfin is hosted under a base path) Any other value is still treated as a git ref and fetched from jsDelivr. --- .../Configuration/PluginConfiguration.cs | 6 ++++-- .../Configuration/config.html | 2 +- .../Helpers/TransformationPatches.cs | 13 ++++++++++--- src/Jellyfin.Plugin.MediaBar/Inject/index.html | 4 ++-- .../Jellyfin.Plugin.MediaBar.csproj | 5 +++-- 5 files changed, 20 insertions(+), 10 deletions(-) diff --git a/src/Jellyfin.Plugin.MediaBar/Configuration/PluginConfiguration.cs b/src/Jellyfin.Plugin.MediaBar/Configuration/PluginConfiguration.cs index 8e8a9a5..13a7dd4 100644 --- a/src/Jellyfin.Plugin.MediaBar/Configuration/PluginConfiguration.cs +++ b/src/Jellyfin.Plugin.MediaBar/Configuration/PluginConfiguration.cs @@ -10,10 +10,12 @@ namespace Jellyfin.Plugin.MediaBar.Configuration public class PluginConfiguration : BasePluginConfiguration { + public const string EmbeddedVersion = "embedded"; + public MediaBarState Enabled { get; set; } = MediaBarState.Enabled; - public string VersionString { get; set; } = "main"; - + public string VersionString { get; set; } = EmbeddedVersion; + public bool UseAvatarsFile { get; set; } = true; public string AvatarsPlaylist { get; set; } = string.Empty; diff --git a/src/Jellyfin.Plugin.MediaBar/Configuration/config.html b/src/Jellyfin.Plugin.MediaBar/Configuration/config.html index e75cbdd..5bff541 100644 --- a/src/Jellyfin.Plugin.MediaBar/Configuration/config.html +++ b/src/Jellyfin.Plugin.MediaBar/Configuration/config.html @@ -37,7 +37,7 @@ -
Which version of the jsdelivr'd plugin should be used.
+
Where the web assets are loaded from. Leave as embedded 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.