poster precedence
This commit is contained in:
parent
dec1d4d943
commit
9768eb4e78
2 changed files with 6 additions and 4 deletions
|
@ -313,7 +313,8 @@ class Item(models.Model):
|
|||
for service in services:
|
||||
if service not in precedence:
|
||||
precedence.append(service)
|
||||
precedence.append(settings.URL)
|
||||
if settings.URL not in precedence:
|
||||
precedence.append(settings.URL)
|
||||
|
||||
posters = [
|
||||
{
|
||||
|
@ -337,6 +338,7 @@ class Item(models.Model):
|
|||
'selected': p.url == url,
|
||||
'precedence': precedence.index(p.service)
|
||||
})
|
||||
posters.sort(key=lambda a: a['precedence'])
|
||||
return posters
|
||||
|
||||
def get_stream(self):
|
||||
|
|
|
@ -59,13 +59,13 @@ pandora.ui.postersDialog = function(id) {
|
|||
}
|
||||
},
|
||||
items: posters,
|
||||
keys: ['source', 'width', 'height', 'url'],
|
||||
keys: ['precedence', 'source', 'width', 'height', 'url'],
|
||||
max: 1,
|
||||
min: 1,
|
||||
orientation: 'vertical',
|
||||
selected: selected,
|
||||
size: 128,
|
||||
sort: [{key: 'source', operator: '+'}],
|
||||
sort: [{key: 'precedence', operator: '+'}],
|
||||
unique: 'source'
|
||||
})
|
||||
.css({background: 'rgb(16, 16, 16)'})
|
||||
|
@ -103,4 +103,4 @@ pandora.ui.postersDialog = function(id) {
|
|||
|
||||
return that;
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue