remove local poster
This commit is contained in:
parent
2dcbd2ec27
commit
afa392f030
2 changed files with 0 additions and 14 deletions
|
@ -4,7 +4,3 @@
|
||||||
import models
|
import models
|
||||||
from django.contrib import admin
|
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)
|
|
||||||
|
|
||||||
|
|
|
@ -40,9 +40,6 @@ def getPosters(movie_id, url_prefix='', limit=lambda x, y: 0.3 < x/y < 1):
|
||||||
for p in posters.keys():
|
for p in posters.keys():
|
||||||
if not posters[p]:
|
if not posters[p]:
|
||||||
del 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
|
return posters
|
||||||
|
|
||||||
def poster_path(url, filename):
|
def poster_path(url, filename):
|
||||||
|
@ -101,13 +98,6 @@ class PosterCache(models.Model):
|
||||||
self.save()
|
self.save()
|
||||||
return self.image
|
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 getPosterUrls(m):
|
||||||
def addPoster(url, site, site_id):
|
def addPoster(url, site, site_id):
|
||||||
if PosterCache.objects.all().filter(url=url, movie_id=m).count() == 0:
|
if PosterCache.objects.all().filter(url=url, movie_id=m).count() == 0:
|
||||||
|
|
Loading…
Reference in a new issue