Reject m2ts (bluray) raw releases from BTN as well.

This commit is contained in:
Taloth Saldono 2016-08-05 22:18:33 +02:00
parent 2b1c97ffa4
commit e2272dcca3
4 changed files with 20 additions and 5 deletions

View File

@ -18,7 +18,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
{
[TestFixture]
public class DvdSpecificationFixture : CoreTest<DvdSpecification>
public class RawDiskSpecificationFixture : CoreTest<RawDiskSpecification>
{
private RemoteEpisode _remoteEpisode;
@ -63,6 +63,13 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
Subject.IsSatisfiedBy(_remoteEpisode, null).Accepted.Should().BeFalse();
}
[Test]
public void should_return_false_if_m2ts()
{
WithContainer("M2TS");
Subject.IsSatisfiedBy(_remoteEpisode, null).Accepted.Should().BeFalse();
}
[Test]
public void should_compare_case_insensitive()
{

View File

@ -156,7 +156,7 @@
<Compile Include="DecisionEngineTests\RssSync\ProperSpecificationFixture.cs" />
<Compile Include="DecisionEngineTests\Search\SeriesSpecificationFixture.cs" />
<Compile Include="DecisionEngineTests\SameEpisodesSpecificationFixture.cs" />
<Compile Include="DecisionEngineTests\DvdSpecificationFixture.cs" />
<Compile Include="DecisionEngineTests\RawDiskSpecificationFixture.cs" />
<Compile Include="DecisionEngineTests\UpgradeDiskSpecificationFixture.cs" />
<Compile Include="Download\CompletedDownloadServiceFixture.cs" />
<Compile Include="Download\DownloadApprovedReportsTests\DownloadApprovedFixture.cs" />

View File

@ -6,13 +6,15 @@ using NzbDrone.Core.Parser.Model;
namespace NzbDrone.Core.DecisionEngine.Specifications
{
public class DvdSpecification : IDecisionEngineSpecification
public class RawDiskSpecification : IDecisionEngineSpecification
{
private static readonly string[] _dvdContainerTypes = new[] { "vob", "iso" };
private static readonly string[] _blurayContainerTypes = new[] { "m2ts" };
private readonly Logger _logger;
public DvdSpecification(Logger logger)
public RawDiskSpecification(Logger logger)
{
_logger = logger;
}
@ -32,6 +34,12 @@ namespace NzbDrone.Core.DecisionEngine.Specifications
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");
}
return Decision.Accept();
}
}

View File

@ -331,7 +331,7 @@
<Compile Include="DecisionEngine\Specifications\Search\SingleEpisodeSearchMatchSpecification.cs" />
<Compile Include="DecisionEngine\Specifications\Search\TorrentSeedingSpecification.cs" />
<Compile Include="DecisionEngine\Specifications\SameEpisodesGrabSpecification.cs" />
<Compile Include="DecisionEngine\Specifications\DvdSpecification.cs" />
<Compile Include="DecisionEngine\Specifications\RawDiskSpecification.cs" />
<Compile Include="DecisionEngine\Specifications\UpgradeDiskSpecification.cs" />
<Compile Include="DiskSpace\DiskSpace.cs" />
<Compile Include="DiskSpace\DiskSpaceService.cs" />