From c94df8787f13936094eee3ec17b30a3c7d0f0162 Mon Sep 17 00:00:00 2001 From: vicrodh <103399283+vicrodh@users.noreply.github.com> Date: Fri, 6 Feb 2026 05:17:02 -0600 Subject: [PATCH] fix: add user auth token to get_album and get_track API calls These endpoints were missing the X-User-Auth-Token header, causing Qobuz to return 404 for all album and track detail requests. This is the root cause of issue #43: blank album pages, "Unknown Artist" and "0:00" in Recently Played / Continue Listening. List endpoints (get_featured_albums) and playlist endpoints worked because they either don't need auth or already included the token. Closes #43 --- src-tauri/src/api/client.rs | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/src-tauri/src/api/client.rs b/src-tauri/src/api/client.rs index 08b5bc4c7..c71b879c0 100644 --- a/src-tauri/src/api/client.rs +++ b/src-tauri/src/api/client.rs @@ -378,13 +378,17 @@ impl QobuzClient { let url = endpoints::build_url(paths::ALBUM_GET); log::info!("[DEBUG-43] API get_album request: album_id={}", album_id); - let http_response = self + let mut request = self .http .get(&url) .header("X-App-Id", self.app_id().await?) - .query(&[("album_id", album_id)]) - .send() - .await?; + .query(&[("album_id", album_id)]); + + if let Ok(token) = self.auth_token().await { + request = request.header("X-User-Auth-Token", token); + } + + let http_response = request.send().await?; let status = http_response.status(); log::info!("[DEBUG-43] API get_album response status: {}", status); @@ -574,13 +578,17 @@ impl QobuzClient { let url = endpoints::build_url(paths::TRACK_GET); log::info!("[DEBUG-43] API get_track request: track_id={}", track_id); - let http_response = self + let mut request = self .http .get(&url) .header("X-App-Id", self.app_id().await?) - .query(&[("track_id", track_id.to_string())]) - .send() - .await?; + .query(&[("track_id", track_id.to_string())]); + + if let Ok(token) = self.auth_token().await { + request = request.header("X-User-Auth-Token", token); + } + + let http_response = request.send().await?; let status = http_response.status(); log::info!("[DEBUG-43] API get_track response status: {}", status);