From ac9e34d0ed55f922549568602205142c7638997d Mon Sep 17 00:00:00 2001 From: tibequadorian Date: Thu, 23 Jul 2026 03:40:22 +0200 Subject: [PATCH] fetchart: Fix downloading pre-sized thumbnails from CAA --- beetsplug/fetchart.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/beetsplug/fetchart.py b/beetsplug/fetchart.py index d9c44c96b2..152bc16c43 100644 --- a/beetsplug/fetchart.py +++ b/beetsplug/fetchart.py @@ -512,6 +512,10 @@ class CoverArtArchive(RemoteArtSource): ID = "coverart" VALID_MATCHING_CRITERIA: ClassVar[list[str]] = ["release", "releasegroup"] VALID_THUMBNAIL_SIZES: ClassVar[list[int]] = [250, 500, 1200] + LEGACY_THUMBNAIL_NAMES: ClassVar[dict[str, str]] = { + "250": "small", + "500": "large", + } URL = "https://coverartarchive.org/release/{mbid}" GROUP_URL = "https://coverartarchive.org/release-group/{mbid}" @@ -555,7 +559,13 @@ def get_image_urls( if preferred_width is not None: if isinstance(item.get("thumbnails"), dict): image_url = item["thumbnails"].get( - preferred_width, image_url + preferred_width, + item["thumbnails"].get( + self.LEGACY_THUMBNAIL_NAMES.get( + preferred_width + ), + image_url, + ), ) yield image_url except KeyError: