From d5e487ba49f387efdeb61f45cff71942edbe2dd6 Mon Sep 17 00:00:00 2001 From: Felix Prillwitz Date: Thu, 31 Oct 2024 23:15:27 +0100 Subject: [PATCH] connect: handle transferred queue again --- connect/src/spirc.rs | 3 ++- connect/src/state.rs | 10 ++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/connect/src/spirc.rs b/connect/src/spirc.rs index 115aab448..5c04fdf21 100644 --- a/connect/src/spirc.rs +++ b/connect/src/spirc.rs @@ -1320,7 +1320,8 @@ impl SpircTask { let continue_playing = self.is_playing(); let current_uri = self.connect_state.current_track(|t| &t.uri); - let mut has_next_track = matches!(track_uri, Some(ref track_uri) if current_uri == track_uri); + let mut has_next_track = + matches!(track_uri, Some(ref track_uri) if current_uri == track_uri); if !has_next_track { has_next_track = loop { diff --git a/connect/src/state.rs b/connect/src/state.rs index 54968f35a..685504c89 100644 --- a/connect/src/state.rs +++ b/connect/src/state.rs @@ -410,6 +410,16 @@ impl ConnectState { self.shuffling_context() ); + for track in &transfer.queue.tracks { + if let Ok(queued_track) = self.context_to_provided_track( + track, + self.context_uri().clone(), + Some(Provider::Queue), + ) { + self.add_to_queue(queued_track, false); + } + } + if self.shuffling_context() { self.set_current_track(current_index.unwrap_or_default())?; self.set_shuffle(true);