find new ids

This commit is contained in:
j 2009-08-20 19:03:14 +02:00
parent 942a892d46
commit 31666c5e9e
2 changed files with 8 additions and 7 deletions

View file

@ -42,6 +42,8 @@ def getIds():
m.criterion_id = id m.criterion_id = id
m.save() m.save()
addPoster(m, poster, 'criterion.com', m.criterion_id) addPoster(m, poster, 'criterion.com', m.criterion_id)
else:
print data['title'], "no imdbId"
#kg #kg
lastId = models.Karagarga.maxId() lastId = models.Karagarga.maxId()
@ -50,13 +52,11 @@ def getIds():
print 'kg', id print 'kg', id
data = oxweb.karagarga.getData(id) data = oxweb.karagarga.getData(id)
if data and 'imdbId' in data: if data and 'imdbId' in data:
if 'imdbId' in data: m = models.getMovieIdByImdbId(data['imdbId'])
m = models.getMovieIdByImdbId(data['imdbId']) kg = models.Karagarga()
kg = models.Karagarga() kg.movie_id = m
kg.movie_id = m kg.karagarga_id = id
kg.karagarga_id = id kg.save()
kg.save()
#fixme, what to do else?
for poster in data['posters']: for poster in data['posters']:
addPoster(m, poster, 'karagarga.net', kg.karagarga_id) addPoster(m, poster, 'karagarga.net', kg.karagarga_id)

View file

@ -4,6 +4,7 @@
from django.core.management.base import BaseCommand, CommandError from django.core.management.base import BaseCommand, CommandError
from django.conf import settings from django.conf import settings
import lookup.cache
class Command(BaseCommand): class Command(BaseCommand):
""" """