Skip to content

Commit

Permalink
connect: handle transferred queue again
Browse files Browse the repository at this point in the history
  • Loading branch information
photovoltex committed Oct 31, 2024
1 parent 37d2539 commit d5e487b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
3 changes: 2 additions & 1 deletion connect/src/spirc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
10 changes: 10 additions & 0 deletions connect/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit d5e487b

Please sign in to comment.