From e0d6e7f162c0724e58d179b1fc95def15033b3ac Mon Sep 17 00:00:00 2001 From: j Date: Wed, 12 Sep 2018 17:03:41 +0200 Subject: [PATCH] keep originalTitle if config has originalTitle --- static/js/metadataDialog.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/static/js/metadataDialog.js b/static/js/metadataDialog.js index 040d67f49..48487b4bc 100644 --- a/static/js/metadataDialog.js +++ b/static/js/metadataDialog.js @@ -29,7 +29,7 @@ pandora.ui.metadataDialog = function(data) { that = data.imdbId ? updateDialog() : idDialog(); keys = keys.filter(function(key) { - return key == 'alternativeTitles' || getItemKey(key); + return Ox.contains(['alternativeTitles', 'filmingLocations'], key) || getItemKey(key); }); data.imdbId && getMetadata(); @@ -184,7 +184,7 @@ pandora.ui.metadataDialog = function(data) { function getMetadata() { pandora.api.getMetadata({ id: data.imdbId, - keys: keys.concat(['originalTitle']) + keys: Ox.unique(keys.concat(['originalTitle'])) }, function(result) { var $bar = Ox.Bar({size: 24}), $data = Ox.Element() @@ -218,9 +218,11 @@ pandora.ui.metadataDialog = function(data) { .appendTo($bar); if (result.data) { imdb = Ox.clone(result.data, true); - if (imdb.originalTitle) { - imdb.alternativeTitles = [[imdb.title, []]].concat(imdb.alternativeTitles || []); - imdb.title = imdb.originalTitle; + if (!Ox.contains(keys, 'originalTitle')) { + if (imdb.originalTitle) { + imdb.alternativeTitles = [[imdb.title, []]].concat(imdb.alternativeTitles || []); + imdb.title = imdb.originalTitle; + } } keys.forEach(function(key, index) { var isEqual = Ox.isEqual(data[getKey(key)], imdb[key]) || (