github kirtan3d/Jellyfin.Plugin.AssignThemeSong v1.2.9
v1.2.9 — Fix Native Theme Song Enable/Disable Sync

5 hours ago

v1.2.9 — Fix Native Theme Song Enable/Disable Sync

🐛 Bug Fix

Correctly reads and writes Jellyfin's native theme song setting.

What was wrong

The previous implementation used ApiClient.getDisplayPreferences('usersettings', userId, 'emby') to get/set CustomPrefs['enableThemeSong']. However, after studying Jellyfin Web source code directly (themeMediaPlayer.js, userSettings.js, appSettings.js), it was discovered that enableThemeSongs is stored in localStorage only, not in DisplayPreferences.

Root Cause (from Jellyfin Web source)

// userSettings.js
enableThemeSongs(val) {
    if (val !== undefined) {
        return this.set('enableThemeSongs', val.toString(), false); // false = localStorage only!
    }
    return toBoolean(this.get('enableThemeSongs', false), false); // default: false (disabled)
}

The third argument false means enableOnServer = false, so the value is ONLY stored in localStorage via appSettings.js:

localStorage key: "{userId}-enableThemeSongs"
localStorage value: "true" or "false"

The Fix

Now directly reads/writes the correct localStorage key:

// Read
const nativeEnabled = localStorage.getItem(userId + '-enableThemeSongs') === 'true';

// Write  
localStorage.setItem(userId + '-enableThemeSongs', enabled.toString());

This correctly syncs with:

  • Settings → Display → Libraries → "Play theme songs in background"
  • Jellyfin's themeMediaPlayer.js runtime check

Note: The default when key is absent is false (disabled). Users may need to re-enable theme songs in their preferences.

What's Unchanged

  • All other features remain the same (YouTube download, MP3 upload, audio player, etc.)
  • Volume and max duration controls work as before

Don't miss a new Jellyfin.Plugin.AssignThemeSong release

NewReleases is sending notifications on new releases.