From f8a56d7f4b63222416a225410d2fdd7aa2ca1efc Mon Sep 17 00:00:00 2001 From: vicrodh <103399283+vicrodh@users.noreply.github.com> Date: Fri, 20 Feb 2026 21:38:56 -0600 Subject: [PATCH] fix(radio): fetch full track data for album radio The /radio/album endpoint returns partial track objects without the performer field, causing all tracks to show as "Unknown Artist". Extract track IDs from the response and fetch each via get_track() to get complete data, matching the pattern used by artist/track radio. --- src-tauri/src/commands_v2.rs | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/src-tauri/src/commands_v2.rs b/src-tauri/src/commands_v2.rs index 7349d308d..cde04f819 100644 --- a/src-tauri/src/commands_v2.rs +++ b/src-tauri/src/commands_v2.rs @@ -4337,21 +4337,28 @@ pub async fn v2_create_album_radio( .await .map_err(|e| format!("Failed to fetch album radio: {}", e))?; - let tracks: Vec = radio_response - .tracks - .items - .into_iter() - .filter(|track| { + // The radio endpoint returns partial track objects (missing performer, etc.). + // Extract IDs and fetch full track data individually, same as artist/track radio. + let track_ids: Vec = radio_response.tracks.items.iter().map(|t| t.id).collect(); + + if track_ids.is_empty() { + return Err("No radio tracks returned for this album".to_string()); + } + + let mut tracks = Vec::new(); + for track_id in track_ids { + if let Ok(track) = client.get_track(track_id).await { if let Some(ref performer) = track.performer { - !blacklist_state.is_blacklisted(performer.id) - } else { - true + if blacklist_state.is_blacklisted(performer.id) { + continue; + } } - }) - .collect(); + tracks.push(track); + } + } if tracks.is_empty() { - return Err("No radio tracks returned for this album".to_string()); + return Err("Failed to fetch any radio tracks".to_string()); } let queue_tracks: Vec =