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; } } }