Move code to new _queue_from_cover_art_relation()

Consistency.
This commit is contained in:
Laurent Monin
2014-05-08 08:02:06 +02:00
parent 2b94c71348
commit 90faeb9fd4

View File

@@ -300,9 +300,7 @@ class CoverArt:
if use_whitelist \
and (relation.type == 'cover art link' or
relation.type == 'has_cover_art_at'):
log.debug("Found cover art link in whitelist")
url = relation.target[0].text
self._queue_put(CoverArtImage(url))
self._queue_from_cover_art_relation(relation)
elif use_amazon \
and (relation.type == 'amazon asin' or
relation.type == 'has_Amazon_ASIN'):
@@ -310,6 +308,12 @@ class CoverArt:
except AttributeError:
self.album.error_append(traceback.format_exc())
def _queue_from_cover_art_relation(self, relation):
"""Queue from cover art relationships"""
log.debug("Found cover art link in whitelist")
url = relation.target[0].text
self._queue_put(CoverArtImage(url))
def _queue_from_asin_relation(self, relation):
"""Queue cover art images from Amazon"""
amz = parse_amazon_url(relation.target[0].text)