fix selecting file without instances

This commit is contained in:
j 2017-06-06 10:54:54 +02:00
parent 5354b52193
commit 43f1d07dbe

View file

@ -113,7 +113,10 @@ pandora.ui.mediaView = function(options) {
'encoding': 'Processing video on server', 'encoding': 'Processing video on server',
'failed': 'Encoding failed' 'failed': 'Encoding failed'
}[data.state]) }[data.state])
: data.instances.filter(function(i) {return i.ignore; }).length > 0 : (
data.instances.filter(function(i) {return i.ignore; }).length > 0 ||
(data.instances.length == 0 && !data.selected)
)
? Ox._('Use this file') ? Ox._('Use this file')
: Ox._('Dont use this file'); : Ox._('Dont use this file');
}, },
@ -294,8 +297,10 @@ pandora.ui.mediaView = function(options) {
}) })
.open(); .open();
} else { } else {
var ignored = self.$filesList.value(data.id, 'instances') var instances = self.$filesList.value(data.id, 'instances'),
.filter(function(i) {return i.ignore; }).length > 0; selected = self.$filesList.value(data.id, 'selected'),
ignored = (instances.length == 0 && ! selected) ||
instances.filter(function(i) {return i.ignore; }).length > 0;
pandora.api.editMedia({ pandora.api.editMedia({
files: [{ files: [{
id: data.id, id: data.id,