diff --git a/lookup/cache.py b/lookup/cache.py index 14e5e22..35577f8 100644 --- a/lookup/cache.py +++ b/lookup/cache.py @@ -42,6 +42,8 @@ def getIds(): m.criterion_id = id m.save() addPoster(m, poster, 'criterion.com', m.criterion_id) + else: + print data['title'], "no imdbId" #kg lastId = models.Karagarga.maxId() @@ -50,13 +52,11 @@ def getIds(): print 'kg', id data = oxweb.karagarga.getData(id) if data and 'imdbId' in data: - if 'imdbId' in data: - m = models.getMovieIdByImdbId(data['imdbId']) - kg = models.Karagarga() - kg.movie_id = m - kg.karagarga_id = id - kg.save() - #fixme, what to do else? + m = models.getMovieIdByImdbId(data['imdbId']) + kg = models.Karagarga() + kg.movie_id = m + kg.karagarga_id = id + kg.save() for poster in data['posters']: addPoster(m, poster, 'karagarga.net', kg.karagarga_id) diff --git a/lookup/management/commands/cache_ids.py b/lookup/management/commands/cache_ids.py index de45a22..05f3957 100644 --- a/lookup/management/commands/cache_ids.py +++ b/lookup/management/commands/cache_ids.py @@ -4,6 +4,7 @@ from django.core.management.base import BaseCommand, CommandError from django.conf import settings +import lookup.cache class Command(BaseCommand): """