This commit is contained in:
j 2010-08-11 00:11:09 +02:00
parent 480f4fec30
commit 6dcffed666
3 changed files with 9 additions and 4 deletions

View file

@ -144,11 +144,12 @@ class Movie(models.Model):
posters_url = models.TextField(blank=True) posters_url = models.TextField(blank=True)
poster_height = models.IntegerField(default=0) poster_height = models.IntegerField(default=0)
poster_width = models.IntegerField(default=0) poster_width = models.IntegerField(default=0)
poster_frame = models.FloatField(default=-1) poster_frame = models.FloatField(default=-1)
def get_poser(self): def get_poster(self):
url = self.poster_url: url = self.poster_url
if not url: if not url and self.poster:
url = self.poster.url url = self.poster.url
return url return url
@ -208,6 +209,7 @@ class Movie(models.Model):
movie[pub_key] = value() movie[pub_key] = value()
else: else:
movie[pub_key] = value movie[pub_key] = value
movie['poster'] = self.get_poster()
if fields: if fields:
for f in fields: for f in fields:
if f.endswith('.length') and f[:-7] in ('cast', 'genre', 'trivia'): if f.endswith('.length') and f[:-7] in ('cast', 'genre', 'trivia'):

View file

@ -5,7 +5,6 @@ from django.conf.urls.defaults import *
urlpatterns = patterns("backend.views", urlpatterns = patterns("backend.views",
(r'^upload/$', 'firefogg_upload'),
(r'^frame/(?P<id>.*)/(?P<position>.*)\.(?P<size>\d+).jpg$', 'frame'), (r'^frame/(?P<id>.*)/(?P<position>.*)\.(?P<size>\d+).jpg$', 'frame'),
(r'^stream/(?P<id>.*).(?P<quality>.*).ogv$', 'video'), (r'^stream/(?P<id>.*).(?P<quality>.*).ogv$', 'video'),
(r'^$', 'api'), (r'^$', 'api'),

View file

@ -134,6 +134,10 @@ TRANSMISSON_PORT=9091
TRANSMISSON_USER='transmission' TRANSMISSON_USER='transmission'
TRANSMISSON_PASSWORD='transmission' TRANSMISSON_PASSWORD='transmission'
#list of poster services, https://wiki.0x2620.org/wiki/pandora/posterservice
POSTER_SERVICES=[]
#overwrite default settings with local settings #overwrite default settings with local settings
try: try:
from local_settings import * from local_settings import *