| | 1 | | using System.Net.Mime; |
| | 2 | | using System.Threading.Tasks; |
| | 3 | | using Microsoft.AspNetCore.Authorization; |
| | 4 | | using Microsoft.AspNetCore.Http; |
| | 5 | | using Microsoft.AspNetCore.Mvc; |
| | 6 | | using TMDbLib.Objects.General; |
| | 7 | |
|
| | 8 | | namespace MediaBrowser.Providers.Plugins.Tmdb.Api |
| | 9 | | { |
| | 10 | | /// <summary> |
| | 11 | | /// The TMDb API controller. |
| | 12 | | /// </summary> |
| | 13 | | [ApiController] |
| | 14 | | [Authorize] |
| | 15 | | [Route("[controller]")] |
| | 16 | | [Produces(MediaTypeNames.Application.Json)] |
| | 17 | | public class TmdbController : ControllerBase |
| | 18 | | { |
| | 19 | | private readonly TmdbClientManager _tmdbClientManager; |
| | 20 | |
|
| | 21 | | /// <summary> |
| | 22 | | /// Initializes a new instance of the <see cref="TmdbController"/> class. |
| | 23 | | /// </summary> |
| | 24 | | /// <param name="tmdbClientManager">The TMDb client manager.</param> |
| 0 | 25 | | public TmdbController(TmdbClientManager tmdbClientManager) |
| | 26 | | { |
| 0 | 27 | | _tmdbClientManager = tmdbClientManager; |
| 0 | 28 | | } |
| | 29 | |
|
| | 30 | | /// <summary> |
| | 31 | | /// Gets the TMDb image configuration options. |
| | 32 | | /// </summary> |
| | 33 | | /// <returns>The image portion of the TMDb client configuration.</returns> |
| | 34 | | [HttpGet("ClientConfiguration")] |
| | 35 | | [ProducesResponseType(StatusCodes.Status200OK)] |
| | 36 | | public async Task<ConfigImageTypes> TmdbClientConfiguration() |
| | 37 | | { |
| | 38 | | return (await _tmdbClientManager.GetClientConfiguration().ConfigureAwait(false)).Images; |
| | 39 | | } |
| | 40 | | } |
| | 41 | | } |