diff --git a/src/NzbDrone.Core/Profiles/Metadata/MetadataProfile.cs b/src/NzbDrone.Core/Profiles/Metadata/MetadataProfile.cs index 2c5fb0537..9a9766934 100644 --- a/src/NzbDrone.Core/Profiles/Metadata/MetadataProfile.cs +++ b/src/NzbDrone.Core/Profiles/Metadata/MetadataProfile.cs @@ -1,3 +1,4 @@ +using System.Collections.Generic; using NzbDrone.Core.Datastore; namespace NzbDrone.Core.Profiles.Metadata @@ -12,6 +13,11 @@ namespace NzbDrone.Core.Profiles.Metadata public bool SkipSeriesSecondary { get; set; } public string AllowedLanguages { get; set; } public int MinPages { get; set; } - public string Ignored { get; set; } + public List Ignored { get; set; } + + public MetadataProfile() + { + Ignored = new List(); + } } } diff --git a/src/NzbDrone.Core/Profiles/Metadata/MetadataProfileService.cs b/src/NzbDrone.Core/Profiles/Metadata/MetadataProfileService.cs index a4254b86b..389381946 100644 --- a/src/NzbDrone.Core/Profiles/Metadata/MetadataProfileService.cs +++ b/src/NzbDrone.Core/Profiles/Metadata/MetadataProfileService.cs @@ -158,7 +158,7 @@ namespace NzbDrone.Core.Profiles.Metadata FilterByPredicate(hash, x => x.ForeignBookId, localHash, profile, (x, p) => !p.SkipMissingDate || x.ReleaseDate.HasValue, "release date is missing"); FilterByPredicate(hash, x => x.ForeignBookId, localHash, profile, (x, p) => !p.SkipPartsAndSets || !IsPartOrSet(x, seriesLinks.GetValueOrDefault(x), titles), "book is part of set"); FilterByPredicate(hash, x => x.ForeignBookId, localHash, profile, (x, p) => !p.SkipSeriesSecondary || !seriesLinks.ContainsKey(x) || seriesLinks[x].Any(y => y.IsPrimary), "book is a secondary series item"); - FilterByPredicate(hash, x => x.ForeignBookId, localHash, profile, (x, p) => !MatchesTerms(x.Title, p.Ignored), "contains ignored terms"); + FilterByPredicate(hash, x => x.ForeignBookId, localHash, profile, (x, p) => !p.Ignored.Any(i => MatchesTerms(x.Title, i)), "contains ignored terms"); foreach (var book in hash) { @@ -184,7 +184,7 @@ namespace NzbDrone.Core.Profiles.Metadata FilterByPredicate(hash, x => x.ForeignEditionId, localHash, profile, (x, p) => !allowedLanguages.Any() || allowedLanguages.Contains(x.Language?.CanonicalizeLanguage()), "edition language not allowed"); FilterByPredicate(hash, x => x.ForeignEditionId, localHash, profile, (x, p) => !p.SkipMissingIsbn || x.Isbn13.IsNotNullOrWhiteSpace() || x.Asin.IsNotNullOrWhiteSpace(), "isbn and asin is missing"); - FilterByPredicate(hash, x => x.ForeignEditionId, localHash, profile, (x, p) => !MatchesTerms(x.Title, p.Ignored), "contains ignored terms"); + FilterByPredicate(hash, x => x.ForeignEditionId, localHash, profile, (x, p) => !p.Ignored.Any(i => MatchesTerms(x.Title, i)), "contains ignored terms"); return hash.ToList(); } diff --git a/src/Readarr.Api.V1/Profiles/Metadata/MetadataProfileResource.cs b/src/Readarr.Api.V1/Profiles/Metadata/MetadataProfileResource.cs index a5864391e..366d5fa9d 100644 --- a/src/Readarr.Api.V1/Profiles/Metadata/MetadataProfileResource.cs +++ b/src/Readarr.Api.V1/Profiles/Metadata/MetadataProfileResource.cs @@ -15,7 +15,7 @@ namespace Readarr.Api.V1.Profiles.Metadata public bool SkipSeriesSecondary { get; set; } public string AllowedLanguages { get; set; } public int MinPages { get; set; } - public string Ignored { get; set; } + public List Ignored { get; set; } } public static class MetadataProfileResourceMapper