feat(library): album-identity mode — header dropdown, Settings row, persistence

Spec 2026-07-19-local-album-grouping-mode (A2-A5 + i18n). The Albums tab
gains a third header dropdown ('Albums by folder' / 'Albums by metadata')
and Settings > Local Library a matching 'Album grouping' row — both write
the same pref: LocalLibraryState.albums-id-mode, persisted in
locallibrary_ui.json (default 'folder': compilations and box sets stay
whole; the metadata split stays opt-in for #411's use case).

The group key changes with the mode, so switching reloads the Albums set
(reload_albums) and invalidates the Artists tab (its album cache groups
the same way — a folder-mode compilation cross-lists under every artist
in all_artists, the owner's 'appears in all artists' ask). Threaded
through spawn_albums_load, seed_counts, the Plex quality-hydration
aggregate lookup, and the artists feed; myqbz_builder pins Metadata
(artist-scoped candidates, not the Albums view).

5 msgids x 8 locales (msgfmt clean); slintcheck green.

km
This commit is contained in:
vicrodh committed 2026-07-21 14:11:04 -06:00
1 parent 77e41caa2f
commit c72e71d410
15 files changed
+250 -1

No files matched your search

+9
View File
@@ -1194,6 +1194,12 @@ export global LocalLibraryState {
in property <[AlbumCardItem]> albums-visible: [];
in property <[DiscoverSection]> albums-grouped: [];
in-out property <string> albums-group: "off"; // off | alpha | artist
// Album IDENTITY mode — what one "album" IS on the Albums tab:
// "folder" (one card per album-root folder; default — compilations/box
// sets stay whole) | "metadata" (split by album+artist tags, #411).
// Persisted in locallibrary_ui.json; switching re-queries the DB (unlike
// sort/group, which re-derive client-side).
in-out property <string> albums-id-mode: "folder";
in property <[AlphaJump]> albums-alpha: []; // A-Z jumps (alpha group)
in property <int> albums-shown: 0; // count after filter
in-out property <bool> albums-multi-select: false; // album checkboxes on
@@ -1318,6 +1324,9 @@ export global LocalLibraryActions {
callback albums-set-sort(string /* sort key */);
// Set group mode (off|alpha|artist) + re-derive.
callback albums-set-group(string /* mode */);
// Set the album identity mode (folder|metadata) + persist + reload the
// albums set (the group key changes — a derive is not enough).
callback albums-set-id-mode(string /* mode */);
// Set grid|list view.
callback albums-set-view(string /* mode */);
// A quality/format/source filter toggle changed -> re-derive.