You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
925 B
31 lines
925 B
using NLog;
|
|
using NzbDrone.Core.IndexerSearch.Definitions;
|
|
using NzbDrone.Core.Parser.Model;
|
|
|
|
namespace NzbDrone.Core.DecisionEngine.Specifications
|
|
{
|
|
public class NotSampleSpecification : IDecisionEngineSpecification
|
|
{
|
|
private readonly Logger _logger;
|
|
|
|
public SpecificationPriority Priority => SpecificationPriority.Default;
|
|
public RejectionType Type => RejectionType.Permanent;
|
|
|
|
public NotSampleSpecification(Logger logger)
|
|
{
|
|
_logger = logger;
|
|
}
|
|
|
|
public Decision IsSatisfiedBy(RemoteAlbum subject, SearchCriteriaBase searchCriteria)
|
|
{
|
|
if (subject.Release.Title.ToLower().Contains("sample") && subject.Release.Size < 20.Megabytes())
|
|
{
|
|
_logger.Debug("Sample release, rejecting.");
|
|
return Decision.Reject("Sample");
|
|
}
|
|
|
|
return Decision.Accept();
|
|
}
|
|
}
|
|
}
|