mirror of
https://github.com/Sonarr/Sonarr.git
synced 2026-04-19 21:46:43 -04:00
Prevent should refresh series from failing
Fixed: Prevent error checking if series should be refreshed from failing refresh series task
This commit is contained in:
@@ -22,6 +22,8 @@ namespace NzbDrone.Core.Tv
|
||||
}
|
||||
|
||||
public bool ShouldRefresh(Series series)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (series.LastInfoSync < DateTime.UtcNow.AddDays(-30))
|
||||
{
|
||||
@@ -38,13 +40,15 @@ namespace NzbDrone.Core.Tv
|
||||
|
||||
if (atLeastOneAiredEpisodeWithoutTitle)
|
||||
{
|
||||
_logger.Trace("Series {0} with at least one aired episode with TBA title, should refresh.", series.Title);
|
||||
_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);
|
||||
_logger.Trace("Series {0} last updated less than 6 hours ago, should not be refreshed.",
|
||||
series.Title);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -65,5 +69,11 @@ namespace NzbDrone.Core.Tv
|
||||
_logger.Trace("Series {0} ended long ago, should not be refreshed.", series.Title);
|
||||
return false;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
_logger.Error(e, "Unable to determine if series should refresh, will try to refresh.");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user