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:
vicrodh committed 2026-07-22 16:49:10 -06:00
1 parent ee37d65f40
commit 6c5996cc50
1 file changed
+20 -2
+20 -2
View File
@@ -18179,9 +18179,27 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
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] local album action (queue slice pending): {id} {action}");
log::debug!("[qbz-slint] unhandled local album action: {id} {action}");
}
});
}