From 43f1d07dbe751e1a94ba21f592c309751e2ac9ae Mon Sep 17 00:00:00 2001 From: j Date: Tue, 6 Jun 2017 10:54:54 +0200 Subject: [PATCH] fix selecting file without instances --- static/js/mediaView.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/static/js/mediaView.js b/static/js/mediaView.js index 708eef362..ecaf44ced 100644 --- a/static/js/mediaView.js +++ b/static/js/mediaView.js @@ -113,7 +113,10 @@ pandora.ui.mediaView = function(options) { 'encoding': 'Processing video on server', 'failed': 'Encoding failed' }[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._('Dont use this file'); }, @@ -294,8 +297,10 @@ pandora.ui.mediaView = function(options) { }) .open(); } else { - var ignored = self.$filesList.value(data.id, 'instances') - .filter(function(i) {return i.ignore; }).length > 0; + var instances = self.$filesList.value(data.id, 'instances'), + selected = self.$filesList.value(data.id, 'selected'), + ignored = (instances.length == 0 && ! selected) || + instances.filter(function(i) {return i.ignore; }).length > 0; pandora.api.editMedia({ files: [{ id: data.id,