dont fail if movie is unknown
This commit is contained in:
parent
b11d8edd2d
commit
bf345dff14
2 changed files with 15 additions and 11 deletions
|
@ -32,15 +32,17 @@ pandora.ui.info = function(id) {
|
||||||
} else {
|
} else {
|
||||||
// Video Preview
|
// Video Preview
|
||||||
pandora.api.get({id: id, keys: ['duration', 'videoRatio']}, function(result) {
|
pandora.api.get({id: id, keys: ['duration', 'videoRatio']}, function(result) {
|
||||||
var height = Math.round(pandora.user.ui.sidebarSize / result.data.videoRatio) + 16;
|
if(result.data) {
|
||||||
pandora.$ui.videoPreview && pandora.$ui.videoPreview.removeElement();
|
var height = Math.round(pandora.user.ui.sidebarSize / result.data.videoRatio) + 16;
|
||||||
pandora.$ui.videoPreview = pandora.ui.videoPreview({
|
pandora.$ui.videoPreview && pandora.$ui.videoPreview.removeElement();
|
||||||
id: id,
|
pandora.$ui.videoPreview = pandora.ui.videoPreview({
|
||||||
duration: result.data.duration,
|
id: id,
|
||||||
ratio: result.data.videoRatio
|
duration: result.data.duration,
|
||||||
}).appendTo(pandora.$ui.info);
|
ratio: result.data.videoRatio
|
||||||
pandora.user.infoRatio = pandora.user.ui.sidebarSize / height;
|
}).appendTo(pandora.$ui.info);
|
||||||
resize(height);
|
pandora.user.infoRatio = pandora.user.ui.sidebarSize / height;
|
||||||
|
resize(height);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else if (pandora.$ui.leftPanel) {
|
} else if (pandora.$ui.leftPanel) {
|
||||||
|
|
|
@ -403,8 +403,10 @@ pandora.ui.item = function() {
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
var director = result.data.director?' ('+result.data.director.join(', ')+')':'';
|
if (result.data) {
|
||||||
pandora.$ui.total.html(result.data.title + director);
|
var director = result.data.director?' ('+result.data.director.join(', ')+')':'';
|
||||||
|
pandora.$ui.total.html(result.data.title + director);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
return that;
|
return that;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue