From 8927a938b7bcccc212b80982a4a9e439abde61d9 Mon Sep 17 00:00:00 2001 From: "kay.one" Date: Sun, 10 Jul 2011 13:07:42 -0700 Subject: [PATCH] Fixed episode status of recently imported episodes. --- NzbDrone.Core.Test/EpisodeStatusTest.cs | 4 ++-- NzbDrone.Core.Test/IndexerTests.cs | 1 + NzbDrone.Core/Repository/Episode.cs | 8 ++++---- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/NzbDrone.Core.Test/EpisodeStatusTest.cs b/NzbDrone.Core.Test/EpisodeStatusTest.cs index c4c551015..0861042c2 100644 --- a/NzbDrone.Core.Test/EpisodeStatusTest.cs +++ b/NzbDrone.Core.Test/EpisodeStatusTest.cs @@ -61,8 +61,8 @@ namespace NzbDrone.Core.Test [TestCase(1, false, false, EpisodeStatusType.Downloading)] [TestCase(-2, false, false, EpisodeStatusType.Downloading)] - [TestCase(1, true, false, EpisodeStatusType.Downloading)] - [TestCase(1, true, true, EpisodeStatusType.Downloading)] + [TestCase(1, true, false, EpisodeStatusType.Ready)] + [TestCase(1, true, true, EpisodeStatusType.Ready)] [TestCase(1, false, true, EpisodeStatusType.Downloading)] public void recent_grab_date(int offsetDays, bool hasEpisodes, bool ignored, EpisodeStatusType status) diff --git a/NzbDrone.Core.Test/IndexerTests.cs b/NzbDrone.Core.Test/IndexerTests.cs index 90522688a..93df7243b 100644 --- a/NzbDrone.Core.Test/IndexerTests.cs +++ b/NzbDrone.Core.Test/IndexerTests.cs @@ -212,6 +212,7 @@ namespace NzbDrone.Core.Test [TestCase("simpsons", 21, 23)] [TestCase("Hawaii Five-0 (2010)", 1, 1)] + [TestCase("In plain Sight", 1, 11)] public void newzbin_search_returns_valid_results(string title, int season, int episode) { var mocker = new AutoMoqer(); diff --git a/NzbDrone.Core/Repository/Episode.cs b/NzbDrone.Core/Repository/Episode.cs index 18b6173f4..be18a06d2 100644 --- a/NzbDrone.Core/Repository/Episode.cs +++ b/NzbDrone.Core/Repository/Episode.cs @@ -37,14 +37,14 @@ namespace NzbDrone.Core.Repository { get { + + if (EpisodeFileId != 0) return EpisodeStatusType.Ready; + if (GrabDate != null && GrabDate.Value.AddDays(1) >= DateTime.Now) { return EpisodeStatusType.Downloading; } - - if (EpisodeFileId != 0) return EpisodeStatusType.Ready; - - + if (Ignored) return EpisodeStatusType.Ignored; if (AirDate != null && AirDate.Value.Date < DateTime.Now)