Root cause (the real one): the auto-add passes original_tracks_map[id] — tracks_json run through a specific normalization (album->dict with images/album_type/total_tracks/ release_date, artists->dicts). My re-add hand-rolled a different shape, so the stored spotify_data didn't match and the wishlist's nebula (which reads spotify_data.album. images[0].url) had no cover, plus album/single classification could differ. Fix: extract that normalization into one shared build_original_tracks_map() and use it in BOTH the live sync (core.discovery.sync) and the re-add. The re-add now resolves the track by source_track_id through the same map — byte-identical payload. Verified on a real sync row: re-add payload == live-sync payload, album.images present. (The shared normalizer is also copy-safe, fixing a latent tracks_json mutation in the old inline version.) Fallback (track absent from tracks_json) rebuilds through the same normalizer with the cover seeded from the row's image_url. 10 tests incl. a direct parity assertion. |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| beatport.py | ||
| deezer.py | ||
| endpoints.py | ||
| hero.py | ||
| listenbrainz.py | ||
| listening_recommendations.py | ||
| manual_match.py | ||
| matching.py | ||
| playlist.py | ||
| qobuz.py | ||
| quality_scanner.py | ||
| scoring.py | ||
| spotify_public.py | ||
| sync.py | ||
| tidal.py | ||
| youtube.py | ||