feat(locallibrary): complete Albums 1:1 + dedicated local album view with versions
Albums tab — full 1:1 with Tauri in one pass: - Switch from the chunked-paginated grid to a full-load + in-memory derive so grouping/filtering span the whole set. derive_albums = search + sort + group (off / by letter with A-Z jump / by artist, both with section headers) + the quality/format/source filter (1:1 with matchesQualityFilters: OR within a group, AND between groups; empty group passes). - Grid/list view toggle; the list view shows a SOURCE column (Local/Offline/ Plex), placed after TYPE. Filter popup now FLOATS (sibling of the content layout, not a layout slot) with an active-count badge. Fixed the year sort (sort_album_items maps year-asc/desc — was also silently broken in Folders). - Album covers dual-set by id across the full set + visible + grouped sections. Dedicated local album view — SEPARATE from the Qobuz AlbumView: - New ContentView::local-album + NavEntry::LocalAlbum + ui/album/LocalAlbumView.slint, reusing TrackRow/NavButtons/CircleAction/QualityBadge internals but ONLY local actions (play all / shuffle / edit tags / add to playlist) — no Qobuz chrome. - Versions: an album's tracks are split by source directory into versions, so multiple copies of the same album no longer merge into a duplicated track list. Best-quality version is the default; a source-icon version picker (hard-drive / Qobuz / Plex glyph in both the selected display and the options) switches the shown copy in place. The album cover is the best-quality version that has one, falling through versions, else a placeholder (covers backfilled from disk via fill_missing_covers). Header padding-top 11px matches the app. Fix: Artists tab deadlock — fetch_missing_artist_images snapshotted names with a blocking rx.recv() called from inside an event-loop closure, freezing the UI (static spinner, no error). Names are now snapshotted on the UI thread and passed in; the worker never blocks the event loop. cc
This commit is contained in:
13 files changed
+1440
-360
No files matched your search
@@ -94,6 +94,8 @@ pub enum ArtworkTarget {
|
||||
/// re-derived, so they must be matched by name). `gen` drops a stale paint
|
||||
/// after a reload/rescan.
|
||||
LocalArtistRowImage { index: usize, gen: u64 },
|
||||
/// The cover of the dedicated Local Library album view (LocalAlbumState).
|
||||
LocalAlbumViewCover,
|
||||
/// A card in FavoritesState.artists[index].
|
||||
FavoriteArtist { index: usize },
|
||||
/// A card in FavoritesState.labels[index].
|
||||
@@ -615,14 +617,15 @@ fn apply_artwork(
|
||||
}
|
||||
}
|
||||
ArtworkTarget::LocalAlbumCard { index, gen } => {
|
||||
// Drop the cover if a reload superseded the page it belongs to.
|
||||
// Drop the cover if a reload superseded the set it belongs to.
|
||||
if !crate::local_library::albums_gen_current(gen) {
|
||||
return;
|
||||
}
|
||||
let model = window.global::<crate::LocalLibraryState>().get_albums();
|
||||
if let Some(mut item) = model.row_data(index) {
|
||||
item.artwork = image;
|
||||
model.set_row_data(index, item);
|
||||
if let Some(item) = model.row_data(index) {
|
||||
// Dual-set by id onto the full set + visible + grouped sections.
|
||||
let id = item.id.to_string();
|
||||
crate::local_library::set_local_album_artwork(window, &id, image);
|
||||
}
|
||||
}
|
||||
ArtworkTarget::LocalFolderCard { index } => {
|
||||
@@ -651,6 +654,9 @@ fn apply_artwork(
|
||||
}
|
||||
}
|
||||
}
|
||||
ArtworkTarget::LocalAlbumViewCover => {
|
||||
window.global::<crate::LocalAlbumState>().set_cover(image);
|
||||
}
|
||||
ArtworkTarget::FavoriteArtist { index } => {
|
||||
let model = window.global::<crate::FavoritesState>().get_artists();
|
||||
if let Some(mut item) = model.row_data(index) {
|
||||
|
||||
Reference in new issue
Block a user