From c9d21c78631358fb0602256bb100b5bba2f72744 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Wed, 4 Feb 2015 22:52:07 -0800 Subject: [PATCH] Don't search for episodes in series that haven't aired yet --- .../ParserTests/SingleEpisodeParserFixture.cs | 1 + src/NzbDrone.Core/IndexerSearch/EpisodeSearchService.cs | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/NzbDrone.Core.Test/ParserTests/SingleEpisodeParserFixture.cs b/src/NzbDrone.Core.Test/ParserTests/SingleEpisodeParserFixture.cs index e6e162779..6f0bee6d8 100644 --- a/src/NzbDrone.Core.Test/ParserTests/SingleEpisodeParserFixture.cs +++ b/src/NzbDrone.Core.Test/ParserTests/SingleEpisodeParserFixture.cs @@ -104,6 +104,7 @@ public class SingleEpisodeParserFixture : CoreTest [TestCase("Entourage - S02E02 - My Maserati Does 185", "Entourage", 2, 2)] [TestCase("6x13 - The Family Guy 100th Episode Special", "", 6, 13)] // [TestCase("Heroes - S01E01 - Genesis 101 [HDTV-720p]", "Heroes", 1, 1)] + [TestCase("The 100 S02E01 HDTV x264-KILLERS [eztv]", "The 100", 2, 1)] //[TestCase("", "", 0, 0)] public void should_parse_single_episode(string postTitle, string title, int seasonNumber, int episodeNumber) { diff --git a/src/NzbDrone.Core/IndexerSearch/EpisodeSearchService.cs b/src/NzbDrone.Core/IndexerSearch/EpisodeSearchService.cs index 21622d7a6..69feba183 100644 --- a/src/NzbDrone.Core/IndexerSearch/EpisodeSearchService.cs +++ b/src/NzbDrone.Core/IndexerSearch/EpisodeSearchService.cs @@ -115,7 +115,10 @@ public void Execute(MissingEpisodeSearchCommand message) if (message.SeriesId > 0) { episodes = _episodeService.GetEpisodeBySeries(message.SeriesId) - .Where(e => e.Monitored && !e.HasFile) + .Where(e => e.Monitored && + !e.HasFile && + e.AirDateUtc.HasValue && + e.AirDateUtc.Value.Before(DateTime.UtcNow)) .ToList(); }