feat(reco): common/recent split + round-robin + 48h results cache + toast
Owner-directed polish on the Recommendations tab to make it richer + faster + non-repetitive. - Common vs Recent split: the single "Recommended Artists" row over-represented a recent soundtrack binge (a live preview showed "The Newton Brothers" flooding the row with 8 film composers while the core metal was buried). Split into two rows seeded from DIFFERENT periods: "More like the artists you love" (overall top) and "Based on what you've been into lately" (1-month top) — so recent one-offs never pollute the core taste. = 7 rows now. - Round-robin per seed inside each artist row (re-added from the v1 engine; the rework had dropped it) + per-seed cap, so no single seed floods the carousel. - Results cache (48h TTL): caches the FULL built rows (serialized ExternalCarousels) per-user, keyed by connected sources. Tab open within 48h = INSTANT paint from cache, zero fetch; stale/missing = build + store. Rebuilds every 48h (fresh rotation) so it's never "eternally the same" and opens stop being slow. Distinct from the rec->Qobuz resolution cache (30d/7d). - Toast on a real fetch (cache miss/stale): "Generating recommendations…" so the wait is communicated; the skeleton stays; no toast on a cache hit. cargo check -p qbz green (6m44s). cc
This commit is contained in:
8 files changed
+266
-70
No files matched your search
@@ -21,7 +21,8 @@ export component ExternalRecoView inherits VerticalLayout {
|
||||
callback play-track(string);
|
||||
|
||||
property <bool> any-content:
|
||||
ExternalRecoState.rec-artists.length > 0
|
||||
ExternalRecoState.rec-artists-common.length > 0
|
||||
|| ExternalRecoState.rec-artists-recent.length > 0
|
||||
|| ExternalRecoState.rec-albums.albums.length > 0
|
||||
|| ExternalRecoState.fresh-releases.albums.length > 0
|
||||
|| ExternalRecoState.weekly-exploration.length > 0
|
||||
@@ -35,10 +36,22 @@ export component ExternalRecoView inherits VerticalLayout {
|
||||
|
||||
if ExternalRecoState.loading && !root.any-content: HomeSkeleton { }
|
||||
|
||||
// Recommended Artists (Last.fm similar, not heard) — with "Similar to…".
|
||||
if ExternalRecoState.rec-artists.length > 0: ArtistCarousel {
|
||||
title: @tr("Recommended Artists");
|
||||
artists: ExternalRecoState.rec-artists;
|
||||
// More like the artists you love (COMMON taste — overall top).
|
||||
if ExternalRecoState.rec-artists-common.length > 0: ArtistCarousel {
|
||||
title: @tr("More like the artists you love");
|
||||
artists: ExternalRecoState.rec-artists-common;
|
||||
artist-clicked(id) => {
|
||||
root.open-artist(id);
|
||||
}
|
||||
media-action(kind, id, action) => {
|
||||
root.media-action(kind, id, action);
|
||||
}
|
||||
}
|
||||
|
||||
// Based on what you've been into lately (RECENT taste — 1-month top).
|
||||
if ExternalRecoState.rec-artists-recent.length > 0: ArtistCarousel {
|
||||
title: @tr("Based on what you've been into lately");
|
||||
artists: ExternalRecoState.rec-artists-recent;
|
||||
artist-clicked(id) => {
|
||||
root.open-artist(id);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user