From 2869dbafab5b7171c89153deb39a235f9e070b3f Mon Sep 17 00:00:00 2001 From: j Date: Mon, 19 Sep 2016 19:56:42 +0200 Subject: [PATCH] use pandora.site.importMetadata --- static/js/addFilesDialog.js | 3 ++- static/js/addItemDialog.js | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/static/js/addFilesDialog.js b/static/js/addFilesDialog.js index c7966b71..9103ec1d 100644 --- a/static/js/addFilesDialog.js +++ b/static/js/addFilesDialog.js @@ -137,7 +137,8 @@ pandora.ui.addFilesDialog = function(options) { } (isNewItem ? pandora.api.edit : Ox.noop)(Ox.extend( Ox.filter(item, function(value, key) { - return key != 'title'; + return key != 'title' && + Object.keys(pandora.site.importMetadata).indexOf(key) > -1; }), {'id': id} ), function(result) { diff --git a/static/js/addItemDialog.js b/static/js/addItemDialog.js index d0a1fafc..e4fa07fa 100644 --- a/static/js/addItemDialog.js +++ b/static/js/addItemDialog.js @@ -106,7 +106,7 @@ pandora.ui.addItemDialog = function(options) { pandora.api.getMediaUrlInfo({ url: input }, function(result) { - onInfo(result.data.items); + onInfo(result.data.items.map(getVideoInfo)); }); } } @@ -175,6 +175,8 @@ pandora.ui.addItemDialog = function(options) { } return value; }); + values.url= info.url; + return Ox.extend(info, values); } function onInfo(items) {