soulsync/tests/metadata
Broque Thomas 8a4c0dc92a Deezer cover-art download: fallback to original URL on CDN refusal
Defensive followup. If Deezer CDN ever refuses the upgraded
1900×1900 URL for a specific album (rare — empirically tested 4
albums and none hit it), pre-fix would have succeeded with the
1000×1000 URL and post-fix would have failed entirely.

Both download sites now retry with the original URL when the
upgraded URL fails:

- `core/metadata/artwork.py::download_cover_art` — auto post-process
  flow. Resolves the original URL from album_info / context the same
  way the existing path does.
- `core/tag_writer.py::download_cover_art` — captures the original
  URL before upgrade so the retry has it without a second context
  lookup.

Strictly non-regressive: worst plausible post-fix case is now
identical to pre-fix (cover at 1000×1000 succeeds). Fallback only
fires on the rare CDN-refusal edge.

Tests added (2):

- `test_tag_writer_retries_with_original_on_failure` — upgraded URL
  raises, original succeeds, both attempts logged in call order
- `test_tag_writer_no_fallback_for_non_dzcdn_url` — non-Deezer URLs
  go through unchanged, no fallback path triggered (single attempt)

Verification:
- 18/18 helper + integration tests pass
- 2561 full suite passes
- Ruff clean
2026-05-10 18:29:36 -07:00
..
test_album_mbid_cache.py Fix album MBID inconsistency: detector + persistent release-MBID cache 2026-05-03 17:16:39 -07:00
test_artist_source_detail.py Move metadata helpers into package modules 2026-04-29 11:28:42 +03:00
test_artist_source_lookup.py Group metadata tests under tests/metadata 2026-04-27 19:54:44 +03:00
test_build_album_info_typed_path.py Migrate album-info builders to typed Album path 2026-05-03 22:53:12 -07:00
test_deezer_cover_url_upgrade.py Deezer cover-art download: fallback to original URL on CDN refusal 2026-05-10 18:29:36 -07:00
test_deezer_search_query.py Deezer search: free-text fallback when advanced query returns 0 2026-05-10 09:16:13 -07:00
test_discography_typed_path.py Migrate discography + quality scanner to typed Album path 2026-05-04 08:12:40 -07:00
test_enrichment_events.py Drop old per-service enrichment routes after registry cutover 2026-05-01 20:43:18 -07:00
test_image_url_normalization.py Move image URL normalization into metadata helpers 2026-05-02 22:02:36 +03:00
test_metadata_album_tracks.py Move metadata helpers into package modules 2026-04-29 11:28:42 +03:00
test_metadata_artist_image.py Move metadata helpers into package modules 2026-04-29 11:28:42 +03:00
test_metadata_cache.py Move profile Spotify cache into registry 2026-04-29 12:36:37 +03:00
test_metadata_cache_batch_lookup.py Move metadata API into package 2026-04-29 08:10:18 +03:00
test_metadata_discography.py Move metadata helpers into package modules 2026-04-29 11:28:42 +03:00
test_metadata_enrichment.py Fix album MBID inconsistency: detector + persistent release-MBID cache 2026-05-03 17:16:39 -07:00
test_metadata_gap_filler.py Fix: maintenance findings badge inflated when scan dedup-skipped 2026-05-04 08:55:13 -07:00
test_metadata_musicmap.py Move metadata helpers into package modules 2026-04-29 11:28:42 +03:00
test_metadata_registry.py Simplify service status and labels 2026-05-01 12:06:58 +03:00
test_musicbrainz_search.py Group metadata tests under tests/metadata 2026-04-27 19:54:44 +03:00
test_relevance.py Fix Deezer search relevance — issue #534 2026-05-10 08:53:42 -07:00
test_runtime_bundle.py fix post-download tagging, and enable tagging for hifi 2026-05-02 07:50:12 -06:00
test_typed_metadata_types.py Add Qobuz + Tidal album converters 2026-05-03 22:30:19 -07:00