aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Providers/Plugins/Tmdb/Api/TmdbController.cs
diff options
context:
space:
mode:
authorJonas Resch <jonas.resch@live.de>2021-12-08 09:55:16 +0100
committerJonas Resch <jonas.resch@live.de>2021-12-08 09:55:16 +0100
commit87a6fdf8478cf8daa24dc44a2a3da451be06b950 (patch)
treec5d147e9f05ee5e1c28094236f0a4caa7bab9069 /MediaBrowser.Providers/Plugins/Tmdb/Api/TmdbController.cs
parentca2d94ee97b53a69f4508f4ef5ac72a72d2a3aa5 (diff)
parenta327b43ab7faceadb555890c41f103008fc00737 (diff)
Merge branch 'support-external-audio-files' of github.com:jonas-resch/jellyfin into support-external-audio-files
Diffstat (limited to 'MediaBrowser.Providers/Plugins/Tmdb/Api/TmdbController.cs')
-rw-r--r--MediaBrowser.Providers/Plugins/Tmdb/Api/TmdbController.cs41
1 files changed, 41 insertions, 0 deletions
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
+{
+ /// <summary>
+ /// The TMDb api controller.
+ /// </summary>
+ [ApiController]
+ [Authorize(Policy = "DefaultAuthorization")]
+ [Route("[controller]")]
+ [Produces(MediaTypeNames.Application.Json)]
+ public class TmdbController : ControllerBase
+ {
+ private readonly TmdbClientManager _tmdbClientManager;
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="TmdbController"/> class.
+ /// </summary>
+ /// <param name="tmdbClientManager">The TMDb client manager.</param>
+ public TmdbController(TmdbClientManager tmdbClientManager)
+ {
+ _tmdbClientManager = tmdbClientManager;
+ }
+
+ /// <summary>
+ /// Gets the TMDb image configuration options.
+ /// </summary>
+ /// <returns>The image portion of the TMDb client configuration.</returns>
+ [HttpGet("ClientConfiguration")]
+ [ProducesResponseType(StatusCodes.Status200OK)]
+ public async Task<ConfigImageTypes> TmdbClientConfiguration()
+ {
+ return (await _tmdbClientManager.GetClientConfiguration().ConfigureAwait(false)).Images;
+ }
+ }
+}