Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix panic when seeking beyond track boundaries #124

Merged
merged 2 commits into from
Nov 1, 2019

Conversation

sputnick1124
Copy link
Contributor

Addresses #123.

Not sure if there is an edge case to be concerned about:
If the user is at the end of a track and attempts to seek forward twice quickly (between ticks), it may be possible that self.next_track is called twice and playback unexpectedly skips forward two tracks instead of the one as expected.

Am open to suggestions for better alternatives.

Instead of attempting to seek beyond the end of the track, jump to the
next track.
Copy link
Owner

@Rigellute Rigellute left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like Spotify itself was invoking the next track when being skipped to a greater length than the current track. https://developer.spotify.com/documentation/web-api/reference/player/seek-to-position-in-currently-playing-track/

But due to the 5 second polling for next playback, this must be unreliable and is indeed the cause of the bug you're fixing here.

So what you've done looks good.

Thank you for the contribution 👍

@Rigellute Rigellute merged commit c890455 into Rigellute:master Nov 1, 2019
Rigellute added a commit that referenced this pull request Nov 1, 2019
This should not happen now due to the fixes in PR #124. However this is
an extra precaution in case tracks can have negative progress due to
some other bug in the future.

Closes #125 issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants