remove local poster

This commit is contained in:
j 2011-11-02 23:07:33 +01:00
parent 2dcbd2ec27
commit afa392f030
2 changed files with 0 additions and 14 deletions

View file

@ -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)

View file

@ -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: