diff --git a/pandora/item/models.py b/pandora/item/models.py index e243945c..03a1d775 100644 --- a/pandora/item/models.py +++ b/pandora/item/models.py @@ -330,6 +330,8 @@ class Item(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'] + else: + stream['aspectRatio'] = 4/3 if settings.XSENDFILE or settings.XACCELREDIRECT: stream['baseUrl'] = '/%s' % self.itemId else: @@ -607,6 +609,8 @@ class Item(models.Model): 'frames', "%d"%width, "%s.jpg"%position) if not os.path.exists(path): extract.frame(stream.video.path, path, position, width) + if not os.path.exists(path): + path = os.path.join(settings.STATIC_ROOT, 'png/frame.broken.png') return path @property diff --git a/pandora/item/views.py b/pandora/item/views.py index 6a48b400..0c4fc7ae 100644 --- a/pandora/item/views.py +++ b/pandora/item/views.py @@ -497,7 +497,6 @@ def poster(request, id, size=None): else: if not size: size='large' - return redirect('http://0xdb.org/%s/poster.%s.jpg' % (item.itemId, size)) poster_path = os.path.join(settings.STATIC_ROOT, 'png/posterDark.48.png') return HttpFileResponse(poster_path, content_type='image/jpeg') diff --git a/pandora/templates/api.html b/pandora/templates/api.html index c0022bfa..a4247a8c 100644 --- a/pandora/templates/api.html +++ b/pandora/templates/api.html @@ -22,7 +22,7 @@