pass 0 instead of None

This commit is contained in:
j 2017-03-11 21:05:52 +02:00
parent d263c4c7f0
commit 62ffbca208
2 changed files with 3 additions and 1 deletions

View file

@ -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'):

View file

@ -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: