using MediaBrowser.Controller.Localization;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Globalization;
using ServiceStack;
using System.Collections.Generic;
using System.Linq;
namespace MediaBrowser.Api
{
///
/// Class GetCultures
///
[Route("/Localization/Cultures", "GET")]
[Api(Description = "Gets known cultures")]
public class GetCultures : IReturn>
{
}
///
/// Class GetCountries
///
[Route("/Localization/Countries", "GET")]
[Api(Description = "Gets known countries")]
public class GetCountries : IReturn>
{
}
///
/// Class ParentalRatings
///
[Route("/Localization/ParentalRatings", "GET")]
[Api(Description = "Gets known parental ratings")]
public class GetParentalRatings : IReturn>
{
}
///
/// Class CulturesService
///
public class LocalizationService : BaseApiService
{
///
/// The _localization
///
private readonly ILocalizationManager _localization;
///
/// Initializes a new instance of the class.
///
/// The localization.
public LocalizationService(ILocalizationManager localization)
{
_localization = localization;
}
///
/// Gets the specified request.
///
/// The request.
/// System.Object.
public object Get(GetParentalRatings request)
{
var result = _localization.GetParentalRatings().ToList();
return ToOptimizedResult(result);
}
///
/// Gets the specified request.
///
/// The request.
/// System.Object.
public object Get(GetCountries request)
{
var result = _localization.GetCountries().ToList();
return ToOptimizedResult(result);
}
///
/// Gets the specified request.
///
/// The request.
/// System.Object.
public object Get(GetCultures request)
{
var result = _localization.GetCultures().ToList();
return ToOptimizedResult(result);
}
}
}