From 124d97e7d2bc3491a4ef684a9e22af1f0450f284 Mon Sep 17 00:00:00 2001 From: vicrodh <103399283+vicrodh@users.noreply.github.com> Date: Sat, 27 Jun 2026 16:53:23 -0600 Subject: [PATCH] =?UTF-8?q?feat(reco):=20Recommended=20Albums=20=E2=80=94?= =?UTF-8?q?=20one=20per=20artist,=20>=3D20=20albums?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Was 6 albums each from 8 one-month top artists (yielding ~9 from 4 after Qobuz validation). Take one album per artist (break) and seed from 50 lifetime top artists so the row spans >=20 distinct artists after catalog validation. cc --- crates/qbz-external-reco/src/carousels.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/crates/qbz-external-reco/src/carousels.rs b/crates/qbz-external-reco/src/carousels.rs index f6e171256..561696b20 100644 --- a/crates/qbz-external-reco/src/carousels.rs +++ b/crates/qbz-external-reco/src/carousels.rs @@ -26,7 +26,7 @@ const PLAYLIST_CAP: usize = 30; const VALIDATE_CONCURRENCY: usize = 6; const ARTIST_SEEDS: usize = 6; const SIMILAR_PER_SEED: u32 = 12; -const KNOWN_ARTISTS_PER_BUILD: usize = 8; +const KNOWN_ARTISTS_PER_BUILD: usize = 50; type Cache<'a> = Option<&'a Mutex>; @@ -262,9 +262,12 @@ pub async fn build_rec_albums(inputs: &RecoInputs<'_>, history: &ExtHistory) -> let Some(lf) = &inputs.lastfm else { return Vec::new(); }; + // Lifetime top artists (not 1-month) for VOLUME: Recommended Albums shows + // one album per artist, so we need many distinct artists to clear >=20 + // after Qobuz-catalog validation (the recent-taste rows cover 1-month). let artists: Vec = lf .client - .get_top_artists(&lf.username, "1month", 10) + .get_top_artists(&lf.username, "overall", 60) .await .unwrap_or_default() .into_iter() @@ -300,9 +303,12 @@ pub async fn build_rec_albums(inputs: &RecoInputs<'_>, history: &ExtHistory) -> score: al.playcount as f32, subtitle: format!("From {} — you haven't heard this one", artist), }); + // One album per artist (owner request): take this artist's top + // not-yet-heard album and move on, so the row spans >=20 artists. + break; } } - candidates.truncate(50); + candidates.truncate(60); let pool = validate_album_pool(inputs.catalog, inputs.cache, candidates).await; rotate_take(pool, inputs.rotation_seed, DISPLAY_CAP) }