kaaholst / android-squeezer

Remote control for your Logitech Media Server ("Squeezeserver" etc) and players.
Apache License 2.0
77 stars 17 forks source link

Fix for Random Play with several players and attempted fix for breakdown of random play after about 60 minutes #738

Closed viertelb closed 2 years ago

viertelb commented 2 years ago

Fixes an issue where the parallel start of several random plays resulted in inaccurate playlist generation upon start. There is still a problem with some kind of timeout after 30 minutes to 60 minutes I would guess which might be related to the app going to background. In that case the random play is ending and is not possible to resume. Mabe this is related to the fact that I currently not yet persist the random play status of the player. (I am fine with using this in beta as is, also because I can test more. People will not use it that much.)

viertelb commented 2 years ago

Moved it to PlayerState. But the problem persists. One moment the playerstate for random play is "true", then the active player changed (probably due to a reconnection) and then the playerstate for random play is "false". It should be still "true" because it is the same player that was seconds ago indicating "true". I set it true if a certain player is starting random play. I unset it only in the case that something was appended to the playlist (or the playlist was deleted and does just contain one track). Or maybe it is better to say: random play stays true as long as the music changes to the last track. So, I think the change in the player state mRandomPlay comes from a parcel not beeing correctly saved/loaded. Maybe the parcel write needs to be called somewhere...

viertelb commented 2 years ago

Today, I could not reproduce any errors. Random Play on three players is running for several hours now.

Please merge.

kaaholst commented 2 years ago

Merged. I think the random play property sits better in PlayerState. However I think the root cause was that it should be in the Parcel.