fetchart: Better logging for iTunes (#1760)

This commit is contained in:
Adrian Sampson 2015-12-12 16:44:55 -08:00
parent 37250ef27b
commit 3314db2f77

View file

@ -196,11 +196,19 @@ class ITunesStore(ArtSource):
try:
# Isolate bugs in the iTunes library while searching.
try:
itunes_album = itunes.search_album(search_string)[0]
results = itunes.search_album(search_string)
except Exception as exc:
self._log.debug('iTunes search failed: {0}', exc)
return
# Get the first match.
if results:
itunes_album = results[0]
else:
self._log.debug('iTunes search for {:r} got no results',
search_string)
return
if itunes_album.get_artwork()['100']:
small_url = itunes_album.get_artwork()['100']
big_url = small_url.replace('100x100', '1200x1200')