Not all songs are added to the queue when a playlist is played
Describe the bug I have a playlist with 200+ songs, when I select a song in a playlist, spotify player doesn't add the whole playlist to the queue. the weird part is that the number of songs added to the queue is random depending on the song I select first, sometimes 20, 40 or only 5. Multiple playlists have the same issue. When I select a song with my phone using the same streaming backend, all songs are correctly added to the queue.
To Reproduce Select a song in a playlist with spotify player.
Expected behaviour All songs in the selected playlist added to the queue.
Log and backtrace
Log and backtrace of a run reproducing the bug to help debug the issue, which are usually located in $HOME/.cache/spotify-player/.
spotify-player-25-07-03-12-58.log
Screenshots
You can see that Hydrogen for example is not in the queue.
Environment
- OS: Arch Linux
- Application version: 0.20.6
I'm not sure if this is related, but I think shuffle doesn't work because of it. If you play a large playlist on shuffle, it plays tracks from within the same 100 track section. Ignoring the rest of the playlist, only moving 40 indices away in either direction from the initial track played.
I have a playlist with 200+ songs, when I select a song in a playlist, spotify player doesn't add the whole playlist to the queue. the weird part is that the number of songs added to the queue is random depending on the song I select first, sometimes 20, 40 or only 5.
Your observation about the number of songs queued depends on the starting song is correct and it matches mine as well. This is why I normally use PlayRandom instead of ChooseSelected to start playing a playlist to avoid having only a few songs played or when I want to change the set of songs played.
I believe this weird behaviour comes from librespot and how the library handles the playback. I'm pretty sure they have an open issue about it. It's interesting that you don't encounter the same issue when selecting song from other devices though cause I never tried that before 🤔.
Your observation about the number of songs queued depends on the starting song is correct and it matches mine as well. This is why I normally use
PlayRandominstead ofChooseSelectedto start playing a playlist to avoid having only a few songs played or when I want to change the set of songs played.
Indeed, when I use PlayRandom it actually queue properly now.
I believe this weird behaviour comes from librespot and how the library handles the playback. I'm pretty sure they have an open issue about it. It's interesting that you don't encounter the same issue when selecting song from other devices though cause I never tried that before 🤔.
Yes that's weird, I didn't mention but I use spotifyd as streaming backend, which uses librespot as well, never had problem with shuffle when starting the selected song on spotfyd with my phone. That's why I think it is spotify_player side.
Related to my comment in https://github.com/aome510/spotify-player/issues/153#issuecomment-3132752694, I think if we implemented a custom playback/queue logic for the integrated player, then the shuffle logic can probably be more consistent and predictable.