Spotify: correctly propagate TOTALTRACKS and TOTALDISCS metadata #15

Merged
maleszka merged 7 commits from fix/totaltracks into main 2026-07-06 15:48:32 +02:00
Owner

closes #2

closes #2
track.album is only the per-track metadata stub and never populates discs,
so map_track now takes the caller's resolved Album instead of reading the
stub. Call sites still pass the stub for now; each will be fixed to pass a
real Album in the following commits.
resolve_track_list's album branch already fetches the full Album to build
track_uris and previously dropped it; now it's kept and passed into
map_track for every track in the album, fixing TOTALTRACKS/TOTALDISCS for
the common full-album download case with no extra network round-trip.
resolve_track, resolve_track_list's playlist branch, and search all lacked a
pre-fetched Album to reuse (playlists and search results can span different
albums), so each still passed the always-empty stub. Add a per-batch
Album cache (resolve_album_cached/AlbumCache) shared by the playlist branch
and search to avoid an Album::get round-trip per track when consecutive
results share an album, and fetch the track's own Album directly for the
single-track path. Also adds an ignored real-session integration test that
downloads a known multi-disc track and checks the written OGG's
TOTALDISCS/TOTALTRACKS.
maleszka deleted branch fix/totaltracks 2026-07-06 15:48:32 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
maleszka/librespot-dl!15
No description provided.