mirror of
https://github.com/Radarr/Radarr.git
synced 2026-04-20 21:55:03 -04:00
7977e0be05
Co-authored-by: Mark McDowall <mark@mcdowall.ca>
32 lines
1.0 KiB
C#
32 lines
1.0 KiB
C#
using NLog;
|
|
using NzbDrone.Common.Extensions;
|
|
using NzbDrone.Core.IndexerSearch.Definitions;
|
|
using NzbDrone.Core.Parser.Model;
|
|
|
|
namespace NzbDrone.Core.DecisionEngine.Specifications
|
|
{
|
|
public class NotSampleSpecification : IDownloadDecisionEngineSpecification
|
|
{
|
|
private readonly Logger _logger;
|
|
|
|
public SpecificationPriority Priority => SpecificationPriority.Default;
|
|
public RejectionType Type => RejectionType.Permanent;
|
|
|
|
public NotSampleSpecification(Logger logger)
|
|
{
|
|
_logger = logger;
|
|
}
|
|
|
|
public DownloadSpecDecision IsSatisfiedBy(RemoteMovie subject, SearchCriteriaBase searchCriteria)
|
|
{
|
|
if (subject.Release.Title.ToLower().Contains("sample") && subject.Release.Size < 70.Megabytes())
|
|
{
|
|
_logger.Debug("Sample release, rejecting.");
|
|
return DownloadSpecDecision.Reject(DownloadRejectionReason.Sample, "Sample");
|
|
}
|
|
|
|
return DownloadSpecDecision.Accept();
|
|
}
|
|
}
|
|
}
|