Search improvements

New: Series/Season search will not grab unmonitored episodes
Fixed: Missing episode search won't grab missing unmonitored episodes by mistake
pull/3113/head
Mark McDowall 10 years ago
parent 32dd545ef9
commit 37959fd753

@ -105,10 +105,23 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
} }
[Test] [Test]
public void should_return_true_if_it_is_a_search() public void should_return_true_for_single_episode_search()
{ {
_fakeSeries.Monitored = false; _fakeSeries.Monitored = false;
_monitoredEpisodeSpecification.IsSatisfiedBy(_parseResultMulti, new SeasonSearchCriteria()).Accepted.Should().BeTrue(); _monitoredEpisodeSpecification.IsSatisfiedBy(_parseResultSingle, new SingleEpisodeSearchCriteria()).Accepted.Should().BeTrue();
}
[Test]
public void should_return_true_if_episode_is_monitored_for_season_search()
{
_monitoredEpisodeSpecification.IsSatisfiedBy(_parseResultSingle, new SeasonSearchCriteria()).Accepted.Should().BeTrue();
}
[Test]
public void should_return_false_if_episode_is_not_monitored_for_season_search()
{
WithFirstEpisodeUnmonitored();
_monitoredEpisodeSpecification.IsSatisfiedBy(_parseResultSingle, new SeasonSearchCriteria()).Accepted.Should().BeFalse();
} }
} }
} }

@ -19,10 +19,13 @@ namespace NzbDrone.Core.DecisionEngine.Specifications.RssSync
public virtual Decision IsSatisfiedBy(RemoteEpisode subject, SearchCriteriaBase searchCriteria) public virtual Decision IsSatisfiedBy(RemoteEpisode subject, SearchCriteriaBase searchCriteria)
{ {
if (searchCriteria != null) if (searchCriteria != null)
{
if ((searchCriteria as SeasonSearchCriteria) == null)
{ {
_logger.Debug("Skipping monitored check during search"); _logger.Debug("Skipping monitored check during search");
return Decision.Accept(); return Decision.Accept();
} }
}
if (!subject.Series.Monitored) if (!subject.Series.Monitored)
{ {

@ -35,7 +35,7 @@ namespace NzbDrone.Core.IndexerSearch
{ {
if (!season.Monitored) if (!season.Monitored)
{ {
_logger.Debug("Season {0} of {1} is not monitored, skipping seaarch", season.SeasonNumber, series.Title); _logger.Debug("Season {0} of {1} is not monitored, skipping search", season.SeasonNumber, series.Title);
continue; continue;
} }

Loading…
Cancel
Save