From afa392f030a974126634fbfa002e154d184511ab Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Wed, 2 Nov 2011 23:07:33 +0100 Subject: [PATCH 1/2] remove local poster --- oxdata/poster/admin.py | 4 ---- oxdata/poster/models.py | 10 ---------- 2 files changed, 14 deletions(-) diff --git a/oxdata/poster/admin.py b/oxdata/poster/admin.py index 718c626..c25893a 100644 --- a/oxdata/poster/admin.py +++ b/oxdata/poster/admin.py @@ -4,7 +4,3 @@ import models from django.contrib import admin -class PosterAdmin(admin.ModelAdmin): - search_fields = ['url', 'movie_id__title', 'movie_id__imdb_id'] -admin.site.register(models.Poster, PosterAdmin) - diff --git a/oxdata/poster/models.py b/oxdata/poster/models.py index 75550b9..5439c14 100644 --- a/oxdata/poster/models.py +++ b/oxdata/poster/models.py @@ -40,9 +40,6 @@ def getPosters(movie_id, url_prefix='', limit=lambda x, y: 0.3 < x/y < 1): for p in posters.keys(): if not posters[p]: del posters[p] - poster = Poster.objects.filter(movie_id=movie_id).exclude(poster='') - if poster.count() > 0: - posters['local'] = [p.poster.url] return posters def poster_path(url, filename): @@ -101,13 +98,6 @@ class PosterCache(models.Model): self.save() return self.image -class Poster(models.Model): - created = models.DateTimeField(auto_now_add=True) - modified = models.DateTimeField(auto_now=True) - - movie_id = models.ForeignKey(MovieId, related_name='poster') - poster = models.ImageField(max_length=255, upload_to=lambda i, f: poster_path('upload/%s' % i.id, f)) - def getPosterUrls(m): def addPoster(url, site, site_id): if PosterCache.objects.all().filter(url=url, movie_id=m).count() == 0: From 6ffc4e58d8d72613ec6bdce892c221ac54d5a367 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Thu, 3 Nov 2011 11:22:11 +0100 Subject: [PATCH 2/2] ignore posters known to have imdb id --- oxdata/lookup/cache.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/oxdata/lookup/cache.py b/oxdata/lookup/cache.py index 6f053ba..61252b7 100644 --- a/oxdata/lookup/cache.py +++ b/oxdata/lookup/cache.py @@ -20,6 +20,16 @@ def addPoster(m, url, site, site_id): def getIds(): for id in ox.web.impawards.getIds(): + if id in ( + '2005/night', + '2007/hands_of_the_dragon', + '2008/nosferatu_project', + '2009/murph', + '1962/well_bury_you', + '1974/matter_of_winning', + '2006/last_time_i_trust_you_with_anything', + ): + continue if models.MovieId.objects.all().filter(impawards_id=id).count() == 0: print 'impawards', ox.web.impawards.getUrl(id) data = ox.web.impawards.getData(id)