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.cshosted service. On startup it walks known Jellyfin web paths (IApplicationPaths.WebPathplus common Linux package locations), readsindex.html, checks for anachievementbadges-bootstrapmarker, and if absent inserts three<script>tags before</body>: sidebar, standalone, enhance. - Atomic write via
.tmp+File.Moveso a crash mid-write can't truncate Jellyfin'sindex.html. SidebarInjectionMiddlewarestays 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.jsrefreshed with the modern anchor strategy (match "Plugin Settings" / "Plugin Pages" by text, insert as sibling in the same parent). Previouslysidebar.jsstill had the legacy broken selector chain — the middleware was using an inline copy of the fixed logic whilesidebar.jsitself 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.