From 6796059e1bbca91884e1db3c91d06adaa84e49f8 Mon Sep 17 00:00:00 2001 From: JackDandy Date: Fri, 6 Oct 2017 22:36:04 +0100 Subject: [PATCH] Change improve handling of connection failures for metadata during media processing. --- CHANGES.md | 7 ++++++- sickbeard/metadata/xbmc_12plus.py | 3 +++ sickbeard/tv.py | 10 ++++++++-- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index c71e4b21..2a826064 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,4 +1,9 @@ -### 0.12.30 (2017-09-29 00:20:00 UTC) +### 0.12.31 (2017-10-06 22:30:00 UTC) + +* Change improve handling of connection failures for metadata during media processing + + +### 0.12.30 (2017-09-29 00:20:00 UTC) * Fix Media Providers/Custom Newznab tab action 'Delete' then 'Save Changes' * Fix enforce value API expects for paused show flag diff --git a/sickbeard/metadata/xbmc_12plus.py b/sickbeard/metadata/xbmc_12plus.py index 8081dfba..ddd74897 100644 --- a/sickbeard/metadata/xbmc_12plus.py +++ b/sickbeard/metadata/xbmc_12plus.py @@ -256,6 +256,9 @@ class XBMC_12PlusMetadata(generic.GenericMetadata): curEpToWrite.episode) + " on " + sickbeard.indexerApi( ep_obj.show.indexer).name + ".. has it been removed? Should I delete from db?") return None + except (StandardError, Exception): + logger.log(u"Not generating nfo because failed to fetched tv info data at this time", logger.DEBUG) + return None if getattr(myEp, 'firstaired', None) is None: myEp["firstaired"] = str(datetime.date.fromordinal(1)) diff --git a/sickbeard/tv.py b/sickbeard/tv.py index 5715a7f3..47c18a4d 100644 --- a/sickbeard/tv.py +++ b/sickbeard/tv.py @@ -36,6 +36,8 @@ from name_parser.parser import NameParser, InvalidNameException, InvalidShowExce from lib import subliminal import fnmatch +from imdb._exceptions import IMDbError + try: from lib.send2trash import send2trash except ImportError: @@ -986,8 +988,12 @@ class TVShow(object): 'votes': '', 'last_update': ''} - i = imdb.IMDb() - imdbTv = i.get_movie(str(re.sub('[^0-9]', '', self.imdbid or '%07d' % self.ids[indexermapper.INDEXER_IMDB]['id']))) + try: + i = imdb.IMDb() + imdbTv = i.get_movie( + str(re.sub('[^0-9]', '', self.imdbid or '%07d' % self.ids[indexermapper.INDEXER_IMDB]['id']))) + except IMDbError: + return for key in filter(lambda x: x.replace('_', ' ') in imdbTv.keys(), imdb_info.keys()): # Store only the first value for string type