Don't search for episodes in series that haven't aired yet

pull/4/head
Mark McDowall 10 years ago
parent d4a4a4095e
commit c9d21c7863

@ -104,6 +104,7 @@ namespace NzbDrone.Core.Test.ParserTests
[TestCase("Entourage - S02E02 - My Maserati Does 185", "Entourage", 2, 2)] [TestCase("Entourage - S02E02 - My Maserati Does 185", "Entourage", 2, 2)]
[TestCase("6x13 - The Family Guy 100th Episode Special", "", 6, 13)] [TestCase("6x13 - The Family Guy 100th Episode Special", "", 6, 13)]
// [TestCase("Heroes - S01E01 - Genesis 101 [HDTV-720p]", "Heroes", 1, 1)] // [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)] //[TestCase("", "", 0, 0)]
public void should_parse_single_episode(string postTitle, string title, int seasonNumber, int episodeNumber) public void should_parse_single_episode(string postTitle, string title, int seasonNumber, int episodeNumber)
{ {

@ -115,7 +115,10 @@ namespace NzbDrone.Core.IndexerSearch
if (message.SeriesId > 0) if (message.SeriesId > 0)
{ {
episodes = _episodeService.GetEpisodeBySeries(message.SeriesId) 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(); .ToList();
} }

Loading…
Cancel
Save