From f9092e95c22aa4a118b6b2b79c115b427a3a9574 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Tue, 6 Aug 2013 20:18:05 -0700 Subject: [PATCH] MonitoredSpec does not apply to searching Fixed an issue where search specs weren't applied --- .../AcceptableSizeSpecificationFixture.cs | 52 ++++++------------- .../DownloadDecisionMakerFixture.cs | 51 ++++++++---------- .../LanguageSpecificationFixture.cs | 4 +- .../MonitoredEpisodeSpecificationFixture.cs | 22 +++----- ...otRestrictedReleaseSpecificationFixture.cs | 6 +-- ...ityAllowedByProfileSpecificationFixture.cs | 4 +- .../RetentionSpecificationFixture.cs | 10 ++-- .../UpgradeDiskSpecificationFixture.cs | 22 ++++---- .../UpgradeHistorySpecificationFixture.cs | 12 ++--- .../DecisionEngine/DownloadDecisionMaker.cs | 13 +---- .../IDecisionEngineSpecification.cs | 3 +- .../AcceptableSizeSpecification.cs | 3 +- .../Specifications/LanguageSpecification.cs | 3 +- .../Specifications/NotInQueueSpecification.cs | 3 +- .../NotRestrictedReleaseSpecification.cs | 3 +- .../QualityAllowedByProfileSpecification.cs | 3 +- .../Specifications/RetentionSpecification.cs | 3 +- .../MonitoredEpisodeSpecification.cs | 11 +++- .../Search/DailyEpisodeMatchSpecification.cs | 7 ++- .../IDecisionEngineSearchSpecification.cs | 10 ---- .../Search/SeasonMatchSpecification.cs | 7 ++- .../SingleEpisodeSearchMatchSpecification.cs | 7 ++- .../UpgradeDiskSpecification.cs | 3 +- .../UpgradeHistorySpecification.cs | 3 +- NzbDrone.Core/NzbDrone.Core.csproj | 3 +- 25 files changed, 123 insertions(+), 145 deletions(-) rename NzbDrone.Core/DecisionEngine/Specifications/{ => RssSync}/MonitoredEpisodeSpecification.cs (71%) delete mode 100644 NzbDrone.Core/DecisionEngine/Specifications/Search/IDecisionEngineSearchSpecification.cs diff --git a/NzbDrone.Core.Test/DecisionEngineTests/AcceptableSizeSpecificationFixture.cs b/NzbDrone.Core.Test/DecisionEngineTests/AcceptableSizeSpecificationFixture.cs index a7d064f47..32528beaf 100644 --- a/NzbDrone.Core.Test/DecisionEngineTests/AcceptableSizeSpecificationFixture.cs +++ b/NzbDrone.Core.Test/DecisionEngineTests/AcceptableSizeSpecificationFixture.cs @@ -68,7 +68,7 @@ public void IsAcceptableSize_true_single_episode_not_first_or_last_30_minute() .Returns(false); - bool result = Subject.IsSatisfiedBy(parseResultSingle); + bool result = Subject.IsSatisfiedBy(parseResultSingle, null); result.Should().BeTrue(); @@ -87,7 +87,7 @@ public void IsAcceptableSize_true_single_episode_not_first_or_last_60_minute() .Returns(false); - bool result = Subject.IsSatisfiedBy(parseResultSingle); + bool result = Subject.IsSatisfiedBy(parseResultSingle, null); result.Should().BeTrue(); @@ -106,7 +106,7 @@ public void IsAcceptableSize_false_single_episode_not_first_or_last_30_minute() .Returns(false); - bool result = Subject.IsSatisfiedBy(parseResultSingle); + bool result = Subject.IsSatisfiedBy(parseResultSingle, null); result.Should().BeFalse(); @@ -115,8 +115,6 @@ public void IsAcceptableSize_false_single_episode_not_first_or_last_30_minute() [Test] public void IsAcceptableSize_false_single_episode_not_first_or_last_60_minute() { - - parseResultSingle.Series = series60minutes; parseResultSingle.Report.Size = 1.Gigabytes(); @@ -126,9 +124,7 @@ public void IsAcceptableSize_false_single_episode_not_first_or_last_60_minute() s => s.IsFirstOrLastEpisodeOfSeason(It.IsAny())) .Returns(false); - - bool result = Subject.IsSatisfiedBy(parseResultSingle); - + bool result = Subject.IsSatisfiedBy(parseResultSingle, null); result.Should().BeFalse(); } @@ -136,8 +132,6 @@ public void IsAcceptableSize_false_single_episode_not_first_or_last_60_minute() [Test] public void IsAcceptableSize_true_multi_episode_not_first_or_last_30_minute() { - - parseResultMulti.Series = series30minutes; parseResultMulti.Report.Size = 184572800; @@ -148,7 +142,7 @@ public void IsAcceptableSize_true_multi_episode_not_first_or_last_30_minute() .Returns(false); - bool result = Subject.IsSatisfiedBy(parseResultMulti); + bool result = Subject.IsSatisfiedBy(parseResultMulti, null); result.Should().BeTrue(); @@ -157,8 +151,6 @@ public void IsAcceptableSize_true_multi_episode_not_first_or_last_30_minute() [Test] public void IsAcceptableSize_true_multi_episode_not_first_or_last_60_minute() { - - parseResultMulti.Series = series60minutes; parseResultMulti.Report.Size = 368572800; @@ -169,7 +161,7 @@ public void IsAcceptableSize_true_multi_episode_not_first_or_last_60_minute() .Returns(false); - bool result = Subject.IsSatisfiedBy(parseResultMulti); + bool result = Subject.IsSatisfiedBy(parseResultMulti, null); result.Should().BeTrue(); @@ -178,8 +170,6 @@ public void IsAcceptableSize_true_multi_episode_not_first_or_last_60_minute() [Test] public void IsAcceptableSize_false_multi_episode_not_first_or_last_30_minute() { - - parseResultMulti.Series = series30minutes; parseResultMulti.Report.Size = 1.Gigabytes(); @@ -190,7 +180,7 @@ public void IsAcceptableSize_false_multi_episode_not_first_or_last_30_minute() .Returns(false); - bool result = Subject.IsSatisfiedBy(parseResultMulti); + bool result = Subject.IsSatisfiedBy(parseResultMulti, null); result.Should().BeFalse(); @@ -199,8 +189,6 @@ public void IsAcceptableSize_false_multi_episode_not_first_or_last_30_minute() [Test] public void IsAcceptableSize_false_multi_episode_not_first_or_last_60_minute() { - - parseResultMulti.Series = series60minutes; parseResultMulti.Report.Size = 10.Gigabytes(); @@ -211,7 +199,7 @@ public void IsAcceptableSize_false_multi_episode_not_first_or_last_60_minute() .Returns(false); - bool result = Subject.IsSatisfiedBy(parseResultMulti); + bool result = Subject.IsSatisfiedBy(parseResultMulti, null); result.Should().BeFalse(); @@ -220,8 +208,6 @@ public void IsAcceptableSize_false_multi_episode_not_first_or_last_60_minute() [Test] public void IsAcceptableSize_true_single_episode_first_30_minute() { - - parseResultSingle.Series = series30minutes; parseResultSingle.Report.Size = 184572800; @@ -232,7 +218,7 @@ public void IsAcceptableSize_true_single_episode_first_30_minute() .Returns(true); - bool result = Subject.IsSatisfiedBy(parseResultSingle); + bool result = Subject.IsSatisfiedBy(parseResultSingle, null); result.Should().BeTrue(); @@ -241,8 +227,6 @@ public void IsAcceptableSize_true_single_episode_first_30_minute() [Test] public void IsAcceptableSize_true_single_episode_first_60_minute() { - - parseResultSingle.Series = series60minutes; parseResultSingle.Report.Size = 368572800; @@ -253,7 +237,7 @@ public void IsAcceptableSize_true_single_episode_first_60_minute() .Returns(true); - bool result = Subject.IsSatisfiedBy(parseResultSingle); + bool result = Subject.IsSatisfiedBy(parseResultSingle, null); result.Should().BeTrue(); @@ -262,8 +246,6 @@ public void IsAcceptableSize_true_single_episode_first_60_minute() [Test] public void IsAcceptableSize_false_single_episode_first_30_minute() { - - parseResultSingle.Series = series30minutes; parseResultSingle.Report.Size = 1.Gigabytes(); @@ -274,7 +256,7 @@ public void IsAcceptableSize_false_single_episode_first_30_minute() .Returns(true); - bool result = Subject.IsSatisfiedBy(parseResultSingle); + bool result = Subject.IsSatisfiedBy(parseResultSingle, null); result.Should().BeFalse(); @@ -295,7 +277,7 @@ public void IsAcceptableSize_false_single_episode_first_60_minute() .Returns(true); - bool result = Subject.IsSatisfiedBy(parseResultSingle); + bool result = Subject.IsSatisfiedBy(parseResultSingle, null); result.Should().BeFalse(); @@ -317,7 +299,7 @@ public void IsAcceptableSize_true_unlimited_30_minute() .Returns(true); - bool result = Subject.IsSatisfiedBy(parseResultSingle); + bool result = Subject.IsSatisfiedBy(parseResultSingle, null); result.Should().BeTrue(); @@ -339,7 +321,7 @@ public void IsAcceptableSize_true_unlimited_60_minute() .Returns(true); - bool result = Subject.IsSatisfiedBy(parseResultSingle); + bool result = Subject.IsSatisfiedBy(parseResultSingle, null); result.Should().BeTrue(); @@ -363,7 +345,7 @@ public void IsAcceptableSize_should_treat_daily_series_as_single_episode() .Returns(true); - bool result = Subject.IsSatisfiedBy(parseResultSingle); + bool result = Subject.IsSatisfiedBy(parseResultSingle, null); result.Should().BeTrue(); @@ -377,7 +359,7 @@ public void should_return_true_if_RAWHD() ParsedEpisodeInfo = new ParsedEpisodeInfo { Quality = new QualityModel(Quality.RAWHD, false) }, }; - Subject.IsSatisfiedBy(parseResult).Should().BeTrue(); + Subject.IsSatisfiedBy(parseResult, null).Should().BeTrue(); } @@ -389,7 +371,7 @@ public void should_always_return_false_if_unknow() ParsedEpisodeInfo = new ParsedEpisodeInfo { Quality = new QualityModel(Quality.Unknown, false) }, }; - Subject.IsSatisfiedBy(parseResult).Should().BeFalse(); + Subject.IsSatisfiedBy(parseResult, null).Should().BeFalse(); Mocker.GetMock().Verify(c=>c.Get(It.IsAny()),Times.Never()); diff --git a/NzbDrone.Core.Test/DecisionEngineTests/DownloadDecisionMakerFixture.cs b/NzbDrone.Core.Test/DecisionEngineTests/DownloadDecisionMakerFixture.cs index d0654cdd1..042221dae 100644 --- a/NzbDrone.Core.Test/DecisionEngineTests/DownloadDecisionMakerFixture.cs +++ b/NzbDrone.Core.Test/DecisionEngineTests/DownloadDecisionMakerFixture.cs @@ -37,23 +37,23 @@ public void Setup() _fail2 = new Mock(); _fail3 = new Mock(); - _pass1.Setup(c => c.IsSatisfiedBy(It.IsAny())).Returns(true); + _pass1.Setup(c => c.IsSatisfiedBy(It.IsAny(), null)).Returns(true); _pass1.Setup(c => c.RejectionReason).Returns("_pass1"); - _pass2.Setup(c => c.IsSatisfiedBy(It.IsAny())).Returns(true); + _pass2.Setup(c => c.IsSatisfiedBy(It.IsAny(), null)).Returns(true); _pass2.Setup(c => c.RejectionReason).Returns("_pass2"); - _pass3.Setup(c => c.IsSatisfiedBy(It.IsAny())).Returns(true); + _pass3.Setup(c => c.IsSatisfiedBy(It.IsAny(), null)).Returns(true); _pass3.Setup(c => c.RejectionReason).Returns("_pass3"); - _fail1.Setup(c => c.IsSatisfiedBy(It.IsAny())).Returns(false); + _fail1.Setup(c => c.IsSatisfiedBy(It.IsAny(), null)).Returns(false); _fail1.Setup(c => c.RejectionReason).Returns("_fail1"); - _fail2.Setup(c => c.IsSatisfiedBy(It.IsAny())).Returns(false); + _fail2.Setup(c => c.IsSatisfiedBy(It.IsAny(), null)).Returns(false); _fail2.Setup(c => c.RejectionReason).Returns("_fail2"); - _fail3.Setup(c => c.IsSatisfiedBy(It.IsAny())).Returns(false); + _fail3.Setup(c => c.IsSatisfiedBy(It.IsAny(), null)).Returns(false); _fail3.Setup(c => c.RejectionReason).Returns("_fail3"); _reports = new List { new ReportInfo { Title = "The.Office.S03E115.DVDRip.XviD-OSiTV" } }; @@ -61,7 +61,6 @@ public void Setup() Mocker.GetMock().Setup(c => c.Map(It.IsAny())) .Returns(_remoteEpisode); - } private void GivenSpecifications(params Mock[] mocks) @@ -76,15 +75,14 @@ public void should_call_all_specifications() Subject.GetRssDecision(_reports).ToList(); - _fail1.Verify(c => c.IsSatisfiedBy(_remoteEpisode), Times.Once()); - _fail2.Verify(c => c.IsSatisfiedBy(_remoteEpisode), Times.Once()); - _fail3.Verify(c => c.IsSatisfiedBy(_remoteEpisode), Times.Once()); - _pass1.Verify(c => c.IsSatisfiedBy(_remoteEpisode), Times.Once()); - _pass2.Verify(c => c.IsSatisfiedBy(_remoteEpisode), Times.Once()); - _pass3.Verify(c => c.IsSatisfiedBy(_remoteEpisode), Times.Once()); + _fail1.Verify(c => c.IsSatisfiedBy(_remoteEpisode, null), Times.Once()); + _fail2.Verify(c => c.IsSatisfiedBy(_remoteEpisode, null), Times.Once()); + _fail3.Verify(c => c.IsSatisfiedBy(_remoteEpisode, null), Times.Once()); + _pass1.Verify(c => c.IsSatisfiedBy(_remoteEpisode, null), Times.Once()); + _pass2.Verify(c => c.IsSatisfiedBy(_remoteEpisode, null), Times.Once()); + _pass3.Verify(c => c.IsSatisfiedBy(_remoteEpisode, null), Times.Once()); } - [Test] public void should_return_rejected_if_single_specs_fail() { @@ -124,7 +122,6 @@ public void should_have_same_number_of_rejections_as_specs_that_failed() result.Single().Rejections.Should().HaveCount(3); } - [Test] public void should_not_attempt_to_map_episode_if_not_parsable() { @@ -135,9 +132,9 @@ public void should_not_attempt_to_map_episode_if_not_parsable() Mocker.GetMock().Verify(c => c.Map(It.IsAny()), Times.Never()); - _pass1.Verify(c => c.IsSatisfiedBy(It.IsAny()), Times.Never()); - _pass2.Verify(c => c.IsSatisfiedBy(It.IsAny()), Times.Never()); - _pass3.Verify(c => c.IsSatisfiedBy(It.IsAny()), Times.Never()); + _pass1.Verify(c => c.IsSatisfiedBy(It.IsAny(), null), Times.Never()); + _pass2.Verify(c => c.IsSatisfiedBy(It.IsAny(), null), Times.Never()); + _pass3.Verify(c => c.IsSatisfiedBy(It.IsAny(), null), Times.Never()); results.Should().BeEmpty(); } @@ -151,14 +148,13 @@ [Test] public void should_not_attempt_to_map_episode_series_title_is_blank() Mocker.GetMock().Verify(c => c.Map(It.IsAny()), Times.Never()); - _pass1.Verify(c => c.IsSatisfiedBy(It.IsAny()), Times.Never()); - _pass2.Verify(c => c.IsSatisfiedBy(It.IsAny()), Times.Never()); - _pass3.Verify(c => c.IsSatisfiedBy(It.IsAny()), Times.Never()); + _pass1.Verify(c => c.IsSatisfiedBy(It.IsAny(), null), Times.Never()); + _pass2.Verify(c => c.IsSatisfiedBy(It.IsAny(), null), Times.Never()); + _pass3.Verify(c => c.IsSatisfiedBy(It.IsAny(), null), Times.Never()); results.Should().BeEmpty(); } - [Test] public void should_not_attempt_to_make_decision_if_series_is_unknown() { @@ -168,13 +164,11 @@ public void should_not_attempt_to_make_decision_if_series_is_unknown() Subject.GetRssDecision(_reports); - _pass1.Verify(c => c.IsSatisfiedBy(It.IsAny()), Times.Never()); - _pass2.Verify(c => c.IsSatisfiedBy(It.IsAny()), Times.Never()); - _pass3.Verify(c => c.IsSatisfiedBy(It.IsAny()), Times.Never()); - + _pass1.Verify(c => c.IsSatisfiedBy(It.IsAny(), null), Times.Never()); + _pass2.Verify(c => c.IsSatisfiedBy(It.IsAny(), null), Times.Never()); + _pass3.Verify(c => c.IsSatisfiedBy(It.IsAny(), null), Times.Never()); } - [Test] public void broken_report_shouldnt_blowup_the_process() { @@ -197,7 +191,6 @@ public void broken_report_shouldnt_blowup_the_process() ExceptionVerification.ExpectedErrors(3); } - [Test] public void should_return_unknown_series_rejection_if_series_is_unknown() { @@ -208,8 +201,6 @@ public void should_return_unknown_series_rejection_if_series_is_unknown() var result = Subject.GetRssDecision(_reports); result.Should().HaveCount(1); - } } - } \ No newline at end of file diff --git a/NzbDrone.Core.Test/DecisionEngineTests/LanguageSpecificationFixture.cs b/NzbDrone.Core.Test/DecisionEngineTests/LanguageSpecificationFixture.cs index 0374f308a..10ffdc806 100644 --- a/NzbDrone.Core.Test/DecisionEngineTests/LanguageSpecificationFixture.cs +++ b/NzbDrone.Core.Test/DecisionEngineTests/LanguageSpecificationFixture.cs @@ -40,7 +40,7 @@ public void should_return_true_if_language_is_english() { WithEnglishRelease(); - Mocker.Resolve().IsSatisfiedBy(parseResult).Should().BeTrue(); + Mocker.Resolve().IsSatisfiedBy(parseResult, null).Should().BeTrue(); } [Test] @@ -48,7 +48,7 @@ public void should_return_false_if_language_is_german() { WithGermanRelease(); - Mocker.Resolve().IsSatisfiedBy(parseResult).Should().BeFalse(); + Mocker.Resolve().IsSatisfiedBy(parseResult, null).Should().BeFalse(); } } } \ No newline at end of file diff --git a/NzbDrone.Core.Test/DecisionEngineTests/MonitoredEpisodeSpecificationFixture.cs b/NzbDrone.Core.Test/DecisionEngineTests/MonitoredEpisodeSpecificationFixture.cs index 29400b977..dd7b763f8 100644 --- a/NzbDrone.Core.Test/DecisionEngineTests/MonitoredEpisodeSpecificationFixture.cs +++ b/NzbDrone.Core.Test/DecisionEngineTests/MonitoredEpisodeSpecificationFixture.cs @@ -2,7 +2,7 @@ using FizzWare.NBuilder; using FluentAssertions; using NUnit.Framework; -using NzbDrone.Core.DecisionEngine.Specifications; +using NzbDrone.Core.DecisionEngine.Specifications.RssSync; using NzbDrone.Core.Parser.Model; using NzbDrone.Core.Tv; using NzbDrone.Core.Test.Framework; @@ -63,50 +63,44 @@ private void WithSecondEpisodeUnmonitored() [Test] public void setup_should_return_monitored_episode_should_return_true() { - _monitoredEpisodeSpecification.IsSatisfiedBy(_parseResultSingle).Should().BeTrue(); - _monitoredEpisodeSpecification.IsSatisfiedBy(_parseResultMulti).Should().BeTrue(); + _monitoredEpisodeSpecification.IsSatisfiedBy(_parseResultSingle, null).Should().BeTrue(); + _monitoredEpisodeSpecification.IsSatisfiedBy(_parseResultMulti, null).Should().BeTrue(); } - [Test] public void not_monitored_series_should_be_skipped() { _fakeSeries.Monitored = false; - _monitoredEpisodeSpecification.IsSatisfiedBy(_parseResultMulti).Should().BeFalse(); + _monitoredEpisodeSpecification.IsSatisfiedBy(_parseResultMulti, null).Should().BeFalse(); } - [Test] public void only_episode_not_monitored_should_return_false() { WithFirstEpisodeUnmonitored(); - _monitoredEpisodeSpecification.IsSatisfiedBy(_parseResultSingle).Should().BeFalse(); + _monitoredEpisodeSpecification.IsSatisfiedBy(_parseResultSingle, null).Should().BeFalse(); } - [Test] public void both_episodes_not_monitored_should_return_false() { WithFirstEpisodeUnmonitored(); WithSecondEpisodeUnmonitored(); - _monitoredEpisodeSpecification.IsSatisfiedBy(_parseResultMulti).Should().BeFalse(); + _monitoredEpisodeSpecification.IsSatisfiedBy(_parseResultMulti, null).Should().BeFalse(); } - [Test] public void only_first_episode_not_monitored_should_return_monitored() { WithFirstEpisodeUnmonitored(); - _monitoredEpisodeSpecification.IsSatisfiedBy(_parseResultMulti).Should().BeTrue(); + _monitoredEpisodeSpecification.IsSatisfiedBy(_parseResultMulti, null).Should().BeTrue(); } - [Test] public void only_second_episode_not_monitored_should_return_monitored() { WithSecondEpisodeUnmonitored(); - _monitoredEpisodeSpecification.IsSatisfiedBy(_parseResultMulti).Should().BeTrue(); + _monitoredEpisodeSpecification.IsSatisfiedBy(_parseResultMulti, null).Should().BeTrue(); } - } } \ No newline at end of file diff --git a/NzbDrone.Core.Test/DecisionEngineTests/NotRestrictedReleaseSpecificationFixture.cs b/NzbDrone.Core.Test/DecisionEngineTests/NotRestrictedReleaseSpecificationFixture.cs index 79d4170c3..f9bcf475e 100644 --- a/NzbDrone.Core.Test/DecisionEngineTests/NotRestrictedReleaseSpecificationFixture.cs +++ b/NzbDrone.Core.Test/DecisionEngineTests/NotRestrictedReleaseSpecificationFixture.cs @@ -27,7 +27,7 @@ public void Setup() [Test] public void should_be_true_when_restrictions_are_empty() { - Subject.IsSatisfiedBy(_parseResult).Should().BeTrue(); + Subject.IsSatisfiedBy(_parseResult, null).Should().BeTrue(); } [TestCase("KYR")] @@ -38,7 +38,7 @@ public void should_be_true_when_restrictions_are_empty() public void should_be_false_when_nzb_contains_a_restricted_term(string restrictions) { Mocker.GetMock().SetupGet(c => c.ReleaseRestrictions).Returns(restrictions); - Subject.IsSatisfiedBy(_parseResult).Should().BeFalse(); + Subject.IsSatisfiedBy(_parseResult, null).Should().BeFalse(); } [TestCase("NotReal")] @@ -47,7 +47,7 @@ public void should_be_false_when_nzb_contains_a_restricted_term(string restricti public void should_be_true_when_nzb_does_not_contain_a_restricted_term(string restrictions) { Mocker.GetMock().SetupGet(c => c.ReleaseRestrictions).Returns(restrictions); - Subject.IsSatisfiedBy(_parseResult).Should().BeTrue(); + Subject.IsSatisfiedBy(_parseResult, null).Should().BeTrue(); } } } \ No newline at end of file diff --git a/NzbDrone.Core.Test/DecisionEngineTests/QualityAllowedByProfileSpecificationFixture.cs b/NzbDrone.Core.Test/DecisionEngineTests/QualityAllowedByProfileSpecificationFixture.cs index 76896d3df..fb5ddde76 100644 --- a/NzbDrone.Core.Test/DecisionEngineTests/QualityAllowedByProfileSpecificationFixture.cs +++ b/NzbDrone.Core.Test/DecisionEngineTests/QualityAllowedByProfileSpecificationFixture.cs @@ -51,7 +51,7 @@ public void should_allow_if_quality_is_defined_in_profile(Quality qualityType) remoteEpisode.ParsedEpisodeInfo.Quality.Quality = qualityType; remoteEpisode.Series.QualityProfile.Value.Allowed = new List { Quality.DVD, Quality.HDTV720p, Quality.Bluray1080p }; - Subject.IsSatisfiedBy(remoteEpisode).Should().BeTrue(); + Subject.IsSatisfiedBy(remoteEpisode, null).Should().BeTrue(); } [Test, TestCaseSource("DeniedTestCases")] @@ -60,7 +60,7 @@ public void should_not_allow_if_quality_is_not_defined_in_profile(Quality qualit remoteEpisode.ParsedEpisodeInfo.Quality.Quality = qualityType; remoteEpisode.Series.QualityProfile.Value.Allowed = new List { Quality.DVD, Quality.HDTV720p, Quality.Bluray1080p }; - Subject.IsSatisfiedBy(remoteEpisode).Should().BeFalse(); + Subject.IsSatisfiedBy(remoteEpisode, null).Should().BeFalse(); } } } \ No newline at end of file diff --git a/NzbDrone.Core.Test/DecisionEngineTests/RetentionSpecificationFixture.cs b/NzbDrone.Core.Test/DecisionEngineTests/RetentionSpecificationFixture.cs index a4d473872..7a61aa04a 100644 --- a/NzbDrone.Core.Test/DecisionEngineTests/RetentionSpecificationFixture.cs +++ b/NzbDrone.Core.Test/DecisionEngineTests/RetentionSpecificationFixture.cs @@ -50,35 +50,35 @@ private void WithEqualRetention() public void unlimited_retention_should_return_true() { WithUnlimitedRetention(); - Subject.IsSatisfiedBy(parseResult).Should().BeTrue(); + Subject.IsSatisfiedBy(parseResult, null).Should().BeTrue(); } [Test] public void longer_retention_should_return_true() { WithLongRetention(); - Subject.IsSatisfiedBy(parseResult).Should().BeTrue(); + Subject.IsSatisfiedBy(parseResult, null).Should().BeTrue(); } [Test] public void equal_retention_should_return_true() { WithEqualRetention(); - Subject.IsSatisfiedBy(parseResult).Should().BeTrue(); + Subject.IsSatisfiedBy(parseResult, null).Should().BeTrue(); } [Test] public void shorter_retention_should_return_false() { WithShortRetention(); - Subject.IsSatisfiedBy(parseResult).Should().BeFalse(); + Subject.IsSatisfiedBy(parseResult, null).Should().BeFalse(); } [Test] public void zeroDay_report_should_return_true() { WithUnlimitedRetention(); - Subject.IsSatisfiedBy(parseResult).Should().BeTrue(); + Subject.IsSatisfiedBy(parseResult, null).Should().BeTrue(); } } } \ No newline at end of file diff --git a/NzbDrone.Core.Test/DecisionEngineTests/UpgradeDiskSpecificationFixture.cs b/NzbDrone.Core.Test/DecisionEngineTests/UpgradeDiskSpecificationFixture.cs index 53d8dba97..75c5aea2f 100644 --- a/NzbDrone.Core.Test/DecisionEngineTests/UpgradeDiskSpecificationFixture.cs +++ b/NzbDrone.Core.Test/DecisionEngineTests/UpgradeDiskSpecificationFixture.cs @@ -70,7 +70,7 @@ private void WithSecondFileUpgradable() public void should_return_true_if_episode_has_no_existing_file() { parseResultSingle.Episodes.ForEach(c => c.EpisodeFileId = 0); - _upgradeDisk.IsSatisfiedBy(parseResultSingle).Should().BeTrue(); + _upgradeDisk.IsSatisfiedBy(parseResultSingle, null).Should().BeTrue(); } [Test] @@ -78,14 +78,14 @@ public void should_return_true_if_single_episode_doesnt_exist_on_disk() { parseResultSingle.Episodes = new List(); - _upgradeDisk.IsSatisfiedBy(parseResultSingle).Should().BeTrue(); + _upgradeDisk.IsSatisfiedBy(parseResultSingle, null).Should().BeTrue(); } [Test] public void should_be_upgradable_if_only_episode_is_upgradable() { WithFirstFileUpgradable(); - _upgradeDisk.IsSatisfiedBy(parseResultSingle).Should().BeTrue(); + _upgradeDisk.IsSatisfiedBy(parseResultSingle, null).Should().BeTrue(); } [Test] @@ -93,27 +93,27 @@ public void should_be_upgradable_if_both_episodes_are_upgradable() { WithFirstFileUpgradable(); WithSecondFileUpgradable(); - _upgradeDisk.IsSatisfiedBy(parseResultMulti).Should().BeTrue(); + _upgradeDisk.IsSatisfiedBy(parseResultMulti, null).Should().BeTrue(); } [Test] public void should_be_not_upgradable_if_both_episodes_are_not_upgradable() { - _upgradeDisk.IsSatisfiedBy(parseResultMulti).Should().BeFalse(); + _upgradeDisk.IsSatisfiedBy(parseResultMulti, null).Should().BeFalse(); } [Test] public void should_be_not_upgradable_if_only_first_episodes_is_upgradable() { WithFirstFileUpgradable(); - _upgradeDisk.IsSatisfiedBy(parseResultMulti).Should().BeFalse(); + _upgradeDisk.IsSatisfiedBy(parseResultMulti, null).Should().BeFalse(); } [Test] public void should_be_not_upgradable_if_only_second_episodes_is_upgradable() { WithSecondFileUpgradable(); - _upgradeDisk.IsSatisfiedBy(parseResultMulti).Should().BeFalse(); + _upgradeDisk.IsSatisfiedBy(parseResultMulti, null).Should().BeFalse(); } [Test] @@ -121,28 +121,28 @@ public void should_not_be_upgradable_if_qualities_are_the_same() { firstFile.Quality = new QualityModel(Quality.WEBDL1080p); parseResultSingle.ParsedEpisodeInfo.Quality = new QualityModel(Quality.WEBDL1080p, false); - _upgradeDisk.IsSatisfiedBy(parseResultSingle).Should().BeFalse(); + _upgradeDisk.IsSatisfiedBy(parseResultSingle, null).Should().BeFalse(); } [Test] public void should_return_false_when_episodeFile_was_added_more_than_7_days_ago() { firstFile.DateAdded = DateTime.Today.AddDays(-30); - _upgradeDisk.IsSatisfiedBy(parseResultSingle).Should().BeFalse(); + _upgradeDisk.IsSatisfiedBy(parseResultSingle, null).Should().BeFalse(); } [Test] public void should_return_false_when_first_episodeFile_was_added_more_than_7_days_ago() { firstFile.DateAdded = DateTime.Today.AddDays(-30); - _upgradeDisk.IsSatisfiedBy(parseResultMulti).Should().BeFalse(); + _upgradeDisk.IsSatisfiedBy(parseResultMulti, null).Should().BeFalse(); } [Test] public void should_return_false_when_second_episodeFile_was_added_more_than_7_days_ago() { secondFile.DateAdded = DateTime.Today.AddDays(-30); - _upgradeDisk.IsSatisfiedBy(parseResultMulti).Should().BeFalse(); + _upgradeDisk.IsSatisfiedBy(parseResultMulti, null).Should().BeFalse(); } } } \ No newline at end of file diff --git a/NzbDrone.Core.Test/DecisionEngineTests/UpgradeHistorySpecificationFixture.cs b/NzbDrone.Core.Test/DecisionEngineTests/UpgradeHistorySpecificationFixture.cs index d072c26ca..301819c91 100644 --- a/NzbDrone.Core.Test/DecisionEngineTests/UpgradeHistorySpecificationFixture.cs +++ b/NzbDrone.Core.Test/DecisionEngineTests/UpgradeHistorySpecificationFixture.cs @@ -80,7 +80,7 @@ private void WithSecondReportUpgradable() public void should_be_upgradable_if_only_episode_is_upgradable() { WithFirstReportUpgradable(); - _upgradeHistory.IsSatisfiedBy(_parseResultSingle).Should().BeTrue(); + _upgradeHistory.IsSatisfiedBy(_parseResultSingle, null).Should().BeTrue(); } [Test] @@ -88,27 +88,27 @@ public void should_be_upgradable_if_both_episodes_are_upgradable() { WithFirstReportUpgradable(); WithSecondReportUpgradable(); - _upgradeHistory.IsSatisfiedBy(_parseResultMulti).Should().BeTrue(); + _upgradeHistory.IsSatisfiedBy(_parseResultMulti, null).Should().BeTrue(); } [Test] public void should_not_be_upgradable_if_both_episodes_are_not_upgradable() { - _upgradeHistory.IsSatisfiedBy(_parseResultMulti).Should().BeFalse(); + _upgradeHistory.IsSatisfiedBy(_parseResultMulti, null).Should().BeFalse(); } [Test] public void should_be_not_upgradable_if_only_first_episodes_is_upgradable() { WithFirstReportUpgradable(); - _upgradeHistory.IsSatisfiedBy(_parseResultMulti).Should().BeFalse(); + _upgradeHistory.IsSatisfiedBy(_parseResultMulti, null).Should().BeFalse(); } [Test] public void should_be_not_upgradable_if_only_second_episodes_is_upgradable() { WithSecondReportUpgradable(); - _upgradeHistory.IsSatisfiedBy(_parseResultMulti).Should().BeFalse(); + _upgradeHistory.IsSatisfiedBy(_parseResultMulti, null).Should().BeFalse(); } [Test] @@ -120,7 +120,7 @@ public void should_not_be_upgradable_if_episode_is_of_same_quality_as_existing() Mocker.GetMock().Setup(c => c.GetBestQualityInHistory(1)).Returns(_upgradableQuality); - _upgradeHistory.IsSatisfiedBy(_parseResultSingle).Should().BeFalse(); + _upgradeHistory.IsSatisfiedBy(_parseResultSingle, null).Should().BeFalse(); } } } \ No newline at end of file diff --git a/NzbDrone.Core/DecisionEngine/DownloadDecisionMaker.cs b/NzbDrone.Core/DecisionEngine/DownloadDecisionMaker.cs index 097addee6..ffb23b5ca 100644 --- a/NzbDrone.Core/DecisionEngine/DownloadDecisionMaker.cs +++ b/NzbDrone.Core/DecisionEngine/DownloadDecisionMaker.cs @@ -36,7 +36,7 @@ public List GetRssDecision(IEnumerable reports) public List GetSearchDecision(IEnumerable reports, SearchCriteriaBase searchCriteriaBase) { - return GetDecisions(reports).ToList(); + return GetDecisions(reports, searchCriteriaBase).ToList(); } private IEnumerable GetDecisions(IEnumerable reports, SearchCriteriaBase searchCriteria = null) @@ -94,17 +94,8 @@ private string EvaluateSpec(IRejectWithReason spec, RemoteEpisode remoteEpisode, throw new InvalidOperationException("[Need Rejection Text]"); } - var searchSpecification = spec as IDecisionEngineSearchSpecification; - if (searchSpecification != null && searchCriteriaBase != null) - { - if (!searchSpecification.IsSatisfiedBy(remoteEpisode, searchCriteriaBase)) - { - return spec.RejectionReason; - } - } - var generalSpecification = spec as IDecisionEngineSpecification; - if (generalSpecification != null && !generalSpecification.IsSatisfiedBy(remoteEpisode)) + if (generalSpecification != null && !generalSpecification.IsSatisfiedBy(remoteEpisode, searchCriteriaBase)) { return spec.RejectionReason; } diff --git a/NzbDrone.Core/DecisionEngine/IDecisionEngineSpecification.cs b/NzbDrone.Core/DecisionEngine/IDecisionEngineSpecification.cs index 11e10747b..7ad1240bc 100644 --- a/NzbDrone.Core/DecisionEngine/IDecisionEngineSpecification.cs +++ b/NzbDrone.Core/DecisionEngine/IDecisionEngineSpecification.cs @@ -1,9 +1,10 @@ +using NzbDrone.Core.IndexerSearch.Definitions; using NzbDrone.Core.Parser.Model; namespace NzbDrone.Core.DecisionEngine { public interface IDecisionEngineSpecification : IRejectWithReason { - bool IsSatisfiedBy(RemoteEpisode subject); + bool IsSatisfiedBy(RemoteEpisode subject, SearchCriteriaBase searchCriteriaBase); } } \ No newline at end of file diff --git a/NzbDrone.Core/DecisionEngine/Specifications/AcceptableSizeSpecification.cs b/NzbDrone.Core/DecisionEngine/Specifications/AcceptableSizeSpecification.cs index 436040a17..8fa00ebc2 100644 --- a/NzbDrone.Core/DecisionEngine/Specifications/AcceptableSizeSpecification.cs +++ b/NzbDrone.Core/DecisionEngine/Specifications/AcceptableSizeSpecification.cs @@ -1,5 +1,6 @@ using System.Linq; using NLog; +using NzbDrone.Core.IndexerSearch.Definitions; using NzbDrone.Core.Parser.Model; using NzbDrone.Core.Qualities; using NzbDrone.Core.Tv; @@ -24,7 +25,7 @@ public string RejectionReason get { return "File size too big or small"; } } - public virtual bool IsSatisfiedBy(RemoteEpisode subject) + public virtual bool IsSatisfiedBy(RemoteEpisode subject, SearchCriteriaBase searchCriteriaBase) { _logger.Trace("Beginning size check for: {0}", subject); diff --git a/NzbDrone.Core/DecisionEngine/Specifications/LanguageSpecification.cs b/NzbDrone.Core/DecisionEngine/Specifications/LanguageSpecification.cs index 607f68a7f..ac90c9af1 100644 --- a/NzbDrone.Core/DecisionEngine/Specifications/LanguageSpecification.cs +++ b/NzbDrone.Core/DecisionEngine/Specifications/LanguageSpecification.cs @@ -1,4 +1,5 @@ using NLog; +using NzbDrone.Core.IndexerSearch.Definitions; using NzbDrone.Core.Parser; using NzbDrone.Core.Parser.Model; @@ -21,7 +22,7 @@ public string RejectionReason } } - public virtual bool IsSatisfiedBy(RemoteEpisode subject) + public virtual bool IsSatisfiedBy(RemoteEpisode subject, SearchCriteriaBase searchCriteriaBase) { _logger.Trace("Checking if report meets language requirements. {0}", subject.ParsedEpisodeInfo.Language); if (subject.ParsedEpisodeInfo.Language != Language.English) diff --git a/NzbDrone.Core/DecisionEngine/Specifications/NotInQueueSpecification.cs b/NzbDrone.Core/DecisionEngine/Specifications/NotInQueueSpecification.cs index 7787d6f56..abd4e6f88 100644 --- a/NzbDrone.Core/DecisionEngine/Specifications/NotInQueueSpecification.cs +++ b/NzbDrone.Core/DecisionEngine/Specifications/NotInQueueSpecification.cs @@ -3,6 +3,7 @@ using System.Linq; using NLog; using NzbDrone.Core.Download; +using NzbDrone.Core.IndexerSearch.Definitions; using NzbDrone.Core.Parser.Model; using NzbDrone.Core.Tv; @@ -27,7 +28,7 @@ public string RejectionReason } } - public bool IsSatisfiedBy(RemoteEpisode subject) + public bool IsSatisfiedBy(RemoteEpisode subject, SearchCriteriaBase searchCriteriaBase) { var downloadClient = _downloadClientProvider.GetDownloadClient(); diff --git a/NzbDrone.Core/DecisionEngine/Specifications/NotRestrictedReleaseSpecification.cs b/NzbDrone.Core/DecisionEngine/Specifications/NotRestrictedReleaseSpecification.cs index 78dfe598c..903a04dca 100644 --- a/NzbDrone.Core/DecisionEngine/Specifications/NotRestrictedReleaseSpecification.cs +++ b/NzbDrone.Core/DecisionEngine/Specifications/NotRestrictedReleaseSpecification.cs @@ -1,6 +1,7 @@ using System; using NLog; using NzbDrone.Core.Configuration; +using NzbDrone.Core.IndexerSearch.Definitions; using NzbDrone.Core.Parser.Model; namespace NzbDrone.Core.DecisionEngine.Specifications @@ -24,7 +25,7 @@ public string RejectionReason } } - public virtual bool IsSatisfiedBy(RemoteEpisode subject) + public virtual bool IsSatisfiedBy(RemoteEpisode subject, SearchCriteriaBase searchCriteriaBase) { _logger.Trace("Checking if release contains any restricted terms: {0}", subject); diff --git a/NzbDrone.Core/DecisionEngine/Specifications/QualityAllowedByProfileSpecification.cs b/NzbDrone.Core/DecisionEngine/Specifications/QualityAllowedByProfileSpecification.cs index 3b12fd4e9..93eb78bb0 100644 --- a/NzbDrone.Core/DecisionEngine/Specifications/QualityAllowedByProfileSpecification.cs +++ b/NzbDrone.Core/DecisionEngine/Specifications/QualityAllowedByProfileSpecification.cs @@ -1,4 +1,5 @@ using NLog; +using NzbDrone.Core.IndexerSearch.Definitions; using NzbDrone.Core.Parser.Model; namespace NzbDrone.Core.DecisionEngine.Specifications @@ -20,7 +21,7 @@ public string RejectionReason } } - public virtual bool IsSatisfiedBy(RemoteEpisode subject) + public virtual bool IsSatisfiedBy(RemoteEpisode subject, SearchCriteriaBase searchCriteriaBase) { _logger.Trace("Checking if report meets quality requirements. {0}", subject.ParsedEpisodeInfo.Quality); if (!subject.Series.QualityProfile.Value.Allowed.Contains(subject.ParsedEpisodeInfo.Quality.Quality)) diff --git a/NzbDrone.Core/DecisionEngine/Specifications/RetentionSpecification.cs b/NzbDrone.Core/DecisionEngine/Specifications/RetentionSpecification.cs index f219ddee0..707afc9f1 100644 --- a/NzbDrone.Core/DecisionEngine/Specifications/RetentionSpecification.cs +++ b/NzbDrone.Core/DecisionEngine/Specifications/RetentionSpecification.cs @@ -1,5 +1,6 @@ using NLog; using NzbDrone.Core.Configuration; +using NzbDrone.Core.IndexerSearch.Definitions; using NzbDrone.Core.Parser.Model; namespace NzbDrone.Core.DecisionEngine.Specifications @@ -24,7 +25,7 @@ public string RejectionReason } } - public virtual bool IsSatisfiedBy(RemoteEpisode subject) + public virtual bool IsSatisfiedBy(RemoteEpisode subject, SearchCriteriaBase searchCriteriaBase) { var age = subject.Report.Age; diff --git a/NzbDrone.Core/DecisionEngine/Specifications/MonitoredEpisodeSpecification.cs b/NzbDrone.Core/DecisionEngine/Specifications/RssSync/MonitoredEpisodeSpecification.cs similarity index 71% rename from NzbDrone.Core/DecisionEngine/Specifications/MonitoredEpisodeSpecification.cs rename to NzbDrone.Core/DecisionEngine/Specifications/RssSync/MonitoredEpisodeSpecification.cs index d4449162a..0b8e58667 100644 --- a/NzbDrone.Core/DecisionEngine/Specifications/MonitoredEpisodeSpecification.cs +++ b/NzbDrone.Core/DecisionEngine/Specifications/RssSync/MonitoredEpisodeSpecification.cs @@ -1,8 +1,9 @@ using System.Linq; using NLog; +using NzbDrone.Core.IndexerSearch.Definitions; using NzbDrone.Core.Parser.Model; -namespace NzbDrone.Core.DecisionEngine.Specifications +namespace NzbDrone.Core.DecisionEngine.Specifications.RssSync { public class MonitoredEpisodeSpecification : IDecisionEngineSpecification { @@ -21,8 +22,14 @@ public string RejectionReason } } - public virtual bool IsSatisfiedBy(RemoteEpisode subject) + public virtual bool IsSatisfiedBy(RemoteEpisode subject, SearchCriteriaBase searchCriteriaBase) { + if (searchCriteriaBase != null) + { + _logger.Trace("Skipping monitored check during search"); + return true; + } + if (!subject.Series.Monitored) { _logger.Debug("{0} is present in the DB but not tracked. skipping.", subject.Series); diff --git a/NzbDrone.Core/DecisionEngine/Specifications/Search/DailyEpisodeMatchSpecification.cs b/NzbDrone.Core/DecisionEngine/Specifications/Search/DailyEpisodeMatchSpecification.cs index e3e8a8f7b..d8f04fc7b 100644 --- a/NzbDrone.Core/DecisionEngine/Specifications/Search/DailyEpisodeMatchSpecification.cs +++ b/NzbDrone.Core/DecisionEngine/Specifications/Search/DailyEpisodeMatchSpecification.cs @@ -5,7 +5,7 @@ namespace NzbDrone.Core.DecisionEngine.Specifications.Search { - public class DailyEpisodeMatchSpecification : IDecisionEngineSearchSpecification + public class DailyEpisodeMatchSpecification : IDecisionEngineSpecification { private readonly Logger _logger; private readonly IEpisodeService _episodeService; @@ -25,6 +25,11 @@ public string RejectionReason } public bool IsSatisfiedBy(RemoteEpisode remoteEpisode, SearchCriteriaBase searchCriteriaBase) { + if (searchCriteriaBase == null) + { + return true; + } + var dailySearchSpec = searchCriteriaBase as DailyEpisodeSearchCriteria; if (dailySearchSpec == null) return true; diff --git a/NzbDrone.Core/DecisionEngine/Specifications/Search/IDecisionEngineSearchSpecification.cs b/NzbDrone.Core/DecisionEngine/Specifications/Search/IDecisionEngineSearchSpecification.cs deleted file mode 100644 index 6b4f94912..000000000 --- a/NzbDrone.Core/DecisionEngine/Specifications/Search/IDecisionEngineSearchSpecification.cs +++ /dev/null @@ -1,10 +0,0 @@ -using NzbDrone.Core.IndexerSearch.Definitions; -using NzbDrone.Core.Parser.Model; - -namespace NzbDrone.Core.DecisionEngine.Specifications.Search -{ - public interface IDecisionEngineSearchSpecification : IRejectWithReason - { - bool IsSatisfiedBy(RemoteEpisode remoteEpisode, SearchCriteriaBase searchCriteriaBase); - } -} \ No newline at end of file diff --git a/NzbDrone.Core/DecisionEngine/Specifications/Search/SeasonMatchSpecification.cs b/NzbDrone.Core/DecisionEngine/Specifications/Search/SeasonMatchSpecification.cs index 8e2978ef6..d0a4de54f 100644 --- a/NzbDrone.Core/DecisionEngine/Specifications/Search/SeasonMatchSpecification.cs +++ b/NzbDrone.Core/DecisionEngine/Specifications/Search/SeasonMatchSpecification.cs @@ -4,7 +4,7 @@ namespace NzbDrone.Core.DecisionEngine.Specifications.Search { - public class SeasonMatchSpecification : IDecisionEngineSearchSpecification + public class SeasonMatchSpecification : IDecisionEngineSpecification { private readonly Logger _logger; @@ -23,6 +23,11 @@ public string RejectionReason public bool IsSatisfiedBy(RemoteEpisode remoteEpisode, SearchCriteriaBase searchCriteriaBase) { + if (searchCriteriaBase == null) + { + return true; + } + var singleEpisodeSpec = searchCriteriaBase as SeasonSearchCriteria; if (singleEpisodeSpec == null) return true; diff --git a/NzbDrone.Core/DecisionEngine/Specifications/Search/SingleEpisodeSearchMatchSpecification.cs b/NzbDrone.Core/DecisionEngine/Specifications/Search/SingleEpisodeSearchMatchSpecification.cs index 815773c8c..f8c64a7d5 100644 --- a/NzbDrone.Core/DecisionEngine/Specifications/Search/SingleEpisodeSearchMatchSpecification.cs +++ b/NzbDrone.Core/DecisionEngine/Specifications/Search/SingleEpisodeSearchMatchSpecification.cs @@ -5,7 +5,7 @@ namespace NzbDrone.Core.DecisionEngine.Specifications.Search { - public class SingleEpisodeSearchMatchSpecification : IDecisionEngineSearchSpecification + public class SingleEpisodeSearchMatchSpecification : IDecisionEngineSpecification { private readonly Logger _logger; @@ -24,6 +24,11 @@ public string RejectionReason public bool IsSatisfiedBy(RemoteEpisode remoteEpisode, SearchCriteriaBase searchCriteriaBase) { + if (searchCriteriaBase == null) + { + return true; + } + var singleEpisodeSpec = searchCriteriaBase as SingleEpisodeSearchCriteria; if (singleEpisodeSpec == null) return true; diff --git a/NzbDrone.Core/DecisionEngine/Specifications/UpgradeDiskSpecification.cs b/NzbDrone.Core/DecisionEngine/Specifications/UpgradeDiskSpecification.cs index 1134cedc9..2f2ad815d 100644 --- a/NzbDrone.Core/DecisionEngine/Specifications/UpgradeDiskSpecification.cs +++ b/NzbDrone.Core/DecisionEngine/Specifications/UpgradeDiskSpecification.cs @@ -1,6 +1,7 @@ using System; using System.Linq; using NLog; +using NzbDrone.Core.IndexerSearch.Definitions; using NzbDrone.Core.Parser.Model; namespace NzbDrone.Core.DecisionEngine.Specifications @@ -24,7 +25,7 @@ public string RejectionReason } } - public virtual bool IsSatisfiedBy(RemoteEpisode subject) + public virtual bool IsSatisfiedBy(RemoteEpisode subject, SearchCriteriaBase searchCriteriaBase) { foreach (var file in subject.Episodes.Where(c => c.EpisodeFileId != 0).Select(c => c.EpisodeFile.Value)) { diff --git a/NzbDrone.Core/DecisionEngine/Specifications/UpgradeHistorySpecification.cs b/NzbDrone.Core/DecisionEngine/Specifications/UpgradeHistorySpecification.cs index 6bdd6ad67..c17a10fc7 100644 --- a/NzbDrone.Core/DecisionEngine/Specifications/UpgradeHistorySpecification.cs +++ b/NzbDrone.Core/DecisionEngine/Specifications/UpgradeHistorySpecification.cs @@ -1,5 +1,6 @@ using NLog; using NzbDrone.Core.History; +using NzbDrone.Core.IndexerSearch.Definitions; using NzbDrone.Core.Parser.Model; namespace NzbDrone.Core.DecisionEngine.Specifications @@ -25,7 +26,7 @@ public string RejectionReason } } - public virtual bool IsSatisfiedBy(RemoteEpisode subject) + public virtual bool IsSatisfiedBy(RemoteEpisode subject, SearchCriteriaBase searchCriteriaBase) { foreach (var episode in subject.Episodes) { diff --git a/NzbDrone.Core/NzbDrone.Core.csproj b/NzbDrone.Core/NzbDrone.Core.csproj index 1ca328194..2ff65b46a 100644 --- a/NzbDrone.Core/NzbDrone.Core.csproj +++ b/NzbDrone.Core/NzbDrone.Core.csproj @@ -177,12 +177,11 @@ - - +