From c73871c516b7edd9e27f0ea2f5cd22e4b00002ec Mon Sep 17 00:00:00 2001 From: Felix Prillwitz Date: Tue, 10 Dec 2024 21:38:36 +0100 Subject: [PATCH] connect: use is_playing from connect_state --- connect/src/spirc.rs | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) 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()); }