1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-16 11:37:58 +02:00

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

This commit is contained in:
Mark McDowall 2015-02-04 22:52:07 -08:00
parent d4a4a4095e
commit c9d21c7863
2 changed files with 5 additions and 1 deletions

View File

@ -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)
{

View File

@ -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();
}