From 87f17a1318bd317b72a1ea0245e99fe5ec7990bb Mon Sep 17 00:00:00 2001 From: Broque Thomas <26755000+Nezreka@users.noreply.github.com> Date: Tue, 31 Mar 2026 21:40:19 -0700 Subject: [PATCH] Fix cover.jpg not using Cover Art Archive high-res source MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The MusicBrainz release ID found by _embed_source_ids was stored in the metadata dict but never propagated to album_info. The old code tried to write album_info['musicbrainz_release_id'] inside _embed_source_ids, but album_info wasn't in that function's scope — causing a silent NameError. Fix: copy the MBID from metadata to album_info in _enhance_file_metadata (where both are in scope) right after _embed_source_ids returns. This makes _download_cover_art see the MBID and use Cover Art Archive for cover.jpg instead of falling back to the smaller Spotify/iTunes thumbnail. --- web_server.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/web_server.py b/web_server.py index ed9eab97..240bcf9e 100644 --- a/web_server.py +++ b/web_server.py @@ -16014,6 +16014,11 @@ def _enhance_file_metadata(file_path: str, context: dict, artist: dict, album_in # Cover Art Archive high-resolution lookup. _embed_source_ids(audio_file, metadata) + # Propagate MusicBrainz release ID to album_info so _download_cover_art + # can use it for Cover Art Archive high-res cover.jpg + if album_info is not None and metadata.get('musicbrainz_release_id'): + album_info['musicbrainz_release_id'] = metadata['musicbrainz_release_id'] + # ── Embed album art on the same object ── if config_manager.get('metadata_enhancement.embed_album_art', True): _embed_album_art_metadata(audio_file, metadata) @@ -16486,9 +16491,6 @@ def _embed_source_ids(audio_file, metadata: dict): # Store release MBID in metadata for downstream use (e.g. Cover Art Archive) if _rc_mbid: metadata['musicbrainz_release_id'] = _rc_mbid - # Also store on album_info so _download_cover_art can use it for cover.jpg - if album_info is not None: - album_info['musicbrainz_release_id'] = _rc_mbid # Write release year to file tags if not already present if release_year and 'ORIGINALDATE' not in id_tags: