github ZL154/AchievementBadges_for_Jellyfin v1.5.24

latest releases: v2.4.0, v2.3.1, v2.3.0...
5 months ago

Fix: sidebar entry missing on the Jellyfin Android app

Previous versions relied entirely on SidebarInjectionMiddleware to rewrite index.html at runtime. That works fine for browsers and the iOS app (both of which actually request index.html over HTTP and get the rewritten version), but the Jellyfin Android app pre-fetches / caches the HTML file in a way that bypasses the ASP.NET Core middleware pipeline entirely — so the script tags never reached it.

StarTrack's sidebar has always worked on the Android app because it uses a different approach: it writes its script tag into index.html directly on disk at plugin startup. v1.5.24 ports the same pattern to Achievement Badges.

Implementation:

  • New Services/WebInjectionService.cs hosted service. On startup it walks known Jellyfin web paths (IApplicationPaths.WebPath plus common Linux package locations), reads index.html, checks for an achievementbadges-bootstrap marker, and if absent inserts three <script> tags before </body>: sidebar, standalone, enhance.
  • Atomic write via .tmp + File.Move so a crash mid-write can't truncate Jellyfin's index.html.
  • SidebarInjectionMiddleware stays registered as a fallback for setups where the web directory isn't writable, and now skips rewriting if the marker is already present so the two layers don't double-inject.
  • Pages/sidebar.js refreshed with the modern anchor strategy (match "Plugin Settings" / "Plugin Pages" by text, insert as sibling in the same parent). Previously sidebar.js still had the legacy broken selector chain — the middleware was using an inline copy of the fixed logic while sidebar.js itself was stale.

If the first install doesn't take effect immediately on the Android app, kill and reopen the app once to force it to reload the cached index.html. After that it's persistent.

Don't miss a new AchievementBadges_for_Jellyfin release

NewReleases is sending notifications on new releases.