diff --git a/beetsplug/fetchart.py b/beetsplug/fetchart.py index 4807f2ce2..15986c8d1 100644 --- a/beetsplug/fetchart.py +++ b/beetsplug/fetchart.py @@ -19,7 +19,6 @@ import re import logging import os import tempfile -import requests from beets.plugins import BeetsPlugin from beets.util.artresizer import ArtResizer @@ -73,12 +72,13 @@ def caa_art(release_id): """ return CAA_URL.format(mbid=release_id) -def caa_group(release_group_id): +def caa_group_art(release_group_id): """Return the Cover Art Archive release group URL given a MusicBrainz release group ID. """ return CAA_GROUP_URL.format(mbid=release_group_id) + # Art from Amazon. AMAZON_URL = 'http://images.amazon.com/images/P/%s.%02i.LZZZZZZZ.jpg' @@ -155,15 +155,11 @@ def _source_urls(album): through this sequence early to avoid the cost of scraping when not necessary. """ + # Cover Art Archive. if album.mb_albumid: - url = caa_art(album.mb_albumid) - if url: - yield url - + yield caa_art(album.mb_albumid) if album.mb_releasegroupid: - url = caa_group(album.mb_releasegroupid) - if url: - yield url + yield caa_group_art(album.mb_releasegroupid) # Amazon and AlbumArt.org. if album.asin: diff --git a/docs/changelog.rst b/docs/changelog.rst index d69ea2d35..2fa8eff34 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -11,6 +11,9 @@ Changelog * :doc:`/plugins/bpd`: Fix for a crash when searching, thanks to Simon Chopin. * Regular expression queries (and other query types) over paths now work. (Previously, special query types were ignored for the ``path`` field.) +* :doc:`/plugins/fetchart`: Look for images in the Cover Art Archive for + the release group in addition to the specific release. Thanks to Filipe + Fortes. 1.2.1 (June 22, 2013)