From e951fa696b1f5ab2004be1eb3d139ec029150f2f Mon Sep 17 00:00:00 2001 From: jeffvli Date: Thu, 16 Jul 2026 13:30:16 -0700 Subject: [PATCH] fix: exclude Jellyfin stop event on song change (#2243) --- src/renderer/features/player/hooks/use-scrobble.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/renderer/features/player/hooks/use-scrobble.ts b/src/renderer/features/player/hooks/use-scrobble.ts index 5103b9bc8..8b1c88e10 100644 --- a/src/renderer/features/player/hooks/use-scrobble.ts +++ b/src/renderer/features/player/hooks/use-scrobble.ts @@ -67,9 +67,9 @@ Jellyfin progress APIs still use playback position (ticks), not listen time: - pause / unpause Other events: - - When the song changes: sends 'stop' for the previous track; sends 'start' - when the new track is playing; clears submission flag and listen accumulator - for the new track. + - When the song changes: sends 'stop' for the previous non-Jellyfin track; + sends 'start' when the new track is playing; clears submission flag and + listen accumulator for the new track. - When the song is restarted (near 0 after 10s+): clears submission flag and listen accumulator. @@ -403,8 +403,10 @@ export const useScrobble = () => { ); } - // Send stop scrobble for the track that was playing before the change - if (previousSong?.id) { + // Jellyfin does not need a stop event when advancing to another song. + const skipStopScrobble = previousSong?._serverType === ServerType.JELLYFIN; + + if (previousSong?.id && !skipStopScrobble) { sendScrobble.mutate( { apiClientProps: { serverId: previousSong._serverId || '' },