From dc552ec873daac6f0dd0d75eb2700a89161186d8 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Thu, 24 Mar 2011 00:16:22 -0700 Subject: [PATCH] SeasonProvider.IsIgnored will properly handle a season that does not exist in the DB (TV DB doesn't have the latest season is root of the problem, or the season just started and NB DB is out of date). --- NzbDrone.Core/Providers/SeasonProvider.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/NzbDrone.Core/Providers/SeasonProvider.cs b/NzbDrone.Core/Providers/SeasonProvider.cs index f43418503..21eaa2a8c 100644 --- a/NzbDrone.Core/Providers/SeasonProvider.cs +++ b/NzbDrone.Core/Providers/SeasonProvider.cs @@ -65,11 +65,12 @@ namespace NzbDrone.Core.Providers public bool IsIgnored(int seriesId, int seasonNumber) { - if (_sonicRepo.Single(s => s.SeriesId == seriesId && s.SeasonNumber == seasonNumber).Monitored) - return false; + var season = _sonicRepo.Single(s => s.SeriesId == seriesId && s.SeasonNumber == seasonNumber); - Logger.Debug("Season: {0} is not wanted for Series: {1}", seasonNumber, seriesId); - return true; + if (season == null) + return true; + + return season.Monitored; } public void DeleteSeason(int seasonId)