using System.Collections.Generic;
using Jellyfin.Api.Constants;
using MediaBrowser.Common.Api;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Globalization;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
namespace Jellyfin.Api.Controllers;
///
/// Localization controller.
///
[Authorize(Policy = Policies.FirstTimeSetupOrDefault)]
public class LocalizationController : BaseJellyfinApiController
{
private readonly ILocalizationManager _localization;
///
/// Initializes a new instance of the class.
///
/// Instance of the interface.
public LocalizationController(ILocalizationManager localization)
{
_localization = localization;
}
///
/// Gets known cultures.
///
/// Known cultures returned.
/// An containing the list of cultures.
[HttpGet("Cultures")]
[ProducesResponseType(StatusCodes.Status200OK)]
public ActionResult> GetCultures()
{
return Ok(_localization.GetCultures());
}
///
/// Gets known countries.
///
/// Known countries returned.
/// An containing the list of countries.
[HttpGet("Countries")]
[ProducesResponseType(StatusCodes.Status200OK)]
public ActionResult> GetCountries()
{
return Ok(_localization.GetCountries());
}
///
/// Gets known parental ratings.
///
/// Known parental ratings returned.
/// An containing the list of parental ratings.
[HttpGet("ParentalRatings")]
[ProducesResponseType(StatusCodes.Status200OK)]
public ActionResult> GetParentalRatings()
{
return Ok(_localization.GetParentalRatings());
}
///
/// Gets localization options.
///
/// Localization options returned.
/// An containing the list of localization options.
[HttpGet("Options")]
[ProducesResponseType(StatusCodes.Status200OK)]
public ActionResult> GetLocalizationOptions()
{
return Ok(_localization.GetLocalizationOptions());
}
}