forked from 0x2620/pandora
pass 0 instead of None
This commit is contained in:
parent
d263c4c7f0
commit
62ffbca208
2 changed files with 3 additions and 1 deletions
|
@ -1135,7 +1135,7 @@ class Item(models.Model):
|
||||||
offset = 0
|
offset = 0
|
||||||
streams = self.streams()
|
streams = self.streams()
|
||||||
for stream in streams:
|
for stream in streams:
|
||||||
if stream.duration + offset < float(position):
|
if stream.duration + offset < position:
|
||||||
offset += stream.duration
|
offset += stream.duration
|
||||||
else:
|
else:
|
||||||
if not stream.file.is_video or not stream.file.info.get('video'):
|
if not stream.file.is_video or not stream.file.info.get('video'):
|
||||||
|
|
|
@ -777,6 +777,8 @@ def frame(request, id, size, position=None):
|
||||||
position = frames[int(position)]['position']
|
position = frames[int(position)]['position']
|
||||||
elif item.poster_frame == -1 and item.sort.duration:
|
elif item.poster_frame == -1 and item.sort.duration:
|
||||||
position = item.sort.duration/2
|
position = item.sort.duration/2
|
||||||
|
else:
|
||||||
|
position = 0
|
||||||
else:
|
else:
|
||||||
position = item.poster_frame
|
position = item.poster_frame
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue