diff --git a/connect/src/spirc.rs b/connect/src/spirc.rs index 874a003b..94681c62 100644 --- a/connect/src/spirc.rs +++ b/connect/src/spirc.rs @@ -1057,7 +1057,7 @@ impl SpircTask { fn handle_stop(&mut self) { self.player.stop(); self.connect_state.update_position(0, self.now_ms()); - self.connect_state.clear_next_tracks(true); + self.connect_state.clear_next_tracks(); if let Err(why) = self.connect_state.reset_playback_to_position(None) { warn!("failed filling up next_track during stopping: {why}") @@ -1136,7 +1136,7 @@ impl SpircTask { self.connect_state.merge_context(context); // load here, so that we clear the queue only after we definitely retrieved a new context - self.connect_state.clear_next_tracks(false); + self.connect_state.clear_next_tracks(); self.connect_state.clear_restrictions(); debug!("play track <{:?}>", cmd.playing_track); diff --git a/connect/src/state.rs b/connect/src/state.rs index 2c1bf944..0d9e89b9 100644 --- a/connect/src/state.rs +++ b/connect/src/state.rs @@ -380,7 +380,7 @@ impl ConnectState { debug!("has {} prev tracks", self.prev_tracks().len()) } - self.clear_next_tracks(true); + self.clear_next_tracks(); self.fill_up_next_tracks()?; self.update_restrictions(); diff --git a/connect/src/state/context.rs b/connect/src/state/context.rs index 5b9621b0..b3804561 100644 --- a/connect/src/state/context.rs +++ b/connect/src/state/context.rs @@ -237,7 +237,7 @@ impl ConnectState { Err(_) => {} } // enforce reloading the context - self.clear_next_tracks(true); + self.clear_next_tracks(); } self.context = Some(new_context); diff --git a/connect/src/state/options.rs b/connect/src/state/options.rs index 12040d3d..38357308 100644 --- a/connect/src/state/options.rs +++ b/connect/src/state/options.rs @@ -47,7 +47,7 @@ impl ConnectState { } self.clear_prev_track(); - self.clear_next_tracks(true); + self.clear_next_tracks(); let current_uri = self.current_track(|t| &t.uri); diff --git a/connect/src/state/tracks.rs b/connect/src/state/tracks.rs index 499446bb..c3c26b70 100644 --- a/connect/src/state/tracks.rs +++ b/connect/src/state/tracks.rs @@ -260,12 +260,7 @@ impl<'ct> ConnectState { self.prev_tracks_mut().clear() } - pub fn clear_next_tracks(&mut self, keep_queued: bool) { - if !keep_queued { - self.next_tracks_mut().clear(); - return; - } - + pub fn clear_next_tracks(&mut self) { // respect queued track and don't throw them out of our next played tracks let first_non_queued_track = self .next_tracks() diff --git a/connect/src/state/transfer.rs b/connect/src/state/transfer.rs index 777a2906..098a9904 100644 --- a/connect/src/state/transfer.rs +++ b/connect/src/state/transfer.rs @@ -67,7 +67,7 @@ impl ConnectState { } self.clear_prev_track(); - self.clear_next_tracks(false); + self.clear_next_tracks(); self.update_queue_revision() }