using System; using System.Collections.Generic; using System.Linq; using NzbDrone.Core.Languages; using Radarr.Http; namespace Radarr.Api.V2.Profiles.Languages { public class LanguageModule : RadarrRestModule { public LanguageModule() { GetResourceAll = GetAll; GetResourceById = GetById; } private LanguageResource GetById(int id) { var language = (Language)id; return new LanguageResource { Id = (int)language, Name = language.ToString() }; } private List GetAll() { return Language.All.Select(l => new LanguageResource { Id = (int)l, Name = l.ToString() }) .OrderBy(l => l.Name) .ToList(); } } }