using System; using AutoMapper; using NzbDrone.Api.Calendar; using NzbDrone.Api.Episodes; using NzbDrone.Api.Missing; using NzbDrone.Api.QualityProfiles; using NzbDrone.Api.QualityType; using NzbDrone.Api.Resolvers; using NzbDrone.Api.Series; using NzbDrone.Core.Qualities; using NzbDrone.Core.Tv; namespace NzbDrone.Api { public static class AutomapperBootstraper { public static void InitializeAutomapper() { //QualityProfiles Mapper.CreateMap() .ForMember(dest => dest.Qualities, opt => opt.ResolveUsing().FromMember(src => src.Allowed)); Mapper.CreateMap() .ForMember(dest => dest.Allowed, opt => opt.ResolveUsing().FromMember(src => src.Qualities)); Mapper.CreateMap() .ForMember(dest => dest.Allowed, opt => opt.Ignore()); //QualitySize Mapper.CreateMap() .ForMember(dest => dest.Id, opt => opt.MapFrom(src => src.QualityId)); Mapper.CreateMap() .ForMember(dest => dest.QualityId, opt => opt.MapFrom(src => src.Id)); //Episode Mapper.CreateMap(); } } }