diff --git a/core/tmdb.py b/core/tmdb.py index a322481e..bbe7cf1b 100644 --- a/core/tmdb.py +++ b/core/tmdb.py @@ -129,7 +129,7 @@ def cache_response(fn): result = fn(*args) else: - url = re.sub('&year=-', '', args[0]) + url = args[0].replace('&year=-', '') # if PY3: url = str.encode(url) row = db['tmdb_cache'].get(url) @@ -138,7 +138,7 @@ def cache_response(fn): result = row[0] # si no se ha obtenido información, llamamos a la funcion - if not result: + if not result.get('results'): result = fn(*args) db['tmdb_cache'][url] = [result, datetime.datetime.now()]