release: self-mapping album captures (test ā main)
Promotes the chat#1794 fix: #664 ā self-mapping album captures (Spotify ISRC resolution for unmapped tracks) + album rows for every captured track, paired with the merged database#34 constraint fix.
Content delta vs main is exactly the #664 squash (older commits listed in the range are squash-promotion artifacts; trees were identical before the fix). Live-verified on preview: K.I.D.S. + REBIRTH both 18/18 in /playcounts, sibling stats store-served, credit accounting exact (results tables on #664).
š¤ Generated with Claude Code
Summary by cubic
Album captures now self-map unmapped Spotify track IDs to ISRCs and write measurements for all resolved tracks, also upserting album_id mappings per captured track. This fixes skipped tracks in playcount captures and heals pre-mapped tracks missing album rows.
- Bug Fixes
- Resolve ISRCs for unmapped tracks via Spotify
GET /v1/tracks(batched at 50); addedgetTracks. - Upsert
songsandsong_identifiers(track_idandalbum_id) with newupsertSongIdentifiers(idempotent; aligned with the per-song uniqueness constraint). writeAlbumPlayCountsnow self-maps before writing and always upserts analbum_idrow for each captured track; degrades gracefully if Spotify auth fails.- Tests added for mapping, write path, and identifier upserts;
SpotifyAlbumPlayCountstype now includes optionalidfor album context.
- Resolve ISRCs for unmapped tracks via Spotify