diff options
Diffstat (limited to 'MediaBrowser.Providers/Plugins/Tmdb/Configuration')
| -rw-r--r-- | MediaBrowser.Providers/Plugins/Tmdb/Configuration/PluginConfiguration.cs | 41 | ||||
| -rw-r--r-- | MediaBrowser.Providers/Plugins/Tmdb/Configuration/config.html | 41 |
2 files changed, 81 insertions, 1 deletions
diff --git a/MediaBrowser.Providers/Plugins/Tmdb/Configuration/PluginConfiguration.cs b/MediaBrowser.Providers/Plugins/Tmdb/Configuration/PluginConfiguration.cs index 9a78a7536..b043da76c 100644 --- a/MediaBrowser.Providers/Plugins/Tmdb/Configuration/PluginConfiguration.cs +++ b/MediaBrowser.Providers/Plugins/Tmdb/Configuration/PluginConfiguration.cs @@ -1,3 +1,4 @@ +using System.Collections.Generic; using MediaBrowser.Model.Plugins; namespace MediaBrowser.Providers.Plugins.Tmdb @@ -26,5 +27,45 @@ namespace MediaBrowser.Providers.Plugins.Tmdb /// Gets or sets a value indicating the maximum number of cast members to fetch for an item. /// </summary> public int MaxCastMembers { get; set; } = 15; + + /// <summary> + /// Gets or sets a value indicating the poster image size to fetch. + /// </summary> + 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 12b4c7ca4..d376df96c 100644 --- a/MediaBrowser.Providers/Plugins/Tmdb/Configuration/config.html +++ b/MediaBrowser.Providers/Plugins/Tmdb/Configuration/config.html @@ -24,7 +24,22 @@ <input is="emby-input" type="number" id="maxCastMembers" pattern="[0-9]*" required min="0" max="1000" label="Max Cast Members" /> <div class="fieldDescription">The maximum number of cast members to fetch for an item.</div> </div> - <br /> + <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> + <div class="selectContainer"> + <select is="emby-select" id="selectBackdropSize" label="Backdrop"></select> + </div> + <div class="selectContainer"> + <select is="emby-select" id="selectProfileSize" label="Profile"></select> + </div> + <div class="selectContainer"> + <select is="emby-select" id="selectStillSize" label="Still"></select> + </div> + </div> <div> <button is="emby-button" type="submit" class="raised button-submit block"><span>Save</span></button> </div> @@ -51,6 +66,26 @@ cancelable: false })); + 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; + + var selBackdropSize = document.querySelector('#selectBackdropSize'); + selBackdropSize.innerHTML = config.BackdropSizeOptions.map(sizeOptionsGenerator); + selBackdropSize.value = config.BackdropSize; + + var selProfileSize = document.querySelector('#selectProfileSize'); + selProfileSize.innerHTML = config.ProfileSizeOptions.map(sizeOptionsGenerator); + selProfileSize.value = config.ProfileSize; + + var selStillSize = document.querySelector('#selectStillSize'); + selStillSize.innerHTML = config.StillSizeOptions.map(sizeOptionsGenerator); + selStillSize.value = config.StillSize; + Dashboard.hideLoadingMsg(); }); }); @@ -65,6 +100,10 @@ config.ExcludeTagsSeries = document.querySelector('#excludeTagsSeries').checked; config.ExcludeTagsMovies = document.querySelector('#excludeTagsMovies').checked; config.MaxCastMembers = document.querySelector('#maxCastMembers').value; + config.PosterSize = document.querySelector('#selectPosterSize').value; + config.BackdropSize = document.querySelector('#selectBackdropSize').value; + config.ProfileSize = document.querySelector('#selectProfileSize').value; + config.StillSize = document.querySelector('#selectStillSize').value; ApiClient.updatePluginConfiguration(PluginConfig.pluginId, config).then(Dashboard.processPluginConfigurationUpdateResult); }); |
