[GH-ISSUE #523] Rapidly seeking through song causes song to get "stuck" #214

Open
opened 2026-02-28 14:47:48 +03:00 by kerem · 3 comments
Owner

Originally created by @dvdmuckle on GitHub (Jul 10, 2020).
Original GitHub issue: https://github.com/Rigellute/spotify-tui/issues/523

If I try to rapidly seek through a song using < or > numerous times in succession, the song will get stuck at whenever I started seeking and will constantly start seeking to that point instead of seeking back or ahead of that point.

Video: https://asciinema.org/a/o7c0aue0g2np34HCReOQswjwr

I think what's going on is there's a client side calculation of where to seek to (current song position + fifteen seconds), however because the API call takes some time to go through, queuing up multiple seeks doesn't work, as the current song position is retrieved from the API as opposed to some local variable.

Originally created by @dvdmuckle on GitHub (Jul 10, 2020). Original GitHub issue: https://github.com/Rigellute/spotify-tui/issues/523 If I try to rapidly seek through a song using `<` or `>` numerous times in succession, the song will get stuck at whenever I started seeking and will constantly start seeking to that point instead of seeking back or ahead of that point. Video: https://asciinema.org/a/o7c0aue0g2np34HCReOQswjwr I think what's going on is there's a client side calculation of where to seek to (current song position + fifteen seconds), however because the API call takes some time to go through, queuing up multiple seeks doesn't work, as the current song position is retrieved from the API as opposed to some local variable.
Author
Owner

@Rigellute commented on GitHub (Jul 22, 2020):

Thank you for the asciinema!

I think a fix for this would be to "debounce" the seek, sum the total, and then make one api request with the final seek

<!-- gh-comment-id:662339153 --> @Rigellute commented on GitHub (Jul 22, 2020): Thank you for the asciinema! I think a fix for this would be to "debounce" the seek, sum the total, and then make one api request with the final seek
Author
Owner

@dp304 commented on GitHub (Oct 29, 2020):

See PR #640
There is a little latency before the actual seeking (up to 5s), but on the other hand, it is very light on API calls.
The visual feedback is quasi-instant though.

<!-- gh-comment-id:718925391 --> @dp304 commented on GitHub (Oct 29, 2020): See PR #640 There is a little latency before the actual seeking (up to 5s), but on the other hand, it is very light on API calls. The visual feedback is quasi-instant though.
Author
Owner

@dvdmuckle commented on GitHub (Oct 29, 2020):

That PR is exactly the solution to solve this issue, awesome! Once that's merged in this can be closed.

<!-- gh-comment-id:718949825 --> @dvdmuckle commented on GitHub (Oct 29, 2020): That PR is exactly the solution to solve this issue, awesome! Once that's merged in this can be closed.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/spotify-tui#214
No description provided.