Skip to content

fix(qobuz): adapt to album/get and playlist/get no longer returning inline tracks#1013

Open
izzoa wants to merge 1 commit into
nathom:devfrom
izzoa:fix/qobuz-track-ids
Open

fix(qobuz): adapt to album/get and playlist/get no longer returning inline tracks#1013
izzoa wants to merge 1 commit into
nathom:devfrom
izzoa:fix/qobuz-track-ids

Conversation

@izzoa

@izzoa izzoa commented Jul 18, 2026

Copy link
Copy Markdown

Fixes #1012.

Problem

On ~2026-07-18 Qobuz removed inline track listings from its metadata API: album/get no longer returns a tracks object at all (and rejects extra=tracks with HTTP 400), and playlist/get?extra=tracks returns an always-empty tracks.items. As a result every Qobuz album download crashes with KeyError: 'tracks' and every playlist download silently resolves 0 tracks. The replacement contract, confirmed against the current web player (bundle 8.2.0-b034), is extra=track_ids, which returns the plain id list.

Changes

  • client/qobuz.py: request extra=track_ids for albums, and extra=tracks,track_ids for playlists (both values, so either the old or new server behavior works).
  • metadata/util.py: get_album_track_ids() reads resp["track_ids"] when the legacy tracks object is absent.
  • metadata/playlist.py: PlaylistMetadata.from_qobuz() tolerates a missing/empty tracks object and falls back to the track_ids list — the same list[str] shape the Deezer path already uses; ids are hydrated per-track by PendingPlaylistTrack.resolve() exactly as before.

No new requests are introduced: albums and playlists already fetched each track individually via track/get (which is unchanged); these endpoints only ever needed the id lists.

Compatibility

  • Legacy response shapes still take priority when present, so nothing changes if Qobuz reverts or rolls out regionally.
  • No behavior change for other sources; no new dependencies.
  • Untested edge: playlists longer than the old limit=500 paging window — track_ids returned complete lists for everything tested (up to 100 tracks), but very large playlists are worth a look.

Testing (live API, Qobuz Studio subscription, US store)

  • A/B repro: pristine dev crashes KeyError: 'tracks' on any album; with this patch the same call returns the full id list.
  • Real download: a 10-track hi-res album (24/192) downloaded 10/10 tracks with correct tags.
  • Playlist: a 66-track editorial playlist resolves 66 pending tracks (0 before the patch).
  • Spot-checked artist (extra=albums, 353 albums returned) and single-track flows: unaffected.

Happy to add fixture tests for the new response shape if wanted.

🤖 Generated with Claude Code

…nline tracks

Qobuz removed inline track listings from its metadata API (~2026-07-18):
album/get no longer returns a "tracks" object (extra=tracks now 400s) and
playlist/get returns an always-empty tracks.items. Request the replacement
extra=track_ids and fall back to the id list when the legacy shape is
absent; ids are hydrated per-track via the existing track/get paths.

Fixes nathom#1012

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Qobuz: every album download crashes with KeyError 'tracks'; playlists silently download 0 tracks (server-side API change, ~2026-07-18)

1 participant