Skip to content

Commit f1c4142

Browse files
committed
changelog/thanks/tweaks for #355
- Remove requests import - Name change - Remove some obsolete checks
1 parent 7c607eb commit f1c4142

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

beetsplug/fetchart.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import logging
2020
import os
2121
import tempfile
22-
import requests
2322

2423
from beets.plugins import BeetsPlugin
2524
from beets.util.artresizer import ArtResizer
@@ -73,12 +72,13 @@ def caa_art(release_id):
7372
"""
7473
return CAA_URL.format(mbid=release_id)
7574

76-
def caa_group(release_group_id):
75+
def caa_group_art(release_group_id):
7776
"""Return the Cover Art Archive release group URL given a MusicBrainz
7877
release group ID.
7978
"""
8079
return CAA_GROUP_URL.format(mbid=release_group_id)
8180

81+
8282
# Art from Amazon.
8383

8484
AMAZON_URL = 'http://images.amazon.com/images/P/%s.%02i.LZZZZZZZ.jpg'
@@ -155,15 +155,11 @@ def _source_urls(album):
155155
through this sequence early to avoid the cost of scraping when not
156156
necessary.
157157
"""
158+
# Cover Art Archive.
158159
if album.mb_albumid:
159-
url = caa_art(album.mb_albumid)
160-
if url:
161-
yield url
162-
160+
yield caa_art(album.mb_albumid)
163161
if album.mb_releasegroupid:
164-
url = caa_group(album.mb_releasegroupid)
165-
if url:
166-
yield url
162+
yield caa_group_art(album.mb_releasegroupid)
167163

168164
# Amazon and AlbumArt.org.
169165
if album.asin:

docs/changelog.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ Changelog
1111
* :doc:`/plugins/bpd`: Fix for a crash when searching, thanks to Simon Chopin.
1212
* Regular expression queries (and other query types) over paths now work.
1313
(Previously, special query types were ignored for the ``path`` field.)
14+
* :doc:`/plugins/fetchart`: Look for images in the Cover Art Archive for
15+
the release group in addition to the specific release. Thanks to Filipe
16+
Fortes.
1417

1518

1619
1.2.1 (June 22, 2013)

0 commit comments

Comments
 (0)