summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authormorpheus65535 <[email protected]>2021-07-02 10:38:18 -0400
committermorpheus65535 <[email protected]>2021-07-02 10:38:18 -0400
commit86fb10e3affc478fe8e4dceca378ac7aa6bda3c5 (patch)
tree2e818ab5141734a8bef136fae616659b7fd79473
parentae475f283e0cff87a057727345aef44c48ccf19f (diff)
downloadbazarr-86fb10e3affc478fe8e4dceca378ac7aa6bda3c5.tar.gz
bazarr-86fb10e3affc478fe8e4dceca378ac7aa6bda3c5.zip
Fixed Wizdom provider by adding some failsafe to imdb_id logic. #1456v0.9.6-beta.38
-rw-r--r--libs/subliminal_patch/providers/wizdom.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/libs/subliminal_patch/providers/wizdom.py b/libs/subliminal_patch/providers/wizdom.py
index 147cccb16..a68102203 100644
--- a/libs/subliminal_patch/providers/wizdom.py
+++ b/libs/subliminal_patch/providers/wizdom.py
@@ -120,7 +120,11 @@ class WizdomProvider(Provider):
r = self.session.get('http://api.tmdb.org/3/{}/{}{}?api_key={}&language=en'.format(
category, tmdb_id, '' if is_movie else '/external_ids', self._tmdb_api_key))
r.raise_for_status()
- return str(r.json().get('imdb_id', '')) or None
+ imdb_id = r.json().get('imdb_id')
+ if imdb_id:
+ return str(imdb_id)
+ else:
+ return None
return None
def query(self, title, season=None, episode=None, year=None, filename=None, imdb_id=None):
@@ -185,6 +189,7 @@ class WizdomProvider(Provider):
imdb_id = video.series_imdb_id
else:
titles = [video.title] + video.alternative_titles
+ imdb_id = video.imdb_id
for title in titles:
subtitles = [s for s in