mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-26 22:46:37 -04:00
New: Required/Ignored restrictions now support /pattern/ regex
This commit is contained in:
@@ -13,11 +13,13 @@ namespace NzbDrone.Core.DecisionEngine.Specifications
|
||||
{
|
||||
private readonly IRestrictionService _restrictionService;
|
||||
private readonly Logger _logger;
|
||||
private readonly ITermMatcher _termMatcher;
|
||||
|
||||
public ReleaseRestrictionsSpecification(IRestrictionService restrictionService, Logger logger)
|
||||
public ReleaseRestrictionsSpecification(ITermMatcher termMatcher, IRestrictionService restrictionService, Logger logger)
|
||||
{
|
||||
_restrictionService = restrictionService;
|
||||
_logger = logger;
|
||||
_termMatcher = termMatcher;
|
||||
}
|
||||
|
||||
public SpecificationPriority Priority => SpecificationPriority.Default;
|
||||
@@ -63,9 +65,9 @@ namespace NzbDrone.Core.DecisionEngine.Specifications
|
||||
return Decision.Accept();
|
||||
}
|
||||
|
||||
private static List<string> ContainsAny(List<string> terms, string title)
|
||||
private List<string> ContainsAny(List<string> terms, string title)
|
||||
{
|
||||
return terms.Where(t => title.ToLowerInvariant().Contains(t.ToLowerInvariant())).ToList();
|
||||
return terms.Where(t => _termMatcher.IsMatch(t, title)).ToList();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user