diff options
| author | Cody Robibero <cody@robibe.ro> | 2021-12-24 02:41:50 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-12-24 02:41:50 +0000 |
| commit | 634ce40c2facfbfaf6454ad8d3a7f2aca4723b46 (patch) | |
| tree | cf2f3c660f4dfbd8ea19614a10fc1cc0052d55de /MediaBrowser.Providers/Plugins/Tmdb/Api/TmdbController.cs | |
| parent | 6648b7d7dabeaa84835fc7a8a7a2a468a00cad5c (diff) | |
| parent | b5459f49d32d0fce3944f816915fb7380fd84681 (diff) | |
Merge branch 'master' into comparisons
Diffstat (limited to 'MediaBrowser.Providers/Plugins/Tmdb/Api/TmdbController.cs')
| -rw-r--r-- | MediaBrowser.Providers/Plugins/Tmdb/Api/TmdbController.cs | 41 |
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; + } + } +} |
