using System.Collections.Generic; using NzbDrone.Core.Indexers; namespace Lidarr.Api.V1.Indexers { public class IndexerBulkResource : ProviderBulkResource { public bool? EnableRss { get; set; } public bool? EnableAutomaticSearch { get; set; } public bool? EnableInteractiveSearch { get; set; } public int? Priority { get; set; } } public class IndexerBulkResourceMapper : ProviderBulkResourceMapper { public override List UpdateModel(IndexerBulkResource resource, List existingDefinitions) { if (resource == null) { return new List(); } existingDefinitions.ForEach(existing => { existing.EnableRss = resource.EnableRss ?? existing.EnableRss; existing.EnableAutomaticSearch = resource.EnableAutomaticSearch ?? existing.EnableAutomaticSearch; existing.EnableInteractiveSearch = resource.EnableInteractiveSearch ?? existing.EnableInteractiveSearch; existing.Priority = resource.Priority ?? existing.Priority; }); return existingDefinitions; } } }