fix importing alternativeTitles

This commit is contained in:
j 2013-02-26 16:35:02 +00:00
parent d63d9be502
commit 52e62e7665

View file

@ -172,7 +172,7 @@ pandora.ui.metadataDialog = function(data) {
if (result.data) { if (result.data) {
imdb = result.data; imdb = result.data;
if (imdb.originalTitle) { if (imdb.originalTitle) {
imdb.alternativeTitles = [imdb.title, []].concat(imdb.alternativeTitles || []); imdb.alternativeTitles = [[imdb.title, []]].concat(imdb.alternativeTitles || []);
imdb.title = imdb.originalTitle; imdb.title = imdb.originalTitle;
} }
keys.forEach(function(key, index) { keys.forEach(function(key, index) {
@ -289,7 +289,8 @@ pandora.ui.metadataDialog = function(data) {
function updateMetadata() { function updateMetadata() {
var edit = {id: data.id}, type; var edit = {id: data.id}, type;
updateKeys.forEach(function(key) { updateKeys.forEach(function(key) {
type = Ox.getObjectById(pandora.site.itemKeys, key).type; type = key == 'alternativeTitles' ? []
: Ox.getObjectById(pandora.site.itemKeys, key).type;
edit[key] = imdb[key] || ( edit[key] = imdb[key] || (
Ox.isArray(type) ? [] : '' Ox.isArray(type) ? [] : ''
); );