From 620b9daa82b8d81158fbc6fa5a98235f6b852c91 Mon Sep 17 00:00:00 2001 From: Prinz23 Date: Fri, 19 Apr 2019 02:02:47 +0100 Subject: [PATCH] Change improve IMDb id parsing from source indexer for indexermapper. Fix comparison operator. --- CHANGES.md | 3 ++- sickbeard/indexermapper.py | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 88a4f38..4c7d918 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,7 @@ -### 0.18.19 (2019-03-31 12:00:00 UTC) +### 0.18.19 (2019-04-19 02:00:00 UTC) * Fix season search at provider ETTV +* Change improve IMDb id parsing ### 0.18.18 (2019-03-25 16:45:00 UTC) diff --git a/sickbeard/indexermapper.py b/sickbeard/indexermapper.py index 320b1f6..d66bfc8 100644 --- a/sickbeard/indexermapper.py +++ b/sickbeard/indexermapper.py @@ -276,7 +276,10 @@ def map_indexers_to_show(show_obj, update=False, force=False, recheck=False): new_ids = NewIdDict() if isinstance(show_obj.imdbid, basestring) and re.search(r'\d+$', show_obj.imdbid): - new_ids[INDEXER_IMDB] = tryInt(re.search(r'(?:tt)?(\d+)', show_obj.imdbid)) + try: + new_ids[INDEXER_IMDB] = tryInt(re.search(r'(?:tt)?(\d+)', show_obj.imdbid).group(1)) + except (StandardError, Exception): + pass if 0 < len(url_tvmaze): new_ids.update(get_tvmaze_ids(url_tvmaze)) @@ -300,7 +303,7 @@ def map_indexers_to_show(show_obj, update=False, force=False, recheck=False): if INDEXER_TVMAZE not in new_ids: f_date = get_premieredate(show_obj) - if f_date and f_date is not datetime.date.fromordinal(1): + if f_date and f_date != datetime.date.fromordinal(1): tvids = {k: v for k, v in get_tvmaze_by_name(show_obj.name, f_date).iteritems() if k == INDEXER_TVMAZE or k not in new_ids or new_ids.get(k) in (None, 0, '', MapStatus.NOT_FOUND)} new_ids.update(tvids)