diff --git a/src/Recyclarr.Cli/Pipelines/ReleaseProfile/Api/Mappings/SonarrApiObjectMappingProfile.cs b/src/Recyclarr.Cli/Pipelines/ReleaseProfile/Api/Mappings/SonarrApiObjectMappingProfile.cs deleted file mode 100644 index 1853d9d5..00000000 --- a/src/Recyclarr.Cli/Pipelines/ReleaseProfile/Api/Mappings/SonarrApiObjectMappingProfile.cs +++ /dev/null @@ -1,24 +0,0 @@ -using AutoMapper; -using JetBrains.Annotations; -using Recyclarr.Cli.Pipelines.ReleaseProfile.Api.Objects; - -namespace Recyclarr.Cli.Pipelines.ReleaseProfile.Api.Mappings; - -[UsedImplicitly] -public class SonarrApiObjectMappingProfile : Profile -{ - public SonarrApiObjectMappingProfile() - { - CreateMap() - .ForMember(d => d.Ignored, x => x.MapFrom( - s => s.Ignored.Split(',', StringSplitOptions.RemoveEmptyEntries).ToList())) - .ForMember(d => d.Required, x => x.MapFrom( - s => s.Required.Split(',', StringSplitOptions.RemoveEmptyEntries).ToList())); - - CreateMap() - .ForMember(d => d.Ignored, x => x.MapFrom( - s => string.Join(',', s.Ignored))) - .ForMember(d => d.Required, x => x.MapFrom( - s => string.Join(',', s.Required))); - } -} diff --git a/src/Recyclarr.Cli/Pipelines/ReleaseProfile/Api/Objects/SonarrReleaseProfile.cs b/src/Recyclarr.Cli/Pipelines/ReleaseProfile/Api/Objects/SonarrReleaseProfile.cs index 5641325a..6023ea69 100644 --- a/src/Recyclarr.Cli/Pipelines/ReleaseProfile/Api/Objects/SonarrReleaseProfile.cs +++ b/src/Recyclarr.Cli/Pipelines/ReleaseProfile/Api/Objects/SonarrReleaseProfile.cs @@ -19,24 +19,6 @@ public class SonarrPreferredTerm public int Score { get; set; } } -// Retained for supporting versions of Sonarr prior to v3.0.6.1355 -// Offending change is here: -// https://github.com/Sonarr/Sonarr/blob/deed85d2f9147e6180014507ef4f5af3695b0c61/src/NzbDrone.Core/Datastore/Migration/162_release_profile_to_array.cs -// The Ignored and Required JSON properties were converted from string -> array in a backward-breaking way. -[UsedImplicitly(ImplicitUseKindFlags.Assign, ImplicitUseTargetFlags.Members)] -public class SonarrReleaseProfileV1 -{ - public int Id { get; set; } - public bool Enabled { get; set; } - public string Name { get; set; } = ""; - public string Required { get; set; } = ""; - public string Ignored { get; set; } = ""; - public IReadOnlyCollection Preferred { get; set; } = new List(); - public bool IncludePreferredWhenRenaming { get; set; } - public int IndexerId { get; set; } - public IReadOnlyCollection Tags { get; set; } = new List(); -} - [UsedImplicitly(ImplicitUseKindFlags.Assign, ImplicitUseTargetFlags.Members)] public class SonarrReleaseProfile { diff --git a/src/Recyclarr.Cli/Pipelines/ReleaseProfile/Api/Schemas/SonarrReleaseProfileSchema.cs b/src/Recyclarr.Cli/Pipelines/ReleaseProfile/Api/Schemas/SonarrReleaseProfileSchema.cs deleted file mode 100644 index b6fa1004..00000000 --- a/src/Recyclarr.Cli/Pipelines/ReleaseProfile/Api/Schemas/SonarrReleaseProfileSchema.cs +++ /dev/null @@ -1,168 +0,0 @@ -namespace Recyclarr.Cli.Pipelines.ReleaseProfile.Api.Schemas; - -public static class SonarrReleaseProfileSchema -{ - public static string V1 => - """ - { - "definitions": { - "SonarrPreferredTerm": { - "type": [ - "object", - "null" - ], - "properties": { - "key": { - "type": [ - "string", - "null" - ] - }, - "value": { - "type": "integer" - } - } - } - }, - "type": "object", - "properties": { - "id": { - "type": "integer" - }, - "enabled": { - "type": "boolean" - }, - "name": { - "type": [ - "string", - "null" - ] - }, - "required": { - "type": [ - "string", - "null" - ] - }, - "ignored": { - "type": [ - "string", - "null" - ] - }, - "preferred": { - "type": [ - "array", - "null" - ], - "items": { - "$ref": "#/definitions/SonarrPreferredTerm" - } - }, - "includePreferredWhenRenaming": { - "type": "boolean" - }, - "indexerId": { - "type": "integer" - }, - "tags": { - "type": [ - "array", - "null" - ], - "items": { - "type": "integer" - } - } - } - } - """; - - public static string V2 => - """ - { - "definitions": { - "SonarrPreferredTerm": { - "type": [ - "object", - "null" - ], - "properties": { - "key": { - "type": [ - "string", - "null" - ] - }, - "value": { - "type": "integer" - } - } - } - }, - "type": "object", - "properties": { - "id": { - "type": "integer" - }, - "enabled": { - "type": "boolean" - }, - "name": { - "type": [ - "string", - "null" - ] - }, - "required": { - "type": [ - "array", - "null" - ], - "items": { - "type": [ - "string", - "null" - ] - } - }, - "ignored": { - "type": [ - "array", - "null" - ], - "items": { - "type": [ - "string", - "null" - ] - } - }, - "preferred": { - "type": [ - "array", - "null" - ], - "items": { - "$ref": "#/definitions/SonarrPreferredTerm" - } - }, - "includePreferredWhenRenaming": { - "type": "boolean" - }, - "indexerId": { - "type": "integer" - }, - "tags": { - "type": [ - "array", - "null" - ], - "items": { - "type": "integer" - } - } - } - } - """; -}