From 76dbab101668c30c9f0cb753cffa3b3d5ae52497 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Tue, 14 Sep 2010 17:03:10 +0200 Subject: [PATCH] video base url --- pandora/archive/views.py | 1 - pandora/backend/models.py | 6 ++++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/pandora/archive/views.py b/pandora/archive/views.py index 80626d58..87fbed24 100644 --- a/pandora/archive/views.py +++ b/pandora/archive/views.py @@ -63,7 +63,6 @@ def api_update(request): return {'status': {'code': int, 'text': string}, 'data': {info: list, data: list, file: list}} ''' - print "here we go fucker", request.user data = json.loads(request.POST['data']) user = request.user diff --git a/pandora/backend/models.py b/pandora/backend/models.py index 3a7a2d68..1381e685 100644 --- a/pandora/backend/models.py +++ b/pandora/backend/models.py @@ -263,8 +263,10 @@ class Movie(models.Model): stream['duration'] = s.info['duration'] if 'video' in s.info and s.info['video']: stream['aspectRatio'] = s.info['video'][0]['width'] / s.info['video'][0]['height'] - - stream['baseUrl'] = os.path.dirname(s.video.url) + if settings.XSENDFILE or settings.XACCELREDIRECT: + stream['baseUrl'] = '/%s' % self.movieId + else: + stream['baseUrl'] = os.path.dirname(s.video.url) stream['profiles'] = list(set(map(lambda s: int(os.path.splitext(s['profile'])[0][:-1]), self.streams.all().values('profile')))) return stream