From 62ffbca20898ec91a337a79d7d78f9275e6c1d30 Mon Sep 17 00:00:00 2001 From: j Date: Sat, 11 Mar 2017 21:05:52 +0200 Subject: [PATCH] pass 0 instead of None --- pandora/item/models.py | 2 +- pandora/item/views.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pandora/item/models.py b/pandora/item/models.py index b38fb7dc..49ad5957 100644 --- a/pandora/item/models.py +++ b/pandora/item/models.py @@ -1135,7 +1135,7 @@ class Item(models.Model): offset = 0 streams = self.streams() for stream in streams: - if stream.duration + offset < float(position): + if stream.duration + offset < position: offset += stream.duration else: if not stream.file.is_video or not stream.file.info.get('video'): diff --git a/pandora/item/views.py b/pandora/item/views.py index c996cb62..f9096f87 100644 --- a/pandora/item/views.py +++ b/pandora/item/views.py @@ -777,6 +777,8 @@ def frame(request, id, size, position=None): position = frames[int(position)]['position'] elif item.poster_frame == -1 and item.sort.duration: position = item.sort.duration/2 + else: + position = 0 else: position = item.poster_frame else: