merge
This commit is contained in:
commit
304625025d
2 changed files with 16 additions and 2 deletions
|
@ -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()
|
||||
|
||||
|
||||
|
|
|
@ -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?
|
||||
|
||||
|
|
Loading…
Reference in a new issue