1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-05 02:22:31 +01:00

Search improvements

New: Series/Season search will not grab unmonitored episodes
Fixed: Missing episode search won't grab missing unmonitored episodes by mistake
This commit is contained in:
Mark McDowall 2015-02-10 17:19:15 -08:00
parent 32dd545ef9
commit 37959fd753
3 changed files with 21 additions and 5 deletions

View File

@ -105,10 +105,23 @@ public void only_second_episode_not_monitored_should_return_monitored()
}
[Test]
public void should_return_true_if_it_is_a_search()
public void should_return_true_for_single_episode_search()
{
_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();
}
}
}

View File

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

View File

@ -35,7 +35,7 @@ public void Execute(SeriesSearchCommand message)
{
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;
}