Skip to content

fetchart: Fix downloading pre-sized thumbnails from CAA - #6870

Merged
snejus merged 2 commits into
beetbox:masterfrom
tibequadorian:master
Sep 1, 2026
Merged

fetchart: Fix downloading pre-sized thumbnails from CAA#6870
snejus merged 2 commits into
beetbox:masterfrom
tibequadorian:master

Conversation

@tibequadorian

Copy link
Copy Markdown

Description

Fixes issue in which thumbnails were rescaled locally instead of downloading pre-sized ones from CAA.

From the docs:

The CAA provides pre-sized thumbnails of width 250, 500, and 1200 pixels. If you set the maxwidth option to one of these values, the corresponding image will be downloaded, saving beets the need to scale down the image. It can also speed up the downloading process, as some cover arts can sometimes be very large.

I noticed that the fetchart plugin didn't download the pre-sized thumbnails from CAA for some of my releases because the API didn't provide them under the keys "500" and "250" but instead "large" and "small". These are legacy keys but for some releases they're the only ones available so I wrote this fix to use them as a fallback.

Example

curl -sL "https://coverartarchive.org/release/d51434bc-fcb6-4fc0-864f-e1ab13a51de2" | jq
{
  "images": [
    {
      "types": [
        "Front"
      ],
      "front": true,
      "back": false,
      "edit": 30140717,
      "image": "http://coverartarchive.org/release/d51434bc-fcb6-4fc0-864f-e1ab13a51de2/8891190287.png",
      "comment": "",
      "approved": true,
      "id": "8891190287",
      "thumbnails": {
        "large": "http://coverartarchive.org/release/d51434bc-fcb6-4fc0-864f-e1ab13a51de2/8891190287-500.jpg",
        "small": "http://coverartarchive.org/release/d51434bc-fcb6-4fc0-864f-e1ab13a51de2/8891190287-250.jpg"
      }
    }
  ],
  "release": "http://musicbrainz.org/release/d51434bc-fcb6-4fc0-864f-e1ab13a51de2"
}
@tibequadorian
tibequadorian requested a review from a team as a code owner July 23, 2026 01:55
@github-actions github-actions Bot added fetchart fetchart plugin thumbnails thumbnails plugin labels Jul 23, 2026
@github-actions

Copy link
Copy Markdown

Thank you for the PR! The changelog has not been updated, so here is a friendly reminder to check if you need to add an entry.

@codecov

codecov Bot commented Jul 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.84%. Comparing base (39ff8cc) to head (388689d).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #6870   +/-   ##
=======================================
  Coverage   76.84%   76.84%           
=======================================
  Files         163      163           
  Lines       21626    21627    +1     
  Branches     3343     3343           
=======================================
+ Hits        16619    16620    +1     
  Misses       4191     4191           
  Partials      816      816           
Files with missing lines Coverage Δ
beetsplug/fetchart.py 74.01% <100.00%> (+0.03%) ⬆️
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@snejus snejus left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you mind adding a test for this, where you show that both 200/500 and small/large keys work?

@snejus

snejus commented Sep 1, 2026

Copy link
Copy Markdown
Member

@tibequadorian are you planning to come back to this one?

@snejus
snejus enabled auto-merge September 1, 2026 08:30
@snejus
snejus merged commit 123ce82 into beetbox:master Sep 1, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fetchart fetchart plugin thumbnails thumbnails plugin

2 participants