fix: correct top_tracks field name and remove unused extra param

Qobuz API uses snake_case so the field is top_tracks, not topTracks.
Also remove the extra=topTracks query param — top tracks are included
in the default artist/page response without it.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
joren
2026-03-25 13:58:51 +01:00
parent 5ae18afa08
commit e37de6d897
2 changed files with 3 additions and 6 deletions

View File

@@ -258,10 +258,7 @@ impl QobuzClient {
pub async fn get_artist_page(&self, artist_id: i64) -> Result<Value> { pub async fn get_artist_page(&self, artist_id: i64) -> Result<Value> {
let resp = self let resp = self
.get_request("artist/page") .get_request("artist/page")
.query(&[ .query(&[("artist_id", artist_id.to_string())])
("artist_id", artist_id.to_string()),
("extra", "topTracks".to_string()),
])
.send() .send()
.await?; .await?;
Self::check_response(resp).await Self::check_response(resp).await

View File

@@ -190,8 +190,8 @@ void ArtistView::setArtist(const QJsonObject &artist)
m_bioLabel->setVisible(false); m_bioLabel->setVisible(false);
} }
// Top tracks: artist/page?extra=topTracks returns {"topTracks": {"items": [...]}} // Top tracks are in the default artist/page response under "top_tracks"
const QJsonArray topTracks = artist["topTracks"].toObject()["items"].toArray(); const QJsonArray topTracks = artist["top_tracks"].toObject()["items"].toArray();
m_topTracks->loadTracks(topTracks); m_topTracks->loadTracks(topTracks);
m_topTracksSection->setVisible(!topTracks.isEmpty()); m_topTracksSection->setVisible(!topTracks.isEmpty());