Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Shuffle buttons don't work on some clients. #82
When using librespot, I've noticed that I can't engage shuffle mode (or if it was previously engaged, I can't disengage it). This happens on Android clients, but not on the client on my Mac.
From the console on the machine running librespot, I see this:
By "works" I should say that there is no feedback in the client. And it doesn't seem to "work" in that turning on shuffle in the android client doesn't show the state change in the Mac client.
It may also happen with the repeat feature.
This reminds me of a situation with a previous build, where the status of the player couldn't keep track of the time... when launching a client, it would start the playback time at 0:00, no matter what the actual playing was. Perhaps it's related? Something about parsing a heartbeat/status chunk?
That 'works' because the official client just hands librespot the already shuffled track list. Librespot doesn't really have to do anything in that case.
You can see my naive (and very incorrect) implementation of shuffle and repeat at master...kingosticks:master. I got stuck trying to implement shuffle properly and I've some questions for anyone familiar with how it (spirc?) is supposed to work regarding this.
The incorrect aspect of what I did is that mime treats 'queued' tracks like any other track in the list. This is wrong as 'queued' tracks should keep their positions and it's only the remaining tracks that need to be shuffled. That's a simple enough improvement to do.
My problem is how do you restore the original track order when the user disables shuffle? You don't know what that original order was. Are you meant to use the context uri state to reload the track list (assuming you also fix librespot to keep that state). And then what do you do with any 'queued' tracks that are still present, just insert them at the front? I could probably answer the latter question with some more experiments but the context uri thing is a total guess.