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
This commit is contained in:
1 parent
25dda16191
commit
c94df8787f
1 file changed
+16
-8
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user