ony lookup imdb if title and director exist

This commit is contained in:
j 2018-05-15 10:38:25 +02:00
parent 66e03ef508
commit 55b9e8bd8f

View file

@ -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