Implement Release Parsing, Decision Engine, and Downloading (#35)

* Implement Parsing, Decision Engine, and Downloading
This commit is contained in:
Qstick
2017-08-13 22:58:42 -04:00
committed by GitHub
parent 5556989324
commit 1e4d9480e9
191 changed files with 2604 additions and 2755 deletions
@@ -1,4 +1,4 @@
using System.Linq;
using System.Linq;
using NLog;
using NzbDrone.Common.Extensions;
using NzbDrone.Core.IndexerSearch.Definitions;
@@ -8,9 +8,7 @@ namespace NzbDrone.Core.DecisionEngine.Specifications
{
public class RawDiskSpecification : IDecisionEngineSpecification
{
private static readonly string[] _dvdContainerTypes = new[] { "vob", "iso" };
private static readonly string[] _blurayContainerTypes = new[] { "m2ts" };
private static readonly string[] _cdContainerTypes = new[] { "vob", "iso" };
private readonly Logger _logger;
@@ -21,24 +19,18 @@ namespace NzbDrone.Core.DecisionEngine.Specifications
public RejectionType Type => RejectionType.Permanent;
public virtual Decision IsSatisfiedBy(RemoteEpisode subject, SearchCriteriaBase searchCriteria)
public virtual Decision IsSatisfiedBy(RemoteAlbum subject, SearchCriteriaBase searchCriteria)
{
if (subject.Release == null || subject.Release.Container.IsNullOrWhiteSpace())
{
return Decision.Accept();
}
if (_dvdContainerTypes.Contains(subject.Release.Container.ToLower()))
{
_logger.Debug("Release contains raw DVD, rejecting.");
return Decision.Reject("Raw DVD release");
}
if (_blurayContainerTypes.Contains(subject.Release.Container.ToLower()))
{
_logger.Debug("Release contains raw Bluray, rejecting.");
return Decision.Reject("Raw Bluray release");
}
if (_cdContainerTypes.Contains(subject.Release.Container.ToLower()))
{
_logger.Debug("Release contains raw CD, rejecting.");
return Decision.Reject("Raw CD release");
}
return Decision.Accept();
}