mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-19 21:13:28 -07:00
New: Use ASP.NET Core instead of Nancy
This commit is contained in:
parent
fe956f340c
commit
c247d07e84
161 changed files with 2893 additions and 3665 deletions
|
@ -0,0 +1,48 @@
|
|||
using System.Linq;
|
||||
using Lidarr.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using NzbDrone.Core.Profiles.Metadata;
|
||||
|
||||
namespace Lidarr.Api.V1.Profiles.Metadata
|
||||
{
|
||||
[V1ApiController("metadataprofile/schema")]
|
||||
public class MetadataProfileSchemaController : Controller
|
||||
{
|
||||
[HttpGet]
|
||||
public MetadataProfileResource GetAll()
|
||||
{
|
||||
var orderedPrimTypes = NzbDrone.Core.Music.PrimaryAlbumType.All
|
||||
.OrderByDescending(l => l.Id)
|
||||
.ToList();
|
||||
|
||||
var orderedSecTypes = NzbDrone.Core.Music.SecondaryAlbumType.All
|
||||
.OrderByDescending(l => l.Id)
|
||||
.ToList();
|
||||
|
||||
var orderedRelStatuses = NzbDrone.Core.Music.ReleaseStatus.All
|
||||
.OrderByDescending(l => l.Id)
|
||||
.ToList();
|
||||
|
||||
var primTypes = orderedPrimTypes
|
||||
.Select(v => new ProfilePrimaryAlbumTypeItem { PrimaryAlbumType = v, Allowed = false })
|
||||
.ToList();
|
||||
|
||||
var secTypes = orderedSecTypes
|
||||
.Select(v => new ProfileSecondaryAlbumTypeItem { SecondaryAlbumType = v, Allowed = false })
|
||||
.ToList();
|
||||
|
||||
var relStatuses = orderedRelStatuses
|
||||
.Select(v => new ProfileReleaseStatusItem { ReleaseStatus = v, Allowed = false })
|
||||
.ToList();
|
||||
|
||||
var profile = new MetadataProfile
|
||||
{
|
||||
PrimaryAlbumTypes = primTypes,
|
||||
SecondaryAlbumTypes = secTypes,
|
||||
ReleaseStatuses = relStatuses
|
||||
};
|
||||
|
||||
return profile.ToResource();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue