From 3d858955b6efe2f91cc77cfbf90a3679a29e1bbd Mon Sep 17 00:00:00 2001
From: zehner <37537496+zehnerGIT@users.noreply.github.com>
Date: Tue, 2 Nov 2021 15:11:01 +0100
Subject: Make tags import from TMDB configurable
new settings added
---
.../Plugins/Tmdb/Configuration/PluginConfiguration.cs | 10 ++++++++++
1 file changed, 10 insertions(+)
(limited to 'MediaBrowser.Providers/Plugins/Tmdb/Configuration/PluginConfiguration.cs')
diff --git a/MediaBrowser.Providers/Plugins/Tmdb/Configuration/PluginConfiguration.cs b/MediaBrowser.Providers/Plugins/Tmdb/Configuration/PluginConfiguration.cs
index 907f0160d..9ac95f23e 100644
--- a/MediaBrowser.Providers/Plugins/Tmdb/Configuration/PluginConfiguration.cs
+++ b/MediaBrowser.Providers/Plugins/Tmdb/Configuration/PluginConfiguration.cs
@@ -11,5 +11,15 @@ namespace MediaBrowser.Providers.Plugins.Tmdb
/// Gets or sets a value indicating whether include adult content when searching with TMDb.
///
public bool IncludeAdult { get; set; }
+
+ ///
+ /// Gets or sets a value indicating whether tags should be imported for series from TMDb.
+ ///
+ public bool ExcludeTagsSeries { get; set; }
+
+ ///
+ /// Gets or sets a value indicating whether tags should be imported for movies from TMDb.
+ ///
+ public bool ExcludeTagsMovies { get; set; }
}
}
--
cgit v1.2.3
From c8eba90c178821e11a4b9cdfc7f722bc8af8aac1 Mon Sep 17 00:00:00 2001
From: Joe Rogers <1337joe@gmail.com>
Date: Fri, 5 Nov 2021 00:38:50 +0100
Subject: Add cast limit to tmdb plugin settings
---
.../Plugins/Tmdb/Configuration/PluginConfiguration.cs | 5 +++++
.../Plugins/Tmdb/Configuration/config.html | 13 +++++++++++++
.../Plugins/Tmdb/Movies/TmdbMovieProvider.cs | 3 +--
.../Plugins/Tmdb/TV/TmdbEpisodeProvider.cs | 4 ++--
.../Plugins/Tmdb/TV/TmdbSeasonProvider.cs | 2 +-
.../Plugins/Tmdb/TV/TmdbSeriesProvider.cs | 2 +-
MediaBrowser.Providers/Plugins/Tmdb/TmdbUtils.cs | 5 -----
7 files changed, 23 insertions(+), 11 deletions(-)
(limited to 'MediaBrowser.Providers/Plugins/Tmdb/Configuration/PluginConfiguration.cs')
diff --git a/MediaBrowser.Providers/Plugins/Tmdb/Configuration/PluginConfiguration.cs b/MediaBrowser.Providers/Plugins/Tmdb/Configuration/PluginConfiguration.cs
index 9ac95f23e..9a78a7536 100644
--- a/MediaBrowser.Providers/Plugins/Tmdb/Configuration/PluginConfiguration.cs
+++ b/MediaBrowser.Providers/Plugins/Tmdb/Configuration/PluginConfiguration.cs
@@ -21,5 +21,10 @@ namespace MediaBrowser.Providers.Plugins.Tmdb
/// Gets or sets a value indicating whether tags should be imported for movies from TMDb.
///
public bool ExcludeTagsMovies { get; set; }
+
+ ///
+ /// Gets or sets a value indicating the maximum number of cast members to fetch for an item.
+ ///
+ public int MaxCastMembers { get; set; } = 15;
}
}
diff --git a/MediaBrowser.Providers/Plugins/Tmdb/Configuration/config.html b/MediaBrowser.Providers/Plugins/Tmdb/Configuration/config.html
index 95d6691d9..12b4c7ca4 100644
--- a/MediaBrowser.Providers/Plugins/Tmdb/Configuration/config.html
+++ b/MediaBrowser.Providers/Plugins/Tmdb/Configuration/config.html
@@ -20,6 +20,10 @@
Exclude tags/keywords from metadata fetched for movies.
+
+
+
The maximum number of cast members to fetch for an item.
+
@@ -39,6 +43,14 @@
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
+ }));
+
Dashboard.hideLoadingMsg();
});
});
@@ -52,6 +64,7 @@
config.IncludeAdult = document.querySelector('#includeAdult').checked;
config.ExcludeTagsSeries = document.querySelector('#excludeTagsSeries').checked;
config.ExcludeTagsMovies = document.querySelector('#excludeTagsMovies').checked;
+ config.MaxCastMembers = document.querySelector('#maxCastMembers').value;
ApiClient.updatePluginConfiguration(PluginConfig.pluginId, config).then(Dashboard.processPluginConfigurationUpdateResult);
});
diff --git a/MediaBrowser.Providers/Plugins/Tmdb/Movies/TmdbMovieProvider.cs b/MediaBrowser.Providers/Plugins/Tmdb/Movies/TmdbMovieProvider.cs
index 9dd067856..fcaacc90d 100644
--- a/MediaBrowser.Providers/Plugins/Tmdb/Movies/TmdbMovieProvider.cs
+++ b/MediaBrowser.Providers/Plugins/Tmdb/Movies/TmdbMovieProvider.cs
@@ -241,8 +241,7 @@ namespace MediaBrowser.Providers.Plugins.Tmdb.Movies
if (movieResult.Credits?.Cast != null)
{
- // TODO configurable
- foreach (var actor in movieResult.Credits.Cast.OrderBy(a => a.Order).Take(TmdbUtils.MaxCastMembers))
+ foreach (var actor in movieResult.Credits.Cast.OrderBy(a => a.Order).Take(Plugin.Instance.Configuration.MaxCastMembers))
{
var personInfo = new PersonInfo
{
diff --git a/MediaBrowser.Providers/Plugins/Tmdb/TV/TmdbEpisodeProvider.cs b/MediaBrowser.Providers/Plugins/Tmdb/TV/TmdbEpisodeProvider.cs
index 3f826843a..8ac9d0cab 100644
--- a/MediaBrowser.Providers/Plugins/Tmdb/TV/TmdbEpisodeProvider.cs
+++ b/MediaBrowser.Providers/Plugins/Tmdb/TV/TmdbEpisodeProvider.cs
@@ -154,7 +154,7 @@ namespace MediaBrowser.Providers.Plugins.Tmdb.TV
if (credits?.Cast != null)
{
- foreach (var actor in credits.Cast.OrderBy(a => a.Order).Take(TmdbUtils.MaxCastMembers))
+ foreach (var actor in credits.Cast.OrderBy(a => a.Order).Take(Plugin.Instance.Configuration.MaxCastMembers))
{
metadataResult.AddPerson(new PersonInfo
{
@@ -168,7 +168,7 @@ namespace MediaBrowser.Providers.Plugins.Tmdb.TV
if (credits?.GuestStars != null)
{
- foreach (var guest in credits.GuestStars.OrderBy(a => a.Order).Take(TmdbUtils.MaxCastMembers))
+ foreach (var guest in credits.GuestStars.OrderBy(a => a.Order).Take(Plugin.Instance.Configuration.MaxCastMembers))
{
metadataResult.AddPerson(new PersonInfo
{
diff --git a/MediaBrowser.Providers/Plugins/Tmdb/TV/TmdbSeasonProvider.cs b/MediaBrowser.Providers/Plugins/Tmdb/TV/TmdbSeasonProvider.cs
index 4ac889680..7afaddc24 100644
--- a/MediaBrowser.Providers/Plugins/Tmdb/TV/TmdbSeasonProvider.cs
+++ b/MediaBrowser.Providers/Plugins/Tmdb/TV/TmdbSeasonProvider.cs
@@ -67,7 +67,7 @@ namespace MediaBrowser.Providers.Plugins.Tmdb.TV
var credits = seasonResult.Credits;
if (credits?.Cast != null)
{
- var cast = credits.Cast.OrderBy(c => c.Order).Take(TmdbUtils.MaxCastMembers).ToList();
+ var cast = credits.Cast.OrderBy(c => c.Order).Take(Plugin.Instance.Configuration.MaxCastMembers).ToList();
for (var i = 0; i < cast.Count; i++)
{
result.AddPerson(new PersonInfo
diff --git a/MediaBrowser.Providers/Plugins/Tmdb/TV/TmdbSeriesProvider.cs b/MediaBrowser.Providers/Plugins/Tmdb/TV/TmdbSeriesProvider.cs
index feda15cf7..77e22ffbf 100644
--- a/MediaBrowser.Providers/Plugins/Tmdb/TV/TmdbSeriesProvider.cs
+++ b/MediaBrowser.Providers/Plugins/Tmdb/TV/TmdbSeriesProvider.cs
@@ -331,7 +331,7 @@ namespace MediaBrowser.Providers.Plugins.Tmdb.TV
{
if (seriesResult.Credits?.Cast != null)
{
- foreach (var actor in seriesResult.Credits.Cast.OrderBy(a => a.Order).Take(TmdbUtils.MaxCastMembers))
+ foreach (var actor in seriesResult.Credits.Cast.OrderBy(a => a.Order).Take(Plugin.Instance.Configuration.MaxCastMembers))
{
var personInfo = new PersonInfo
{
diff --git a/MediaBrowser.Providers/Plugins/Tmdb/TmdbUtils.cs b/MediaBrowser.Providers/Plugins/Tmdb/TmdbUtils.cs
index 58ab9f547..a3a78103e 100644
--- a/MediaBrowser.Providers/Plugins/Tmdb/TmdbUtils.cs
+++ b/MediaBrowser.Providers/Plugins/Tmdb/TmdbUtils.cs
@@ -28,11 +28,6 @@ namespace MediaBrowser.Providers.Plugins.Tmdb
///
public const string ApiKey = "4219e299c89411838049ab0dab19ebd5";
- ///
- /// Maximum number of cast members to pull.
- ///
- public const int MaxCastMembers = 15;
-
///
/// The crew types to keep.
///
--
cgit v1.2.3
From 6d3b1296661a486d511fa12163456f96cfa3fcc7 Mon Sep 17 00:00:00 2001
From: Joe Rogers <1337joe@gmail.com>
Date: Fri, 19 Nov 2021 22:02:26 +0100
Subject: Add image scaling options for tmdb
---
.../Tmdb/Configuration/PluginConfiguration.cs | 41 ++++++++++
.../Plugins/Tmdb/Configuration/config.html | 41 +++++++++-
.../Plugins/Tmdb/TmdbClientManager.cs | 91 +++++++++++++++++++---
3 files changed, 162 insertions(+), 11 deletions(-)
(limited to 'MediaBrowser.Providers/Plugins/Tmdb/Configuration/PluginConfiguration.cs')
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.
///
public int MaxCastMembers { get; set; } = 15;
+
+ ///
+ /// Gets or sets a value indicating the poster image size to fetch.
+ ///
+ public string? PosterSize { get; set; }
+
+ ///
+ /// Gets or sets the available options for poster size.
+ ///
+ public List PosterSizeOptions { get; set; } = new List();
+
+ ///
+ /// Gets or sets a value indicating the backdrop image size to fetch.
+ ///
+ public string? BackdropSize { get; set; }
+
+ ///
+ /// Gets or sets the available options for backdrop size.
+ ///
+ public List BackdropSizeOptions { get; set; } = new List();
+
+ ///
+ /// Gets or sets a value indicating the profile image size to fetch.
+ ///
+ public string? ProfileSize { get; set; }
+
+ ///
+ /// Gets or sets the available options for profile size.
+ ///
+ public List ProfileSizeOptions { get; set; } = new List();
+
+ ///
+ /// Gets or sets a value indicating the still image size to fetch.
+ ///
+ public string? StillSize { get; set; }
+
+ ///
+ /// Gets or sets the available options for still size.
+ ///
+ public List StillSizeOptions { get; set; } = new List();
}
}
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 @@
The maximum number of cast members to fetch for an item.
-
+
+
Image Scaling
+
If size options are not populated then refresh metadata for any item from TMDb and reload this page.
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -51,6 +66,26 @@
cancelable: false
}));
+ var sizeOptionsGenerator = function (size) {
+ return '';
+ }
+
+ 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);
});
diff --git a/MediaBrowser.Providers/Plugins/Tmdb/TmdbClientManager.cs b/MediaBrowser.Providers/Plugins/Tmdb/TmdbClientManager.cs
index cb644c8ca..c082a6cc4 100644
--- a/MediaBrowser.Providers/Plugins/Tmdb/TmdbClientManager.cs
+++ b/MediaBrowser.Providers/Plugins/Tmdb/TmdbClientManager.cs
@@ -3,6 +3,7 @@
using System;
using System.Collections.Generic;
using System.Globalization;
+using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Tasks;
using MediaBrowser.Model.Dto;
@@ -508,7 +509,7 @@ namespace MediaBrowser.Providers.Plugins.Tmdb
/// The absolute URL.
public string GetPosterUrl(string posterPath)
{
- return GetUrl(_tmDbClient.Config.Images.PosterSizes[^1], posterPath);
+ return GetUrl(Plugin.Instance.Configuration.PosterSize, posterPath);
}
///
@@ -518,7 +519,7 @@ namespace MediaBrowser.Providers.Plugins.Tmdb
/// The absolute URL.
public string GetProfileUrl(string actorProfilePath)
{
- return GetUrl(_tmDbClient.Config.Images.ProfileSizes[^1], actorProfilePath);
+ return GetUrl(Plugin.Instance.Configuration.ProfileSize, actorProfilePath);
}
///
@@ -529,7 +530,7 @@ namespace MediaBrowser.Providers.Plugins.Tmdb
/// The collection to add the remote images into.
public void ConvertPostersToRemoteImageInfo(List images, string requestLanguage, List results)
{
- ConvertToRemoteImageInfo(images, _tmDbClient.Config.Images.PosterSizes[^1], ImageType.Primary, requestLanguage, results);
+ ConvertToRemoteImageInfo(images, Plugin.Instance.Configuration.PosterSize, ImageType.Primary, requestLanguage, results);
}
///
@@ -540,7 +541,7 @@ namespace MediaBrowser.Providers.Plugins.Tmdb
/// The collection to add the remote images into.
public void ConvertBackdropsToRemoteImageInfo(List images, string requestLanguage, List results)
{
- ConvertToRemoteImageInfo(images, _tmDbClient.Config.Images.BackdropSizes[^1], ImageType.Backdrop, requestLanguage, results);
+ ConvertToRemoteImageInfo(images, Plugin.Instance.Configuration.BackdropSize, ImageType.Backdrop, requestLanguage, results);
}
///
@@ -551,7 +552,7 @@ namespace MediaBrowser.Providers.Plugins.Tmdb
/// The collection to add the remote images into.
public void ConvertProfilesToRemoteImageInfo(List images, string requestLanguage, List results)
{
- ConvertToRemoteImageInfo(images, _tmDbClient.Config.Images.ProfileSizes[^1], ImageType.Primary, requestLanguage, results);
+ ConvertToRemoteImageInfo(images, Plugin.Instance.Configuration.ProfileSize, ImageType.Primary, requestLanguage, results);
}
///
@@ -562,7 +563,7 @@ namespace MediaBrowser.Providers.Plugins.Tmdb
/// The collection to add the remote images into.
public void ConvertStillsToRemoteImageInfo(List images, string requestLanguage, List results)
{
- ConvertToRemoteImageInfo(images, _tmDbClient.Config.Images.StillSizes[^1], ImageType.Primary, requestLanguage, results);
+ ConvertToRemoteImageInfo(images, Plugin.Instance.Configuration.StillSize, ImageType.Primary, requestLanguage, results);
}
///
@@ -575,16 +576,51 @@ namespace MediaBrowser.Providers.Plugins.Tmdb
/// The collection to add the remote images into.
private void ConvertToRemoteImageInfo(List images, string size, ImageType type, string requestLanguage, List results)
{
+ int? targetHeight = null;
+ int? targetWidth = null;
+ var match = Regex.Match(size, @"(?[hw])(?[0-9]+)");
+ if (match.Success)
+ {
+ var targetSize = int.Parse(match.Groups["size"].Value, NumberStyles.Integer, CultureInfo.InvariantCulture);
+ if (string.Equals(match.Groups["dimension"].Value, "h", StringComparison.OrdinalIgnoreCase))
+ {
+ targetHeight = targetSize;
+ }
+ else
+ {
+ targetWidth = targetSize;
+ }
+ }
+
for (var i = 0; i < images.Count; i++)
{
var image = images[i];
+
+ int width;
+ int height;
+ if (targetHeight.HasValue)
+ {
+ width = (int)Math.Round((double)targetHeight.Value / image.Height * image.Width);
+ height = targetHeight.Value;
+ }
+ else if (targetWidth.HasValue)
+ {
+ height = (int)Math.Round((double)targetWidth.Value / image.Width * image.Height);
+ width = targetWidth.Value;
+ }
+ else
+ {
+ width = image.Width;
+ height = image.Height;
+ }
+
results.Add(new RemoteImageInfo
{
Url = GetUrl(size, image.FilePath),
CommunityRating = image.VoteAverage,
VoteCount = image.VoteCount,
- Width = image.Width,
- Height = image.Height,
+ Width = width,
+ Height = height,
Language = TmdbUtils.AdjustImageLanguage(image.Iso_639_1, requestLanguage),
ProviderName = TmdbUtils.ProviderName,
Type = type,
@@ -593,9 +629,44 @@ namespace MediaBrowser.Providers.Plugins.Tmdb
}
}
- private Task EnsureClientConfigAsync()
+ private async Task EnsureClientConfigAsync()
{
- return !_tmDbClient.HasConfig ? _tmDbClient.GetConfigAsync() : Task.CompletedTask;
+ if (!_tmDbClient.HasConfig)
+ {
+ var config = await _tmDbClient.GetConfigAsync().ConfigureAwait(false);
+ ValidatePreferences(config);
+ }
+ }
+
+ private static void ValidatePreferences(TMDbConfig config)
+ {
+ var imageConfig = config.Images;
+
+ var pluginConfig = Plugin.Instance.Configuration;
+
+ pluginConfig.PosterSizeOptions = imageConfig.PosterSizes;
+ if (!pluginConfig.PosterSizeOptions.Contains(pluginConfig.PosterSize))
+ {
+ pluginConfig.PosterSize = pluginConfig.PosterSizeOptions[^1];
+ }
+
+ pluginConfig.BackdropSizeOptions = imageConfig.BackdropSizes;
+ if (!pluginConfig.BackdropSizeOptions.Contains(pluginConfig.BackdropSize))
+ {
+ pluginConfig.BackdropSize = pluginConfig.BackdropSizeOptions[^1];
+ }
+
+ pluginConfig.ProfileSizeOptions = imageConfig.ProfileSizes;
+ if (!pluginConfig.ProfileSizeOptions.Contains(pluginConfig.ProfileSize))
+ {
+ pluginConfig.ProfileSize = pluginConfig.ProfileSizeOptions[^1];
+ }
+
+ pluginConfig.StillSizeOptions = imageConfig.StillSizes;
+ if (!pluginConfig.StillSizeOptions.Contains(pluginConfig.StillSize))
+ {
+ pluginConfig.StillSize = pluginConfig.StillSizeOptions[^1];
+ }
}
///
--
cgit v1.2.3
From 0af5e600946231df73f1783330ad8cd0bbbed2ee Mon Sep 17 00:00:00 2001
From: Joe Rogers <1337joe@gmail.com>
Date: Mon, 22 Nov 2021 21:08:07 +0100
Subject: Address review comments
Store null instead of calculating scaled image sizes.
Add endpoint to provide TMDb image size options.
---
.../Plugins/Tmdb/Api/TmdbController.cs | 41 +++++++++++++
.../Tmdb/Configuration/PluginConfiguration.cs | 21 -------
.../Plugins/Tmdb/Configuration/config.html | 59 ++++++++++++------
.../Plugins/Tmdb/TmdbClientManager.cs | 71 +++++++---------------
4 files changed, 104 insertions(+), 88 deletions(-)
create mode 100644 MediaBrowser.Providers/Plugins/Tmdb/Api/TmdbController.cs
(limited to 'MediaBrowser.Providers/Plugins/Tmdb/Configuration/PluginConfiguration.cs')
diff --git a/MediaBrowser.Providers/Plugins/Tmdb/Api/TmdbController.cs b/MediaBrowser.Providers/Plugins/Tmdb/Api/TmdbController.cs
new file mode 100644
index 000000000..0bab7c3ca
--- /dev/null
+++ b/MediaBrowser.Providers/Plugins/Tmdb/Api/TmdbController.cs
@@ -0,0 +1,41 @@
+using System.Net.Mime;
+using System.Threading.Tasks;
+using Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
+using TMDbLib.Objects.General;
+
+namespace MediaBrowser.Providers.Plugins.Tmdb.Api
+{
+ ///
+ /// The TMDb api controller.
+ ///
+ [ApiController]
+ [Authorize(Policy = "DefaultAuthorization")]
+ [Route("[controller]")]
+ [Produces(MediaTypeNames.Application.Json)]
+ public class TmdbController : ControllerBase
+ {
+ private readonly TmdbClientManager _tmdbClientManager;
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The TMDb client manager.
+ public TmdbController(TmdbClientManager tmdbClientManager)
+ {
+ _tmdbClientManager = tmdbClientManager;
+ }
+
+ ///
+ /// Gets the TMDb image configuration options.
+ ///
+ /// The image portion of the TMDb client configuration.
+ [HttpGet("ClientConfiguration")]
+ [ProducesResponseType(StatusCodes.Status200OK)]
+ public async Task TmdbClientConfiguration()
+ {
+ return (await _tmdbClientManager.GetClientConfiguration().ConfigureAwait(false)).Images;
+ }
+ }
+}
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
@@ -33,39 +32,19 @@ namespace MediaBrowser.Providers.Plugins.Tmdb
///
public string? PosterSize { get; set; }
- ///
- /// Gets or sets the available options for poster size.
- ///
- public List PosterSizeOptions { get; set; } = new List();
-
///
/// Gets or sets a value indicating the backdrop image size to fetch.
///
public string? BackdropSize { get; set; }
- ///
- /// Gets or sets the available options for backdrop size.
- ///
- public List BackdropSizeOptions { get; set; } = new List();
-
///
/// Gets or sets a value indicating the profile image size to fetch.
///
public string? ProfileSize { get; set; }
- ///
- /// Gets or sets the available options for profile size.
- ///
- public List ProfileSizeOptions { get; set; } = new List();
-
///
/// Gets or sets a value indicating the still image size to fetch.
///
public string? StillSize { get; set; }
-
- ///
- /// Gets or sets the available options for still size.
- ///
- public List StillSizeOptions { get; set; } = new List();
}
}
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 @@
Image Scaling
-
If size options are not populated then refresh metadata for any item from TMDb and reload this page.