diff options
Diffstat (limited to 'MediaBrowser.Providers/Plugins/Tmdb/Configuration')
| -rw-r--r-- | MediaBrowser.Providers/Plugins/Tmdb/Configuration/PluginConfiguration.cs | 21 | ||||
| -rw-r--r-- | MediaBrowser.Providers/Plugins/Tmdb/Configuration/config.html | 59 |
2 files changed, 40 insertions, 40 deletions
diff --git a/MediaBrowser.Providers/Plugins/Tmdb/Configuration/PluginConfiguration.cs b/MediaBrowser.Providers/Plugins/Tmdb/Configuration/PluginConfiguration.cs index b043da76c..dec796148 100644 --- a/MediaBrowser.Providers/Plugins/Tmdb/Configuration/PluginConfiguration.cs +++ b/MediaBrowser.Providers/Plugins/Tmdb/Configuration/PluginConfiguration.cs @@ -1,4 +1,3 @@ -using System.Collections.Generic; using MediaBrowser.Model.Plugins; namespace MediaBrowser.Providers.Plugins.Tmdb @@ -34,38 +33,18 @@ namespace MediaBrowser.Providers.Plugins.Tmdb public string? PosterSize { get; set; } /// <summary> - /// Gets or sets the available options for poster size. - /// </summary> - public List<string> PosterSizeOptions { get; set; } = new List<string>(); - - /// <summary> /// Gets or sets a value indicating the backdrop image size to fetch. /// </summary> public string? BackdropSize { get; set; } /// <summary> - /// Gets or sets the available options for backdrop size. - /// </summary> - public List<string> BackdropSizeOptions { get; set; } = new List<string>(); - - /// <summary> /// Gets or sets a value indicating the profile image size to fetch. /// </summary> public string? ProfileSize { get; set; } /// <summary> - /// Gets or sets the available options for profile size. - /// </summary> - public List<string> ProfileSizeOptions { get; set; } = new List<string>(); - - /// <summary> /// Gets or sets a value indicating the still image size to fetch. /// </summary> public string? StillSize { get; set; } - - /// <summary> - /// Gets or sets the available options for still size. - /// </summary> - public List<string> StillSizeOptions { get; set; } = new List<string>(); } } diff --git a/MediaBrowser.Providers/Plugins/Tmdb/Configuration/config.html b/MediaBrowser.Providers/Plugins/Tmdb/Configuration/config.html index d376df96c..52693795b 100644 --- a/MediaBrowser.Providers/Plugins/Tmdb/Configuration/config.html +++ b/MediaBrowser.Providers/Plugins/Tmdb/Configuration/config.html @@ -26,7 +26,6 @@ </div> <div class="verticalSection verticalSection-extrabottompadding"> <h2>Image Scaling</h2> - <p>If size options are not populated then refresh metadata for any item from TMDb and reload this page.</p> <div class="selectContainer"> <select is="emby-select" id="selectPosterSize" label="Poster"></select> </div> @@ -54,39 +53,61 @@ document.querySelector('.configPage') .addEventListener('pageshow', function () { Dashboard.showLoadingMsg(); - ApiClient.getPluginConfiguration(PluginConfig.pluginId).then(function (config) { - document.querySelector('#includeAdult').checked = config.IncludeAdult; - document.querySelector('#excludeTagsSeries').checked = config.ExcludeTagsSeries; - document.querySelector('#excludeTagsMovies').checked = config.ExcludeTagsMovies; - var maxCastMembers = document.querySelector('#maxCastMembers'); - maxCastMembers.value = config.MaxCastMembers; - maxCastMembers.dispatchEvent(new Event('change', { - bubbles: true, - cancelable: false - })); + var clientConfig, pluginConfig; + var configureImageScaling = function() { + if (clientConfig === null || pluginConfig === null) { + return; + } var sizeOptionsGenerator = function (size) { return '<option value="' + size + '">' + size + '</option>'; } var selPosterSize = document.querySelector('#selectPosterSize'); - selPosterSize.innerHTML = config.PosterSizeOptions.map(sizeOptionsGenerator); - selPosterSize.value = config.PosterSize; + selPosterSize.innerHTML = clientConfig.PosterSizes.map(sizeOptionsGenerator); + selPosterSize.value = pluginConfig.PosterSize; var selBackdropSize = document.querySelector('#selectBackdropSize'); - selBackdropSize.innerHTML = config.BackdropSizeOptions.map(sizeOptionsGenerator); - selBackdropSize.value = config.BackdropSize; + selBackdropSize.innerHTML = clientConfig.BackdropSizes.map(sizeOptionsGenerator); + selBackdropSize.value = pluginConfig.BackdropSize; var selProfileSize = document.querySelector('#selectProfileSize'); - selProfileSize.innerHTML = config.ProfileSizeOptions.map(sizeOptionsGenerator); - selProfileSize.value = config.ProfileSize; + selProfileSize.innerHTML = clientConfig.ProfileSizes.map(sizeOptionsGenerator); + selProfileSize.value = pluginConfig.ProfileSize; var selStillSize = document.querySelector('#selectStillSize'); - selStillSize.innerHTML = config.StillSizeOptions.map(sizeOptionsGenerator); - selStillSize.value = config.StillSize; + selStillSize.innerHTML = clientConfig.StillSizes.map(sizeOptionsGenerator); + selStillSize.value = pluginConfig.StillSize; Dashboard.hideLoadingMsg(); + } + + const request = { + url: ApiClient.getUrl('tmdb/ClientConfiguration'), + dataType: 'json', + type: 'GET', + headers: { accept: 'application/json' } + } + ApiClient.fetch(request).then(function (config) { + clientConfig = config; + configureImageScaling(); + }); + + ApiClient.getPluginConfiguration(PluginConfig.pluginId).then(function (config) { + document.querySelector('#includeAdult').checked = config.IncludeAdult; + document.querySelector('#excludeTagsSeries').checked = config.ExcludeTagsSeries; + document.querySelector('#excludeTagsMovies').checked = config.ExcludeTagsMovies; + + var maxCastMembers = document.querySelector('#maxCastMembers'); + maxCastMembers.value = config.MaxCastMembers; + maxCastMembers.dispatchEvent(new Event('change', { + bubbles: true, + cancelable: false + })); + + pluginConfig = config; + configureImageScaling(); }); }); |
