Skip to content

fetchart: Use Cover Art Archive thumbnails - #3637

Merged
sampsyo merged 1 commit into
beetbox:masterfrom
mtrolley:topic/coverart-thumb
Jun 27, 2020
Merged

fetchart: Use Cover Art Archive thumbnails#3637
sampsyo merged 1 commit into
beetbox:masterfrom
mtrolley:topic/coverart-thumb

Conversation

@mtrolley

Copy link
Copy Markdown
Contributor

The Cover Art Archive API offers pre-resized thumbnails of cover
art. If the maxwidth option of fetchart matches one of the
supported Cover Art Archive thumbnail sizes fetch it directly
instead of fetching the full size image then resizing it.

@mtrolley

Copy link
Copy Markdown
Contributor Author

Cover Art Archive API reference: https://musicbrainz.org/doc/Cover_Art_Archive/API#.2Frelease.2F.7Bmbid.7D.2F.28.7Bid.7D.7Cfront.7Cback.29-.28250.7C500.7C1200.29

Tested manually by setting the fetchart maxwidth option to:

  • each of the supported values from Cover Art Archive (250, 500, 1200) and verify the fetched image is identical to the Cover Art Archive image
  • a value that did not match one of those values and verified the final cover art file was resized to the proper size
  • no value and verified that the full size art was retrieved

@sampsyo sampsyo 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.

Awesome; seems great! Could you please add a quick entry to the changelog describing what has changed?

Comment thread beetsplug/fetchart.py Outdated
Comment thread beetsplug/fetchart.py Outdated
@mtrolley
mtrolley requested a review from sampsyo June 27, 2020 16:23

@sampsyo sampsyo 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.

Just one thought to avoid some unpredictable mutation.

Comment thread beetsplug/fetchart.py Outdated
The Cover Art Archive API offers pre-resized thumbnails of cover
art. If the `maxwidth` option of `fetchart` matches one of the
supported Cover Art Archive thumbnail sizes fetch it directly
instead of fetching the full size image then resizing it.
@mtrolley
mtrolley requested a review from sampsyo June 27, 2020 16:35
sampsyo added a commit that referenced this pull request Jun 27, 2020
@sampsyo
sampsyo merged commit 0cd5293 into beetbox:master Jun 27, 2020
@sampsyo

sampsyo commented Jun 27, 2020

Copy link
Copy Markdown
Member

Looks excellent; thanks again!

@mtrolley
mtrolley deleted the topic/coverart-thumb branch June 27, 2020 17:15
@mtrolley

Copy link
Copy Markdown
Contributor Author

@sampsyo - Unfortunately I discovered a problem with this after it was merged, which I logged here: #3638

I'll work on getting it fixed ASAP. Let me know if you'd rather I revert this change until then.

sampsyo added a commit that referenced this pull request Jun 29, 2020
@snejus snejus added fetchart fetchart plugin thumbnails thumbnails plugin labels Apr 5, 2026
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants