From 6dcffed6669405906f04bcb8bc2363e2d5a4f7d2 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Wed, 11 Aug 2010 00:11:09 +0200 Subject: [PATCH] poster --- pandora/backend/models.py | 8 +++++--- pandora/backend/urls.py | 1 - pandora/settings.py | 4 ++++ 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/pandora/backend/models.py b/pandora/backend/models.py index 882ef9f3b..6d1005e27 100644 --- a/pandora/backend/models.py +++ b/pandora/backend/models.py @@ -144,11 +144,12 @@ class Movie(models.Model): posters_url = models.TextField(blank=True) poster_height = models.IntegerField(default=0) poster_width = models.IntegerField(default=0) + poster_frame = models.FloatField(default=-1) - def get_poser(self): - url = self.poster_url: - if not url: + def get_poster(self): + url = self.poster_url + if not url and self.poster: url = self.poster.url return url @@ -208,6 +209,7 @@ class Movie(models.Model): movie[pub_key] = value() else: movie[pub_key] = value + movie['poster'] = self.get_poster() if fields: for f in fields: if f.endswith('.length') and f[:-7] in ('cast', 'genre', 'trivia'): diff --git a/pandora/backend/urls.py b/pandora/backend/urls.py index b1a9ffec1..76ddd3728 100644 --- a/pandora/backend/urls.py +++ b/pandora/backend/urls.py @@ -5,7 +5,6 @@ from django.conf.urls.defaults import * urlpatterns = patterns("backend.views", - (r'^upload/$', 'firefogg_upload'), (r'^frame/(?P.*)/(?P.*)\.(?P\d+).jpg$', 'frame'), (r'^stream/(?P.*).(?P.*).ogv$', 'video'), (r'^$', 'api'), diff --git a/pandora/settings.py b/pandora/settings.py index b034bd980..d77084c6b 100644 --- a/pandora/settings.py +++ b/pandora/settings.py @@ -134,6 +134,10 @@ TRANSMISSON_PORT=9091 TRANSMISSON_USER='transmission' TRANSMISSON_PASSWORD='transmission' + +#list of poster services, https://wiki.0x2620.org/wiki/pandora/posterservice +POSTER_SERVICES=[] + #overwrite default settings with local settings try: from local_settings import *