Merge pull request #386 from willstott101/cha_cha_shuffle

Ignore false shuffle/repeat when changing contexts to match Android behaviour (fixes: #266)
This commit is contained in:
Sasha Hilton 2020-02-13 21:43:43 +01:00 committed by GitHub
commit 08c239319c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -899,8 +899,16 @@ impl SpircTask {
self.state.set_playing_track_index(index); self.state.set_playing_track_index(index);
self.state.set_track(tracks.into_iter().cloned().collect()); self.state.set_track(tracks.into_iter().cloned().collect());
self.state.set_context_uri(context_uri); self.state.set_context_uri(context_uri);
self.state.set_repeat(frame.get_state().get_repeat()); // has_shuffle/repeat seem to always be true in these replace msgs,
self.state.set_shuffle(frame.get_state().get_shuffle()); // but to replicate the behaviour of the Android client we have to
// ignore false values.
let state = frame.get_state();
if state.get_repeat() {
self.state.set_repeat(true);
}
if state.get_shuffle() {
self.state.set_shuffle(true);
}
} }
// should this be a method of SpotifyId directly? // should this be a method of SpotifyId directly?