dont fail if position to high

This commit is contained in:
j 2011-10-05 23:20:43 +02:00
parent 616c65bd45
commit f9835e934d

View file

@ -580,7 +580,7 @@ def frame(request, id, size, position=None):
frames = item.poster_frames() frames = item.poster_frames()
if frames: if frames:
position = item.poster_frame position = item.poster_frame
if position == -1: if position == -1 or position > len(frames):
position = int(len(frames)/2) position = int(len(frames)/2)
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: