From 40df0d83be73029fb387aa00c98968cbd77e6362 Mon Sep 17 00:00:00 2001 From: vicrodh <103399283+vicrodh@users.noreply.github.com> Date: Fri, 4 Sep 2026 10:41:51 -0600 Subject: [PATCH 1/7] feat(library): keep the artist page's in-library rows live MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The artist page's "In library" count was a snapshot of the Library feed taken when the document was built, over a feed that only loads when the Library view is opened and that never gains a row for a favourite created afterwards. On a cold session, or after an account switch, every artist opened with an invisible toggle; hearting an album on the page moved nothing until the next session. - library_qt: `artist_library_items` computes the tab's rows with the Library > Albums/Tracks rule (favourites ∪ purchases, one row per entity, purchase row representative, `is_favorite` = also hearted); local/Plex and `following` rows never enter. A track is a member through its performer OR its album's main artist (new `FeedItem::album_artist_id`, fed by the new `AlbumSummary::artist`, which the wire carries — search-results capture). - library_qt: `reconcile_qobuz_favorite` inserts the row of a freshly hearted track/album (one `/track/get` or `/album/get`, mapped by the same producers the full load uses) and drops the `favorites` rows of a cleared one, keeping a purchase row with its heart cleared. - artist_qt: the rows ride inside the artist document (`libraryItems`), and `refresh_library_items` / `apply_favorite_change` republish them through `publish_patch` when the feed lands or a heart settles. A debug-level log prints the membership split for the open artist. - main: `settle_favorite` is the one settle point (reconcile, fan out, republish on membership change) for the Library and queue-panel hearts; `open_artist` warms the feed in the background; `reload_library` hands the open page its rows; `warm_library` serves the toggle from cache. Tests: membership by performer or album artist, exclusion of local / following, dedup on the purchase row, and the `top_queue` contract that a foreign id starts the popular list at row 0 (the #737 defect class). cc --- crates/qbz-core/src/core.rs | 1 + crates/qbz-models/src/types.rs | 7 + .../src/purchases_service.rs | 3 + crates/qbz-playlist-import/src/match_qobuz.rs | 1 + crates/qbz-qt/src/artist_qt.rs | 142 +++++++++- crates/qbz-qt/src/library_qt.rs | 262 +++++++++++++++++- crates/qbz-qt/src/main.rs | 52 +++- crates/qbz-qt/src/queue_qt.rs | 2 +- crates/qbzd/src/api/queue.rs | 1 + 9 files changed, 450 insertions(+), 21 deletions(-) diff --git a/crates/qbz-core/src/core.rs b/crates/qbz-core/src/core.rs index 2b6fbafec..880de3afd 100644 --- a/crates/qbz-core/src/core.rs +++ b/crates/qbz-core/src/core.rs @@ -3877,6 +3877,7 @@ mod tests { image: Default::default(), label: None, genre: None, + artist: None, }); t } diff --git a/crates/qbz-models/src/types.rs b/crates/qbz-models/src/types.rs index e36b28799..f31249dae 100644 --- a/crates/qbz-models/src/types.rs +++ b/crates/qbz-models/src/types.rs @@ -672,6 +672,13 @@ pub struct AlbumSummary { pub label: Option