Skip to content

Commit

Permalink
fetchart: Better logging for iTunes (#1760)
Browse files Browse the repository at this point in the history
  • Loading branch information
sampsyo committed Dec 13, 2015
1 parent 37250ef commit 3314db2
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion beetsplug/fetchart.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,11 +196,19 @@ def get(self, album):
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')
Expand Down

0 comments on commit 3314db2

Please sign in to comment.