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 = os.path.abspath(os.path.join(settings.MEDIA_ROOT, icon))
icons = glob(icons.replace('.jpg', '*.jpg')) icons = glob(icons.replace('.jpg', '*.jpg'))
for f in filter(lambda p: not p.endswith('/icon.jpg'), icons): for f in filter(lambda p: not p.endswith('/icon.jpg'), icons):
os.unlink(f) try:
os.unlink(f)
except:
pass
return icon return icon
def load_subtitles(self): def load_subtitles(self):

View file

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

View file

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

View file

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