From 9a50b69e8c98f3cb97684a471a207661bf8f319a Mon Sep 17 00:00:00 2001 From: Qstick Date: Mon, 26 Mar 2018 20:55:49 -0400 Subject: [PATCH] Fixed: Unable to Add/Edit Metadata Profile after Release Status Addition Fixes #260 --- .../Metadata/MetadataProfileSchemaModule.cs | 29 +++++++++++++------ 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/src/Lidarr.Api.V1/Profiles/Metadata/MetadataProfileSchemaModule.cs b/src/Lidarr.Api.V1/Profiles/Metadata/MetadataProfileSchemaModule.cs index 05196fdc5..1e7fb7650 100644 --- a/src/Lidarr.Api.V1/Profiles/Metadata/MetadataProfileSchemaModule.cs +++ b/src/Lidarr.Api.V1/Profiles/Metadata/MetadataProfileSchemaModule.cs @@ -16,23 +16,34 @@ namespace Lidarr.Api.V1.Profiles.Metadata private MetadataProfileResource GetAll() { var orderedPrimTypes = NzbDrone.Core.Music.PrimaryAlbumType.All - .OrderByDescending(l => l.Id) - .ToList(); + .OrderByDescending(l => l.Id) + .ToList(); var orderedSecTypes = NzbDrone.Core.Music.SecondaryAlbumType.All - .OrderByDescending(l => l.Id) - .ToList(); + .OrderByDescending(l => l.Id) + .ToList(); - var primTypes = orderedPrimTypes.Select(v => new ProfilePrimaryAlbumTypeItem {PrimaryAlbumType = v, Allowed = false}) - .ToList(); + var orderedRelStatuses = NzbDrone.Core.Music.ReleaseStatus.All + .OrderByDescending(l => l.Id) + .ToList(); - var secTypes = orderedSecTypes.Select(v => new ProfileSecondaryAlbumTypeItem { SecondaryAlbumType = v, Allowed = false }) - .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 + SecondaryAlbumTypes = secTypes, + ReleaseStatuses = relStatuses }; return profile.ToResource();