mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-05 20:42:19 -07:00
Prevent should refresh artists and albums from failing
(cherry picked from commit 3eed84c67938fed308e562e69cf7bcd727063803)
This commit is contained in:
parent
ae9b4cec75
commit
1bcb82eed0
2 changed files with 55 additions and 39 deletions
|
@ -18,6 +18,8 @@ namespace NzbDrone.Core.Music
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool ShouldRefresh(Album album)
|
public bool ShouldRefresh(Album album)
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
if (album.LastInfoSync < DateTime.UtcNow.AddDays(-60))
|
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);
|
_logger.Trace("Album {0} released long ago and recently refreshed, should not be refreshed.", album.Title);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
_logger.Error(e, "Unable to determine if album should refresh, will try to refresh.");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,6 +21,8 @@ namespace NzbDrone.Core.Music
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool ShouldRefresh(Artist artist)
|
public bool ShouldRefresh(Artist artist)
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
if (artist.LastInfoSync == null)
|
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);
|
_logger.Trace("Artist {0} ended long ago, should not be refreshed.", artist.Name);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
_logger.Error(e, "Unable to determine if artist should refresh, will try to refresh.");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue