From 74d2059b8afa6ae040d57c32ce9a60ccef759ffa Mon Sep 17 00:00:00 2001 From: vicrodh <103399283+vicrodh@users.noreply.github.com> Date: Sun, 25 Jan 2026 22:18:15 -0600 Subject: [PATCH] fix: use correct fields from AlbumSummary in musician appearances AlbumSummary only has id, title, image, and label fields. The code was incorrectly trying to access artist and release_date_original which only exist on the full Album struct. - Use track.performer for artist_name instead of album.artist - Set year to None since AlbumSummary doesn't have release_date - Fix image access since ImageSet is direct field, not Option - Fix title access since String is direct field, not Option --- src-tauri/src/commands/musician.rs | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/src-tauri/src/commands/musician.rs b/src-tauri/src/commands/musician.rs index 6a5cf3134..9a04e290f 100644 --- a/src-tauri/src/commands/musician.rs +++ b/src-tauri/src/commands/musician.rs @@ -171,24 +171,21 @@ pub async fn get_musician_appearances( albums.push(AlbumAppearance { album_id: album.id.clone(), - album_title: album.title.clone().unwrap_or_default(), + album_title: album.title.clone(), album_artwork: album .image - .as_ref() - .and_then(|i| i.large.clone()) - .or_else(|| album.image.as_ref().and_then(|i| i.thumbnail.clone())) + .large + .clone() + .or_else(|| album.image.thumbnail.clone()) .unwrap_or_default(), + // AlbumSummary doesn't have artist field, use track's performer artist_name: track - .album + .performer .as_ref() - .and_then(|a| a.artist.as_ref()) - .map(|a| a.name.clone()) + .map(|p| p.name.clone()) .unwrap_or_else(|| performer_name.to_string()), - year: album - .release_date_original - .as_ref() - .and_then(|d| d.split('-').next()) - .map(|s| s.to_string()), + // AlbumSummary doesn't have release_date_original + year: None, role_on_album: role, }); }