[GH-ISSUE #442] Only subsection of large playlist gets played in spotify connect #283

Closed
opened 2026-02-27 19:29:49 +03:00 by kerem · 16 comments
Owner

Originally created by @nyavorski on GitHub (Mar 3, 2020).
Original GitHub issue: https://github.com/librespot-org/librespot/issues/442

Hi -

I am experiencing an issue where all the songs in a playlist cannot be played through the connect feature. It looks to me like only 80 songs get sent to the play queue, and the queue does not get sent any 'new' songs. When the end of the queue is reached, the initial 80 songs that were sent to the queue are then played again.

[2020-03-03T01:42:06Z INFO librespot] librespot (). Built on 2020-03-02. Build ID: a527MUNO

Expected behavior (casting to Spotify app on Android TV)
https://imgur.com/mX7CePc

Observed behavior (casting to librespot client on a raspberry pi)
https://imgur.com/a/zMnasMu

Thanks and let me know what additional info would be helpful.

Originally created by @nyavorski on GitHub (Mar 3, 2020). Original GitHub issue: https://github.com/librespot-org/librespot/issues/442 Hi - I am experiencing an issue where all the songs in a playlist cannot be played through the connect feature. It looks to me like only 80 songs get sent to the play queue, and the queue does not get sent any 'new' songs. When the end of the queue is reached, the initial 80 songs that were sent to the queue are then played again. [2020-03-03T01:42:06Z INFO librespot] librespot (). Built on 2020-03-02. Build ID: a527MUNO Expected behavior (casting to Spotify app on Android TV) https://imgur.com/mX7CePc Observed behavior (casting to librespot client on a raspberry pi) https://imgur.com/a/zMnasMu Thanks and let me know what additional info would be helpful.
kerem 2026-02-27 19:29:49 +03:00
Author
Owner

@mrwsl commented on GitHub (Mar 3, 2020):

I can confirm this behaviour: If you shuffle a playlist, the same 20 - 30 songs are played in the same order over and over again.

<!-- gh-comment-id:593800246 --> @mrwsl commented on GitHub (Mar 3, 2020): I can confirm this behaviour: If you shuffle a playlist, the same 20 - 30 songs are played in the same order over and over again.
Author
Owner

@ashthespy commented on GitHub (Mar 5, 2020):

It's probably sending the rest of the tracks as context, which we don't handle for playlists.
Can you check the debugging logs to confirm? Else I'll take a look when I get some time later this week..

<!-- gh-comment-id:595169929 --> @ashthespy commented on GitHub (Mar 5, 2020): It's probably sending the rest of the tracks as context, which [we don't handle for playlists.](https://github.com/librespot-org/librespot/blob/66f8a98ad2f5bf35be4daecd788dad6f0d87fb7c/connect/src/spirc.rs#L1104-L1112) Can you check the debugging logs to confirm? Else I'll take a look when I get some time later this week..
Author
Owner

@nyavorski commented on GitHub (Mar 5, 2020):

Here is a log snippet of me loading a playlist, skipping to the last song, skipping the track, and it reloading the same bucket of songs.
[2020-03-05T20:02:11Z DEBUG librespot_connect::spirc] Loading context: <spotify:user:REDACTED:collection> index: [80] of 81

https://pastebin.com/raw/MjiKdw3s

edit: when playing from a playlist instead of 'Liked Songs'
[2020-03-05T21:23:13Z DEBUG librespot_connect::spirc] Loading context: spotify:user:xxx:playlist:foo index: [0] of 81

<!-- gh-comment-id:595424167 --> @nyavorski commented on GitHub (Mar 5, 2020): Here is a log snippet of me loading a playlist, skipping to the last song, skipping the track, and it reloading the same bucket of songs. ` [2020-03-05T20:02:11Z DEBUG librespot_connect::spirc] Loading context: <spotify:user:REDACTED:collection> index: [80] of 81` https://pastebin.com/raw/MjiKdw3s edit: when playing from a playlist instead of 'Liked Songs' [2020-03-05T21:23:13Z DEBUG librespot_connect::spirc] Loading context: <spotify:user:xxx:playlist:foo> index: [0] of 81
Author
Owner

@ashthespy commented on GitHub (Mar 5, 2020):

Looks like we need to fetch context for spotify:user:xxx:collection as well now..

<!-- gh-comment-id:595434543 --> @ashthespy commented on GitHub (Mar 5, 2020): Looks like we need to fetch context for `spotify:user:xxx:collection` as well now..
Author
Owner

@Malvineous commented on GitHub (Jun 3, 2020):

I'm not sure this issue has been fixed - I am still only seeing 90 or so songs being played and then librespot behaves as if the end of the playlist has been reached.

I am completely guessing, but since the web interfaces loads the playlist in chunks (when you scroll to the bottom you have to wait for more songs to load) I am wondering whether the API only returns 80 or so songs at a time, and librespot never refreshes this list?

As a data point, when running librespot compiled from around November 2019, I could extend this limit by clicking play in the web interface. Each time I clicked play, it would start the 80 songs from that point. However while I am now testing @ashthespy's gapless patch against the master branch I have noticed that this no longer happens, and clicking play within the playlist does not refresh the 80 songs.

This results in odd behaviour, such as clicking 'play' in the web interface, then librespot may only play a couple of songs and then stop, because you happened to click play towards the end of the current block of 80-90 songs. You have to then go back and play the following song manually before it will continue with the playlist, but it will only continue for another 80-90 songs or so.

Does librespot need to refresh the playlist at certain intervals?

<!-- gh-comment-id:637943694 --> @Malvineous commented on GitHub (Jun 3, 2020): I'm not sure this issue has been fixed - I am still only seeing 90 or so songs being played and then librespot behaves as if the end of the playlist has been reached. I am completely guessing, but since the web interfaces loads the playlist in chunks (when you scroll to the bottom you have to wait for more songs to load) I am wondering whether the API only returns 80 or so songs at a time, and librespot never refreshes this list? As a data point, when running librespot compiled from around November 2019, I could extend this limit by clicking play in the web interface. Each time I clicked play, it would start the 80 songs from that point. However while I am now testing @ashthespy's gapless patch against the master branch I have noticed that this no longer happens, and clicking play within the playlist does not refresh the 80 songs. This results in odd behaviour, such as clicking 'play' in the web interface, then librespot may only play a couple of songs and then stop, because you happened to click play towards the end of the current block of 80-90 songs. You have to then go back and play the following song manually before it will continue with the playlist, but it will only continue for another 80-90 songs or so. Does librespot need to refresh the playlist at certain intervals?
Author
Owner

@mitchgreen commented on GitHub (Nov 2, 2021):

I too am struggling with this issue, compiled from latest release

<!-- gh-comment-id:957075183 --> @mitchgreen commented on GitHub (Nov 2, 2021): I too am struggling with this issue, compiled from latest release
Author
Owner

@roderickvd commented on GitHub (Nov 2, 2021):

Please post the playlist you are encountering this issue with.

<!-- gh-comment-id:957123165 --> @roderickvd commented on GitHub (Nov 2, 2021): Please post the playlist you are encountering this issue with.
Author
Owner

@mitchgreen commented on GitHub (Nov 2, 2021):

Please post the playlist you are encountering this issue with.

Here is a test playlist of mine that I was able to replicate the issue with. Playing with repeat all enabled and shuffle off, song number 81 plays and then the playlist repeats from the beginning as if it had reached the end of the playlist.

https://open.spotify.com/playlist/18uyEBN6Qwmw0Kulxsw7Xk?si=c21466dfde274e60

<!-- gh-comment-id:957827582 --> @mitchgreen commented on GitHub (Nov 2, 2021): > Please post the playlist you are encountering this issue with. Here is a test playlist of mine that I was able to replicate the issue with. Playing with repeat all enabled and shuffle off, song number 81 plays and then the playlist repeats from the beginning as if it had reached the end of the playlist. https://open.spotify.com/playlist/18uyEBN6Qwmw0Kulxsw7Xk?si=c21466dfde274e60
Author
Owner

@mitchgreen commented on GitHub (Nov 3, 2021):

Running librespot with --verbose and reviewing the logs, i'm seeing that the logs indicate [2021-11-03T03:20:42Z DEBUG librespot_connect::spirc] Frame has 81 tracks

Playback works as expected up-to and including track 81 after which Spotify stops (when repeat is not enabled) or loops back to the beginning of the playlist (if repeat all is enabled)

<!-- gh-comment-id:958629973 --> @mitchgreen commented on GitHub (Nov 3, 2021): Running librespot with `--verbose` and reviewing the logs, i'm seeing that the logs indicate `[2021-11-03T03:20:42Z DEBUG librespot_connect::spirc] Frame has 81 tracks` Playback works as expected up-to and including track 81 after which Spotify stops (when repeat is not enabled) or loops back to the beginning of the playlist (if repeat all is enabled)
Author
Owner

@roderickvd commented on GitHub (Nov 3, 2021):

Re-opening. I suspect it is related to #434 where we need to support pagination contexts.
I'm still on the fence whether we should fix this here and now or as part of the new-api efforts.

<!-- gh-comment-id:958743797 --> @roderickvd commented on GitHub (Nov 3, 2021): Re-opening. I suspect it is related to #434 where we need to support pagination contexts. I'm still on the fence whether we should fix this here and now or as part of the `new-api` efforts.
Author
Owner

@BenTilbrook commented on GitHub (Jan 1, 2022):

Any update on this one? Does the new-api branch have a fix, or perhaps some relevant changes that might mitigate it?

<!-- gh-comment-id:1003496462 --> @BenTilbrook commented on GitHub (Jan 1, 2022): Any update on this one? Does the `new-api` branch have a fix, or perhaps some relevant changes that might mitigate it?
Author
Owner

@roderickvd commented on GitHub (Jan 1, 2022):

Not yet. It's part of the new-api scope, which has picked up development again, but we haven't gotten around to it yet. I first want to move from spirc to dealer and see if pagination is still necessary at all.

<!-- gh-comment-id:1003575462 --> @roderickvd commented on GitHub (Jan 1, 2022): Not yet. It's part of the `new-api` scope, which has picked up development again, but we haven't gotten around to it yet. I first want to move from `spirc` to `dealer` and see if pagination is still necessary at all.
Author
Owner

@roderickvd commented on GitHub (Oct 1, 2022):

Reporting back: still the case even with the latest commits. What I tried, but didn't work, is to implement pagination by querying the Apollo station with tracks scope and autoplay=false. But no matter what you set autoplay to, it always returns autoplay recommendations. See my latest comments in #434 on how this may be fixed going forward.

<!-- gh-comment-id:1264494731 --> @roderickvd commented on GitHub (Oct 1, 2022): Reporting back: still the case even with the latest commits. What I tried, but didn't work, is to implement pagination by querying the Apollo station with `tracks` scope and `autoplay=false`. But no matter what you set `autoplay` to, it always returns autoplay recommendations. See my latest comments in #434 on how this may be fixed going forward.
Author
Owner

@Malvineous commented on GitHub (Jan 4, 2025):

Just confirming this is now working well. I can start a playlist with over 160 tracks and it plays right through in order all the way to the end. Thanks for implementing a fix!

<!-- gh-comment-id:2571137138 --> @Malvineous commented on GitHub (Jan 4, 2025): Just confirming this is now working well. I can start a playlist with over 160 tracks and it plays right through in order all the way to the end. Thanks for implementing a fix!
Author
Owner

@Nindouja commented on GitHub (Mar 5, 2025):

I don't see any releases since #1356 got merged. Is there any ETA on the next release ?

<!-- gh-comment-id:2701037752 --> @Nindouja commented on GitHub (Mar 5, 2025): I don't see any releases since #1356 got merged. Is there any ETA on the next release ?
Author
Owner

@photovoltex commented on GitHub (Mar 6, 2025):

There are around 3 PRs left to be merged. They focus on some bugs and a functionality that was removed during #1356. After that and maybe another dependency refresh this should be good to be released :D

I would assume the end of march is realistic. But might be sooner or later as there is no set ETA.

<!-- gh-comment-id:2702998670 --> @photovoltex commented on GitHub (Mar 6, 2025): There are around 3 PRs left to be merged. They focus on some bugs and a functionality that was removed during #1356. After that and maybe another dependency refresh this should be good to be released :D I would assume the end of march is realistic. But might be sooner or later as there is no set ETA.
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/librespot#283
No description provided.