video base url

This commit is contained in:
j 2010-09-14 17:03:10 +02:00
parent b56811350b
commit 76dbab1016
2 changed files with 4 additions and 3 deletions

View file

@ -63,7 +63,6 @@ def api_update(request):
return {'status': {'code': int, 'text': string}, return {'status': {'code': int, 'text': string},
'data': {info: list, data: list, file: list}} 'data': {info: list, data: list, file: list}}
''' '''
print "here we go fucker", request.user
data = json.loads(request.POST['data']) data = json.loads(request.POST['data'])
user = request.user user = request.user

View file

@ -263,8 +263,10 @@ class Movie(models.Model):
stream['duration'] = s.info['duration'] stream['duration'] = s.info['duration']
if 'video' in s.info and s.info['video']: if 'video' in s.info and s.info['video']:
stream['aspectRatio'] = s.info['video'][0]['width'] / s.info['video'][0]['height'] stream['aspectRatio'] = s.info['video'][0]['width'] / s.info['video'][0]['height']
if settings.XSENDFILE or settings.XACCELREDIRECT:
stream['baseUrl'] = os.path.dirname(s.video.url) 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')))) stream['profiles'] = list(set(map(lambda s: int(os.path.splitext(s['profile'])[0][:-1]), self.streams.all().values('profile'))))
return stream return stream