avoid storing invalid poster frames, only show videos with video
This commit is contained in:
parent
b8beb51480
commit
1bff4aa0e9
2 changed files with 7 additions and 2 deletions
|
@ -162,7 +162,10 @@ class Text(models.Model):
|
||||||
if 'type' in data:
|
if 'type' in data:
|
||||||
self.type = data['type'] == 'pdf' and 'pdf' or 'html'
|
self.type = data['type'] == 'pdf' and 'pdf' or 'html'
|
||||||
if 'posterFrames' in data:
|
if 'posterFrames' in data:
|
||||||
self.poster_frames = tuple(data['posterFrames'])
|
poster_frames = [p for p in data['posterFrames'] if 'item' in p]
|
||||||
|
while len(poster_frames) < 4:
|
||||||
|
poster_frames += [poster_frames[-1]]
|
||||||
|
self.poster_frames = tuple(poster_frames)
|
||||||
if 'embeds' in data:
|
if 'embeds' in data:
|
||||||
self.embeds = tuple(data['embeds'])
|
self.embeds = tuple(data['embeds'])
|
||||||
self.save()
|
self.save()
|
||||||
|
|
|
@ -481,7 +481,9 @@ pandora.ui.listIconPanel = function(listData) {
|
||||||
query: {
|
query: {
|
||||||
conditions: ui.section == 'items'
|
conditions: ui.section == 'items'
|
||||||
? [{key: 'list', value: listData.id, operator: '=='}]
|
? [{key: 'list', value: listData.id, operator: '=='}]
|
||||||
: listData.query ? listData.query.conditions : [],
|
: listData.query
|
||||||
|
? listData.query.conditions
|
||||||
|
: [{key: 'duration', value: '00:00:00', operator: '>'}],
|
||||||
operator: '&'
|
operator: '&'
|
||||||
}
|
}
|
||||||
}), callback);
|
}), callback);
|
||||||
|
|
Loading…
Reference in a new issue