fix(library): single-album play-next/queue on the local albums surface (#636)
The AlbumCard context menu on local albums (LocalLibrary grids, folder or Plex source) routed play-next/queue to LocalLibraryActions.album-action, whose handler only implemented play / toggle-select / favorite — the two queue actions fell into a catch-all that logged "queue slice pending" and did nothing. Resolve the album's tracks with the same source-aware resolver play uses (local_library::fetch_album_tracks_blocking — local folders AND Plex) and enqueue them via playback::enqueue_local_tracks, mirroring the already- working albums bulk-action arm. Track-level play-next/queue was never affected. Port of d0f67149. km
This commit is contained in:
1 file changed
+20
-2
+20
-2
@@ -18179,9 +18179,27 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
local_library::toggle_album_favorite(&w, id.as_str());
|
local_library::toggle_album_favorite(&w, id.as_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
"play-next" | "queue" => {
|
||||||
|
// Single-album play-next / queue (#636 — this arm used to
|
||||||
|
// be a "queue slice pending" stub): resolve the album's
|
||||||
|
// tracks source-aware (local folders AND Plex, the same
|
||||||
|
// resolver `play` uses) and enqueue the whole album
|
||||||
|
// without starting playback.
|
||||||
|
let play_next = action.as_str() == "play-next";
|
||||||
|
let runtime = runtime.clone();
|
||||||
|
let handle2 = handle.clone();
|
||||||
|
let album_id = id.to_string();
|
||||||
|
handle.spawn(async move {
|
||||||
|
let rows = tokio::task::spawn_blocking(move || {
|
||||||
|
local_library::fetch_album_tracks_blocking(&album_id)
|
||||||
|
})
|
||||||
|
.await
|
||||||
|
.unwrap_or_default();
|
||||||
|
playback::enqueue_local_tracks(runtime, handle2, rows, play_next);
|
||||||
|
});
|
||||||
|
}
|
||||||
_ => {
|
_ => {
|
||||||
// Single-album play-next / queue land with a later slice.
|
log::debug!("[qbz-slint] unhandled local album action: {id} {action}");
|
||||||
log::debug!("[qbz-slint] local album action (queue slice pending): {id} {action}");
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user