use frame as thumbnail, fix default frame.

This commit is contained in:
j 2013-03-07 10:24:25 +00:00
commit 34be7923a7
3 changed files with 14 additions and 14 deletions

View file

@ -700,14 +700,15 @@ def frame(request, id, size, position=None):
return HttpResponseForbidden()
frame = None
if not position:
frames = item.poster_frames()
if frames:
position = item.poster_frame
if position == -1 or position > len(frames):
position = int(len(frames)/2)
position = frames[int(position)]['position']
elif item.poster_frame == -1 and item.sort.duration:
position = item.sort.duration/2
if settings.CONFIG['media']['importFrames'] or item.poster_frame == -1:
frames = item.poster_frames()
if frames:
position = item.poster_frame
if position == -1 or position > len(frames):
position = int(len(frames)/2)
position = frames[int(position)]['position']
elif item.poster_frame == -1 and item.sort.duration:
position = item.sort.duration/2
else:
position = item.poster_frame
else: