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

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

@ -37,6 +37,7 @@ namespace NzbDrone.Core.Test.IndexerSearchTests
_xemSeries = Builder<Series>.CreateNew()
.With(v => v.UseSceneNumbering = true)
.With(v => v.Monitored = true)
.Build();
_xemEpisodes = new List<Episode>();
@ -63,6 +64,7 @@ namespace NzbDrone.Core.Test.IndexerSearchTests
.With(v => v.EpisodeNumber, episodeNumber)
.With(v => v.SceneSeasonNumber, sceneSeasonNumber)
.With(v => v.SceneEpisodeNumber, sceneEpisodeNumber)
.With(v => v.Monitored = true)
.Build();
_xemEpisodes.Add(episode);
@ -196,12 +198,12 @@ namespace NzbDrone.Core.Test.IndexerSearchTests
}
[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();
_xemSeries.SeriesType = SeriesTypes.Anime;
var seasonNumber = 1;
var seasonNumber = 1;
var allCriteria = WatchForSearchCriteria();
Subject.SeasonSearch(_xemSeries.Id, seasonNumber);
@ -210,5 +212,22 @@ namespace NzbDrone.Core.Test.IndexerSearchTests
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);
}
}
}

@ -217,7 +217,10 @@ namespace NzbDrone.Core.IndexerSearch
foreach (var episode in episodes)
{
downloadDecisions.AddRange(SearchAnime(series, episode));
if (episode.Monitored)
{
downloadDecisions.AddRange(SearchAnime(series, episode));
}
}
return downloadDecisions;

Loading…
Cancel
Save