From 98e9703edbeb2665c9e8e21196d382a7c81e12cd Mon Sep 17 00:00:00 2001 From: Felix Prillwitz Date: Thu, 23 Jan 2025 19:14:48 +0100 Subject: [PATCH] connect: handle dnd of current track (#1449) --- connect/src/state/tracks.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/connect/src/state/tracks.rs b/connect/src/state/tracks.rs index 14e3abcc2..054685757 100644 --- a/connect/src/state/tracks.rs +++ b/connect/src/state/tracks.rs @@ -249,6 +249,14 @@ impl<'ct> ConnectState { self.queue_count += 1; }); + // when you drag 'n drop the current track in the queue view into the "Next from: ..." + // section, it is only send as an empty item with just the provider and metadata, so we have + // to provide set the uri from the current track manually + tracks + .iter_mut() + .filter(|t| t.uri.is_empty()) + .for_each(|t| t.uri = self.current_track(|ct| ct.uri.clone())); + self.player_mut().next_tracks = tracks; }