Stop iOS counting each track as played twice - #1714
Open
APIUM wants to merge 1 commit into
Open
Conversation
On iOS the queue index advances before the position does, so the outgoing track's end position was measured against the incoming track's runtime and read as a repeat. Jellyfin logged a second play for a track that had just started, and last.fm scrobbled it. - A repeat now also requires the track to have been current long enough to reach its end. The stale position survives an unpredictable number of events, so no position test alone can tell a repeat from a track change. - That test also means seeking forward and then looping the same track no longer records a listen. - A missing runtime made the loop check always true, so a track of unknown length counted as a repeat on any rewind. Relates to finamp-app#1172, finamp-app#1604, finamp-app#688.
APIUM
force-pushed
the
fix/apium/ios-scrobble-duplication
branch
from
August 6, 2026 07:41
a37aefb to
427c098
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fix addresses incorrect lastfm scrobbling doing double scrobbles for tracks as reported in discord and in several tickets if I understand them correctly. I was able to reproduce this quite clearly on the sim, so the fix was fairly easy to verify.
I think the commit message communicates this pretty clearly:
On iOS the queue index advances before the position does, so the outgoing
track's end position was measured against the incoming track's runtime and read
as a repeat. Jellyfin logged a second play for a track that had just started,
and last.fm scrobbled it.
reach its end. The stale position survives an unpredictable number of events,
so no position test alone can tell a repeat from a track change.
longer records a listen.
length counted as a repeat on any rewind.
Relates to #1172, #1604, #688.