1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-10-05 15:47:20 +02:00

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

View File

@ -65,11 +65,12 @@ public bool IsIgnored(int seasonId)
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)