poster precedence

This commit is contained in:
j 2011-08-01 17:51:34 +02:00
parent dec1d4d943
commit 9768eb4e78
2 changed files with 6 additions and 4 deletions

View file

@ -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):

View file

@ -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;
}
}