You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
recyclarr/src/Recyclarr.TrashLib/Services/ReleaseProfile/Api/Mappings/SonarrApiObjectMappingProfi...

25 lines
952 B

using AutoMapper;
using JetBrains.Annotations;
using Recyclarr.TrashLib.Services.ReleaseProfile.Api.Objects;
namespace Recyclarr.TrashLib.Services.ReleaseProfile.Api.Mappings;
[UsedImplicitly]
public class SonarrApiObjectMappingProfile : Profile
{
public SonarrApiObjectMappingProfile()
{
CreateMap<SonarrReleaseProfileV1, SonarrReleaseProfile>()
.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<SonarrReleaseProfile, SonarrReleaseProfileV1>()
.ForMember(d => d.Ignored, x => x.MapFrom(
s => string.Join(',', s.Ignored)))
.ForMember(d => d.Required, x => x.MapFrom(
s => string.Join(',', s.Required)));
}
}