mirror of
https://github.com/fergalmoran/Readarr.git
synced 2026-02-11 10:26:57 +00:00
Fixed: (MetadataProfile) Allow usage of Must Not Contain
This commit is contained in:
@@ -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<string> Ignored { get; set; }
|
||||
|
||||
public MetadataProfile()
|
||||
{
|
||||
Ignored = new List<string>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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<string> Ignored { get; set; }
|
||||
}
|
||||
|
||||
public static class MetadataProfileResourceMapper
|
||||
|
||||
Reference in New Issue
Block a user