diff --git a/NzbDrone.Core.Test/JobTests/SeriesSearchJobTest.cs b/NzbDrone.Core.Test/JobTests/SeriesSearchJobTest.cs index 72b4ce867..4733718bc 100644 --- a/NzbDrone.Core.Test/JobTests/SeriesSearchJobTest.cs +++ b/NzbDrone.Core.Test/JobTests/SeriesSearchJobTest.cs @@ -61,5 +61,19 @@ public void SeriesSearch_no_seasons() mocker.GetMock().Verify(c => c.Start(notification, 1, It.IsAny()), Times.Never()); } + + [Test] + public void SeriesSearch_should_not_search_for_season_0() + { + Mocker.GetMock() + .Setup(c => c.GetSeasons(It.IsAny())) + .Returns(new List { 0, 1, 2 }); + + Mocker.Resolve().Start(MockNotification, 12, 0); + + + Mocker.GetMock() + .Verify(c => c.Start(It.IsAny(), It.IsAny(), 0), Times.Never()); + } } } \ No newline at end of file diff --git a/NzbDrone.Core/Providers/Jobs/SeriesSearchJob.cs b/NzbDrone.Core/Providers/Jobs/SeriesSearchJob.cs index 2de0d0324..0debaf775 100644 --- a/NzbDrone.Core/Providers/Jobs/SeriesSearchJob.cs +++ b/NzbDrone.Core/Providers/Jobs/SeriesSearchJob.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Linq; using NLog; using NzbDrone.Core.Model; using NzbDrone.Core.Model.Notification; @@ -36,7 +37,7 @@ public void Start(ProgressNotification notification, int targetId, int secondary throw new ArgumentOutOfRangeException("targetId"); Logger.Debug("Getting seasons from database for series: {0}", targetId); - var seasons = _episodeProvider.GetSeasons(targetId); + var seasons = _episodeProvider.GetSeasons(targetId).Where(s => s > 0); foreach (var season in seasons) {