forked from 0x2620/pandora
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:
|
for service in services:
|
||||||
if service not in precedence:
|
if service not in precedence:
|
||||||
precedence.append(service)
|
precedence.append(service)
|
||||||
precedence.append(settings.URL)
|
if settings.URL not in precedence:
|
||||||
|
precedence.append(settings.URL)
|
||||||
|
|
||||||
posters = [
|
posters = [
|
||||||
{
|
{
|
||||||
|
@ -337,6 +338,7 @@ class Item(models.Model):
|
||||||
'selected': p.url == url,
|
'selected': p.url == url,
|
||||||
'precedence': precedence.index(p.service)
|
'precedence': precedence.index(p.service)
|
||||||
})
|
})
|
||||||
|
posters.sort(key=lambda a: a['precedence'])
|
||||||
return posters
|
return posters
|
||||||
|
|
||||||
def get_stream(self):
|
def get_stream(self):
|
||||||
|
|
|
@ -59,13 +59,13 @@ pandora.ui.postersDialog = function(id) {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
items: posters,
|
items: posters,
|
||||||
keys: ['source', 'width', 'height', 'url'],
|
keys: ['precedence', 'source', 'width', 'height', 'url'],
|
||||||
max: 1,
|
max: 1,
|
||||||
min: 1,
|
min: 1,
|
||||||
orientation: 'vertical',
|
orientation: 'vertical',
|
||||||
selected: selected,
|
selected: selected,
|
||||||
size: 128,
|
size: 128,
|
||||||
sort: [{key: 'source', operator: '+'}],
|
sort: [{key: 'precedence', operator: '+'}],
|
||||||
unique: 'source'
|
unique: 'source'
|
||||||
})
|
})
|
||||||
.css({background: 'rgb(16, 16, 16)'})
|
.css({background: 'rgb(16, 16, 16)'})
|
||||||
|
|
Loading…
Reference in a new issue