empty lists

This commit is contained in:
j 2011-12-27 14:52:16 +01:00
parent 2a3c09d0ce
commit 40e8eeb0cb
4 changed files with 12 additions and 10 deletions

View file

@ -1089,7 +1089,10 @@ class Item(models.Model):
icons = os.path.abspath(os.path.join(settings.MEDIA_ROOT, icon))
icons = glob(icons.replace('.jpg', '*.jpg'))
for f in filter(lambda p: not p.endswith('/icon.jpg'), icons):
os.unlink(f)
try:
os.unlink(f)
except:
pass
return icon
def load_subtitles(self):

View file

@ -522,7 +522,7 @@
"sidebarSize": 256,
"theme": "classic",
"videoPoints": {},
"videoResolution": 96,
"videoResolution": 240,
"videoScale": "fit",
"videoMuted": false,
"videoSize": "small",

View file

@ -222,7 +222,7 @@ pandora.ui.infoView = function(data) {
placeholder: formatLight('unknown'),
tooltip: 'Doubleclick to edit',
value: key == 'country'
? (data[key] ? data[key].join(', ') : [''])
? (data[key] ? data[key].join(', ') : '')
: data[key] || ''
})
.css({float: 'left'})
@ -284,10 +284,7 @@ pandora.ui.infoView = function(data) {
})
.bindEvent({
submit: function(event) {
var value = ['language', 'category'].indexOf(key) >= 0
? event.value.split(', ')
: event.value;
editMetadata(key, value);
editMetadata(key, event.value);
}
})
.appendTo($div);
@ -388,8 +385,8 @@ pandora.ui.infoView = function(data) {
var edit = {id: data.id};
if (key == 'title') {
Ox.extend(edit, parseTitle(value));
} else if (key == 'director' || key == 'country') {
edit[key] = value.split(', ');
} else if(['director', 'country', 'language', 'category'].indexOf(key) >= 0) {
edit[key] = value ? value.split(', ') : [];
} else {
edit[key] = value;
}

View file

@ -32,7 +32,9 @@ pandora.ui.item = function() {
pandora.$ui.itemTitle
.options({
title: '<b>' + result.data.title
+ (result.data.director ? ' (' + result.data.director.join(', ') + ')' : '')
+ (result.data.director && result.data.director.length
? ' (' + result.data.director.join(', ') + ')'
: '')
+ (result.data.year ? ' ' + result.data.year : '') + '</b>'
})
.show();