From d026e7742bcbc3ed0bfaca68dcc4414cc6b92555 Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Sat, 22 Nov 2014 15:32:20 -0800 Subject: [PATCH] fetchart: Tolerate itunes bugs (fix #1109) --- beetsplug/fetchart.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/beetsplug/fetchart.py b/beetsplug/fetchart.py index 728ab83a2..98e9fda3e 100644 --- a/beetsplug/fetchart.py +++ b/beetsplug/fetchart.py @@ -168,7 +168,13 @@ def itunes_art(album): """ search_string = (album.albumartist + ' ' + album.album).encode('utf-8') try: - itunes_album = itunes.search_album(search_string)[0] + # Isolate bugs in the iTunes library while searching. + try: + itunes_album = itunes.search_album(search_string)[0] + except Exception as exc: + log.debug('fetchart: iTunes search failed: {0}'.format(exc)) + return + if itunes_album.get_artwork()['100']: small_url = itunes_album.get_artwork()['100'] big_url = small_url.replace('100x100', '1200x1200')