From 43837ff529ccc196a72c28befc26e776d6282d9a Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Mon, 13 Sep 2010 17:19:38 +0200 Subject: [PATCH] poster --- pandora/backend/models.py | 2 +- pandora/backend/views.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pandora/backend/models.py b/pandora/backend/models.py index 936dad3c8..19e796ae9 100644 --- a/pandora/backend/models.py +++ b/pandora/backend/models.py @@ -887,7 +887,7 @@ class Stream(models.Model): class PosterUrl(models.Model): class Meta: unique_together = ("movie", "service", "url") - ordering = ('height', ) + ordering = ('-height', ) movie = models.ForeignKey(Movie, related_name='poster_urls') url = models.CharField(max_length=1024) diff --git a/pandora/backend/views.py b/pandora/backend/views.py index db65293c2..5e2e14789 100644 --- a/pandora/backend/views.py +++ b/pandora/backend/views.py @@ -548,7 +548,7 @@ def frame(request, id, position, size): raise Http404 return HttpFileResponse(frame, content_type='image/jpeg') -def poster(request, id, size=128): +def poster(request, id, size=None): movie = get_object_or_404(models.Movie, movieId=id) if size == 'large': size = None @@ -559,7 +559,7 @@ def poster(request, id, size=128): if not os.path.exists(poster_path): poster_size = max(movie.poster.width, movie.poster.height) if size > poster_size: - return redirect('/%s/poster.large.jpg' % movie.movieId) + return redirect('/%s/poster.jpg' % movie.movieId) extract.resize_image(movie.poster.path, poster_path, size=size) else: poster_path = movie.poster.path