diable apple enable piratecinema

This commit is contained in:
j 2011-10-14 21:10:37 +02:00
parent 896af63b5f
commit d8c7f34f7c
2 changed files with 16 additions and 2 deletions

View file

@ -5,6 +5,8 @@ from django.core.management.base import BaseCommand, CommandError
from django.conf import settings
import lookup.cache
import poster.models
from datetime import datetime
class Command(BaseCommand):
"""
@ -14,6 +16,11 @@ class Command(BaseCommand):
args = ''
def handle(self, **options):
import oxdata.lookup.cache
import poster.models
before_import = datetime.now()
lookup.cache.getIds()
for p in poster.models.PosterCache.objects.filter(image='', failed=False, created__gt=before_import):
print p.url
p.get()

View file

@ -16,6 +16,7 @@ import ox.web.movieposterdb
import ox.web.imdb
import ox.web.impawards
import ox.web.apple
import ox.web.piratecinema
from oxdata.lookup.models import MovieId
@ -121,6 +122,11 @@ def getPosterUrls(m):
#site is sometimes down
#for poster in ox.web.movieposterdb.getData(m.imdb_id)['posters']:
# addPoster(poster, 'movieposterdb.com', m.imdb_id)
poster = ox.web.piratecinema.getPosterUrl(m.imdb_id)
if poster:
addPoster(poster, 'piratecinema.org', m.imdb_id)
if m.criterion_id:
#if settings.DEBUG:
# print 'criterion', m.criterion_id
@ -141,10 +147,11 @@ def getPosterUrls(m):
for poster in data['posters']:
addPoster(poster, 'impawards.com', m.imdb_id)
'''
if m.title and m.director:
data = ox.web.apple.getMovieData(m.title, m.director)
if data and 'poster' in data:
addPoster(data['poster'], 'apple.com', m.imdb_id)
'''
#fixme: get 0xdb still, possibly imdb still as fallback?