mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-24 22:35:39 -04:00
64d9457322
Sonarr fa006d85f
33 lines
964 B
C#
33 lines
964 B
C#
using System;
|
|
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();
|
|
}
|
|
|
|
}
|
|
}
|