Fixed: Searching for unmonitored anime episodes during season/all missing searches

pull/3113/head
Mark McDowall 10 years ago
parent adfaa00ce1
commit 90b047f0d4

@ -37,6 +37,7 @@ namespace NzbDrone.Core.Test.IndexerSearchTests
_xemSeries = Builder<Series>.CreateNew() _xemSeries = Builder<Series>.CreateNew()
.With(v => v.UseSceneNumbering = true) .With(v => v.UseSceneNumbering = true)
.With(v => v.Monitored = true)
.Build(); .Build();
_xemEpisodes = new List<Episode>(); _xemEpisodes = new List<Episode>();
@ -63,6 +64,7 @@ namespace NzbDrone.Core.Test.IndexerSearchTests
.With(v => v.EpisodeNumber, episodeNumber) .With(v => v.EpisodeNumber, episodeNumber)
.With(v => v.SceneSeasonNumber, sceneSeasonNumber) .With(v => v.SceneSeasonNumber, sceneSeasonNumber)
.With(v => v.SceneEpisodeNumber, sceneEpisodeNumber) .With(v => v.SceneEpisodeNumber, sceneEpisodeNumber)
.With(v => v.Monitored = true)
.Build(); .Build();
_xemEpisodes.Add(episode); _xemEpisodes.Add(episode);
@ -196,12 +198,12 @@ namespace NzbDrone.Core.Test.IndexerSearchTests
} }
[Test] [Test]
public void season_search_for_anime_should_search_for_each_episode() public void season_search_for_anime_should_search_for_each_monitored_episode()
{ {
WithEpisodes(); WithEpisodes();
_xemSeries.SeriesType = SeriesTypes.Anime; _xemSeries.SeriesType = SeriesTypes.Anime;
var seasonNumber = 1;
var seasonNumber = 1;
var allCriteria = WatchForSearchCriteria(); var allCriteria = WatchForSearchCriteria();
Subject.SeasonSearch(_xemSeries.Id, seasonNumber); Subject.SeasonSearch(_xemSeries.Id, seasonNumber);
@ -210,5 +212,22 @@ namespace NzbDrone.Core.Test.IndexerSearchTests
criteria.Count.Should().Be(_xemEpisodes.Count(e => e.SeasonNumber == seasonNumber)); criteria.Count.Should().Be(_xemEpisodes.Count(e => e.SeasonNumber == seasonNumber));
} }
[Test]
public void season_search_for_anime_should_not_search_for_unmonitored_episodes()
{
WithEpisodes();
_xemSeries.SeriesType = SeriesTypes.Anime;
_xemEpisodes.ForEach(e => e.Monitored = false);
var seasonNumber = 1;
var allCriteria = WatchForSearchCriteria();
Subject.SeasonSearch(_xemSeries.Id, seasonNumber);
var criteria = allCriteria.OfType<AnimeEpisodeSearchCriteria>().ToList();
criteria.Count.Should().Be(0);
}
} }
} }

@ -216,9 +216,12 @@ namespace NzbDrone.Core.IndexerSearch
var downloadDecisions = new List<DownloadDecision>(); var downloadDecisions = new List<DownloadDecision>();
foreach (var episode in episodes) foreach (var episode in episodes)
{
if (episode.Monitored)
{ {
downloadDecisions.AddRange(SearchAnime(series, episode)); downloadDecisions.AddRange(SearchAnime(series, episode));
} }
}
return downloadDecisions; return downloadDecisions;
} }

Loading…
Cancel
Save