From 55b9e8bd8f5eb7e3cd3608a7636d2d41105fbf07 Mon Sep 17 00:00:00 2001 From: j Date: Tue, 15 May 2018 10:38:25 +0200 Subject: [PATCH] ony lookup imdb if title and director exist --- ox/web/criterion.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ox/web/criterion.py b/ox/web/criterion.py index 09cf212..4f41279 100644 --- a/ox/web/criterion.py +++ b/ox/web/criterion.py @@ -89,7 +89,7 @@ def get_data(id, timeout=ox.cache.cache_timeout, get_imdb=False): if timeout == ox.cache.cache_timeout: timeout = -1 - if get_imdb: + if get_imdb and 'title' in data and 'director' in data: # removed year, as "title (year)" may fail to match data['imdbId'] = imdb.get_movie_id(data['title'], data['director'], timeout=timeout) return data