using System.Collections.Generic; using NzbDrone.Core.ImportLists; namespace Lidarr.Api.V1.ImportLists { public class ImportListBulkResource : ProviderBulkResource { public bool? EnableAutomaticAdd { get; set; } public string RootFolderPath { get; set; } public int? QualityProfileId { get; set; } } public class ImportListBulkResourceMapper : ProviderBulkResourceMapper { public override List UpdateModel(ImportListBulkResource resource, List existingDefinitions) { if (resource == null) { return new List(); } existingDefinitions.ForEach(existing => { existing.EnableAutomaticAdd = resource.EnableAutomaticAdd ?? existing.EnableAutomaticAdd; existing.RootFolderPath = resource.RootFolderPath ?? existing.RootFolderPath; existing.ProfileId = resource.QualityProfileId ?? existing.ProfileId; }); return existingDefinitions; } } }