empty lists
This commit is contained in:
parent
2a3c09d0ce
commit
40e8eeb0cb
4 changed files with 12 additions and 10 deletions
|
@ -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):
|
||||||
|
try:
|
||||||
os.unlink(f)
|
os.unlink(f)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
return icon
|
return icon
|
||||||
|
|
||||||
def load_subtitles(self):
|
def load_subtitles(self):
|
||||||
|
|
|
@ -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",
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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();
|
||||||
|
|
Loading…
Reference in a new issue