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).

This commit is contained in:
Mark McDowall 2011-03-24 00:16:22 -07:00
parent 7a57ab98dc
commit dc552ec873
1 changed files with 5 additions and 4 deletions

View File

@ -65,11 +65,12 @@ namespace NzbDrone.Core.Providers
public bool IsIgnored(int seriesId, int seasonNumber)
{
if (_sonicRepo.Single<Season>(s => s.SeriesId == seriesId && s.SeasonNumber == seasonNumber).Monitored)
return false;
var season = _sonicRepo.Single<Season>(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)