Prevent should refresh artists and albums from failing

(cherry picked from commit 3eed84c67938fed308e562e69cf7bcd727063803)
This commit is contained in:
Mark McDowall 2025-05-21 17:17:19 -07:00 committed by Bogdan
parent ae9b4cec75
commit 1bcb82eed0
2 changed files with 55 additions and 39 deletions

View file

@ -18,6 +18,8 @@ namespace NzbDrone.Core.Music
}
public bool ShouldRefresh(Album album)
{
try
{
if (album.LastInfoSync < DateTime.UtcNow.AddDays(-60))
{
@ -40,5 +42,11 @@ namespace NzbDrone.Core.Music
_logger.Trace("Album {0} released long ago and recently refreshed, should not be refreshed.", album.Title);
return false;
}
catch (Exception e)
{
_logger.Error(e, "Unable to determine if album should refresh, will try to refresh.");
return true;
}
}
}
}

View file

@ -21,6 +21,8 @@ namespace NzbDrone.Core.Music
}
public bool ShouldRefresh(Artist artist)
{
try
{
if (artist.LastInfoSync == null)
{
@ -57,5 +59,11 @@ namespace NzbDrone.Core.Music
_logger.Trace("Artist {0} ended long ago, should not be refreshed.", artist.Name);
return false;
}
catch (Exception e)
{
_logger.Error(e, "Unable to determine if artist should refresh, will try to refresh.");
return true;
}
}
}
}