What this fixes
Some servers have the sidebar Achievements entry and the header badge icons missing after 1.5.0/1.5.1 even though the plugin is installed and the admin page works. This hotfix tackles it three ways:
-
Verbose logging. The inline injection script now console.logs every step. After updating you'll see either:
[AchievementBadges] inline injection script loaded→ script is injected and running[AchievementBadges] start() running→ bootstrap reached[AchievementBadges] injectSidebar: found nav container, adding entry→ it located a nav menu and added our entry[AchievementBadges] injectHeader: found header, adding badges container→ header badges added- Any
[AchievementBadges] ... error:line tells us exactly where it crashed
-
Aggressive retry. Injection now runs once on DOMContentLoaded, then every 1 second for 15 seconds, plus one-shots at 500ms and 2s. If another plugin (KefinTweaks, JellyfinEnhanced) rebuilds the sidebar nav after we inject, we re-inject within a second. The MutationObserver also catches later rebuilds.
-
More selectors. Different Jellyfin themes put the nav menu in different DOM containers. We now try 6 different selectors to find it.
-
Server-side logging. The middleware itself now logs to Jellyfin's server log on every request it handles. After updating, search Dashboard → Logs for
[AchievementBadges]and you should see:middleware handling index.html request: /web/index.htmlInjected scripts into /web/index.html (XXXXX bytes)
If those are missing, the middleware isn't being invoked at all, which points at a DI issue that I can then track down.
How to test
- Update to 1.5.2 and restart Jellyfin.
- Open the Jellyfin home page in a fresh incognito window.
- Open F12 → Console and filter by
AchievementBadges. - Paste the full list of matching lines in the GitHub issue / chat.
- Also check Dashboard → Logs → latest log and paste any
[AchievementBadges]lines.
Depending on what you see:
- If the inline script never loads → middleware isn't injecting → server log will tell us why
- If script loads but
injectSidebarreports "no nav container" → your theme uses an unknown selector, easy one-line fix - If script loads and injects successfully but the entry disappears → another plugin is wiping it, the retry loop should handle this
- If we get an error line → it'll tell us exactly what to fix
No data changes, no badge logic changes. Safe update.