fix(qt): album carousel cards — artist fallback and similar-album genre

Two card-data gaps on the album page's bottom rails:

- "Listening suggestions" (/album/suggest) rendered no artist line:
  the Qt mapping read only the flat `artist` field, while Slint's
  album_map::album_artist falls back to the artists[] array (main-artist
  role, else first entry) — the shape /album/suggest actually returns for
  some albums. The fallback is ported as card_artist.
- "Similar albums" (Last.fm row) showed no genre in the hover overlay:
  AlbumReco carried no genre at all. build_album_reco has the resolving
  Qobuz Album in hand, so the field now exists (serde-defaulted, so
  cached reco JSON keeps working) and is mapped through. Slint's
  external_reco::album_card can map it too after the next merge — its
  checkout is a different branch and is untouched here.

km
This commit is contained in:
vicrodh committed 2026-08-10 20:23:45 -06:00
1 parent 98dfcd8173
commit 2ca7b672e0
3 files changed
+40 -3

No files matched your search

+5
View File
@@ -76,6 +76,11 @@ pub struct AlbumReco {
pub artwork_url: String,
#[serde(default)]
pub subtitle: String,
/// Genre name from the resolving Qobuz album — feeds the card hover
/// overlay. Defaulted for backward compatibility with cached JSON
/// written before the field existed.
#[serde(default)]
pub genre: String,
#[serde(default = "default_source")]
pub source: RecoSource,
}
+5
View File
@@ -284,6 +284,11 @@ pub fn build_album_reco(album: &Album, subtitle: String, source: RecoSource) ->
quality_label,
artwork_url: album.image.best().cloned().unwrap_or_default(),
subtitle,
genre: album
.genre
.as_ref()
.map(|g| g.name.clone())
.unwrap_or_default(),
source,
}
}