diff --git a/connect/src/spirc.rs b/connect/src/spirc.rs index 150b1331..e19d7b2a 100644 --- a/connect/src/spirc.rs +++ b/connect/src/spirc.rs @@ -1399,15 +1399,8 @@ impl SpircTask { self.add_resolve_context(resolve); } - fn is_playing(&self) -> bool { - matches!( - self.play_status, - SpircPlayStatus::Playing { .. } | SpircPlayStatus::LoadingPlay { .. } - ) - } - fn handle_next(&mut self, track_uri: Option) -> Result<(), Error> { - let continue_playing = self.is_playing(); + let continue_playing = self.connect_state.player().is_playing; let current_uri = self.connect_state.current_track(|t| &t.uri); let mut has_next_track = @@ -1450,7 +1443,7 @@ impl SpircTask { self.connect_state.reset_playback_to_position(None)?; self.handle_stop() } - Some(_) => self.load_track(self.is_playing(), 0)?, + Some(_) => self.load_track(self.connect_state.player().is_playing, 0)?, } } else { self.handle_seek(0); @@ -1573,7 +1566,7 @@ impl SpircTask { async fn notify(&mut self) -> Result<(), Error> { self.connect_state.set_status(&self.play_status); - if self.is_playing() { + if self.connect_state.player().is_playing { self.connect_state .update_position_in_relation(self.now_ms()); }