dont fail if no frame is selected
This commit is contained in:
parent
1fa04cec95
commit
3a610c6187
1 changed files with 3 additions and 2 deletions
|
@ -460,8 +460,9 @@ class Item(models.Model):
|
||||||
if keys and 'frames' in keys:
|
if keys and 'frames' in keys:
|
||||||
i['frames'] = frames
|
i['frames'] = frames
|
||||||
|
|
||||||
if frames:
|
selected_frame = filter(lambda f: f['selected'], frames)
|
||||||
i['posterFrame'] = filter(lambda f: f['selected'], frames)[0]['position']
|
if selected_frame:
|
||||||
|
i['posterFrame'] = selected_frame[0]['position']
|
||||||
elif self.poster_frame != -1.0:
|
elif self.poster_frame != -1.0:
|
||||||
i['posterFrame'] = self.poster_frame
|
i['posterFrame'] = self.poster_frame
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue