Hold back Jellyfin favorites for the playing track until it stops #3
Loading…
Reference in a new issue
No description provided.
Delete branch "jellyfin-favorite-during-playback"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Likes made in Music Assistant while the track is playing never stuck in Jellyfin.
Cause (Jellyfin 12.4, also on master):
SessionManager.OnPlaybackProgressandOnPlaybackStoppedread the user data from the session's cachedFullNowPlayingItem, a snapshot from when playback started, and save the whole row back. A favorite set mid-track is overwritten by the next progress report. Seen live: Perfectly Chilled was liked at 11:22:38 and reverted by MA's progress report at 11:22:44. Why Hide and the six tracks fixed by hand earlier were all lost the same way.Fix:
set_favoritenow holds back the change while the track has an open playback session, and sends the latest change right after that session's stopped report (or the marked-unplayed call). Likes for tracks that aren't playing are still sent straight away.Tests: both tests pass in the live MA image with the patched provider. New cases: liked while playing (sent after the stop), liked then unliked (only the unlike is sent), another track playing (not held back), marked unplayed.
Limits:
Upstream: this is Jellyfin bug jellyfin#14981. The server-side fix, jellyfin#18366 (reload user data before each playback save), is open and not yet merged. Once a Jellyfin release includes it, the hold-back here can be removed and favorites can be sent straight away again.
🤖 Generated with Claude Code
https://claude.ai/code/session_01CbPPc19ztjvWzSc5JPMH2B