|
|
@ -64,9 +64,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
var clientConfig, pluginConfig;
|
|
|
|
var clientConfig, pluginConfig;
|
|
|
|
var configureImageScaling = function() {
|
|
|
|
var configureImageScaling = function() {
|
|
|
|
if (clientConfig === null || pluginConfig === null) {
|
|
|
|
if (clientConfig === undefined || pluginConfig === undefined) {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (Object.keys(clientConfig).length === 0) {
|
|
|
|
|
|
|
|
clientConfig = {
|
|
|
|
|
|
|
|
PosterSizes: [pluginConfig.PosterSize],
|
|
|
|
|
|
|
|
BackdropSizes: [pluginConfig.BackdropSize],
|
|
|
|
|
|
|
|
LogoSizes: [pluginConfig.LogoSize],
|
|
|
|
|
|
|
|
ProfileSizes: [pluginConfig.ProfileSize],
|
|
|
|
|
|
|
|
StillSizes: [pluginConfig.StillSize]
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var sizeOptionsGenerator = function (size) {
|
|
|
|
var sizeOptionsGenerator = function (size) {
|
|
|
|
return '<option value="' + size + '">' + size + '</option>';
|
|
|
|
return '<option value="' + size + '">' + size + '</option>';
|
|
|
@ -104,6 +113,15 @@
|
|
|
|
ApiClient.fetch(request).then(function (config) {
|
|
|
|
ApiClient.fetch(request).then(function (config) {
|
|
|
|
clientConfig = config;
|
|
|
|
clientConfig = config;
|
|
|
|
configureImageScaling();
|
|
|
|
configureImageScaling();
|
|
|
|
|
|
|
|
}, function (error) {
|
|
|
|
|
|
|
|
error.text().then(function (contents) {
|
|
|
|
|
|
|
|
Dashboard.alert({
|
|
|
|
|
|
|
|
title: error.statusText,
|
|
|
|
|
|
|
|
message: contents
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
clientConfig = {};
|
|
|
|
|
|
|
|
configureImageScaling();
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
ApiClient.getPluginConfiguration(PluginConfig.pluginId).then(function (config) {
|
|
|
|
ApiClient.getPluginConfiguration(PluginConfig.pluginId).then(function (config) {
|
|
|
|