diff --git a/src/NzbDrone.Core/Tv/ShouldRefreshSeries.cs b/src/NzbDrone.Core/Tv/ShouldRefreshSeries.cs index 7918d1ba0..f89687394 100644 --- a/src/NzbDrone.Core/Tv/ShouldRefreshSeries.cs +++ b/src/NzbDrone.Core/Tv/ShouldRefreshSeries.cs @@ -1,6 +1,7 @@ using System; using System.Linq; using NLog; +using NzbDrone.Common.Extensions; namespace NzbDrone.Core.Tv { @@ -28,6 +29,19 @@ namespace NzbDrone.Core.Tv return true; } + var episodes = _episodeService.GetEpisodeBySeries(series.Id); + + var atLeastOneAiredEpisodeWithoutTitle = episodes.Any(e => + e.SeasonNumber > 0 && + e.AirDateUtc.HasValue && e.AirDateUtc.Value.Before(DateTime.UtcNow) && + e.Title.Equals("TBA", StringComparison.Ordinal)); + + if (atLeastOneAiredEpisodeWithoutTitle) + { + _logger.Trace("Series {0} with at least one aired episode with TBA title, should refresh.", series.Title); + return true; + } + if (series.LastInfoSync >= DateTime.UtcNow.AddHours(-6)) { _logger.Trace("Series {0} last updated less than 6 hours ago, should not be refreshed.", series.Title); @@ -40,7 +54,7 @@ namespace NzbDrone.Core.Tv return true; } - var lastEpisode = _episodeService.GetEpisodeBySeries(series.Id).MaxBy(e => e.AirDateUtc); + var lastEpisode = episodes.MaxBy(e => e.AirDateUtc); if (lastEpisode != null && lastEpisode.AirDateUtc > DateTime.UtcNow.AddDays(-30)) {