Include available version in update health check

This commit is contained in:
Bogdan 2024-07-28 00:48:39 +03:00 committed by Mark McDowall
parent f2f4a98eed
commit 15e3c3efb1
2 changed files with 13 additions and 3 deletions

View File

@ -86,9 +86,19 @@ namespace NzbDrone.Core.HealthCheck.Checks
}
}
if (BuildInfo.BuildDateTime < DateTime.UtcNow.AddDays(-14) && _checkUpdateService.AvailableUpdate() != null)
if (BuildInfo.BuildDateTime < DateTime.UtcNow.AddDays(-14))
{
return new HealthCheck(GetType(), HealthCheckResult.Warning, _localizationService.GetLocalizedString("UpdateAvailableHealthCheckMessage"));
var latestAvailable = _checkUpdateService.AvailableUpdate();
if (latestAvailable != null)
{
return new HealthCheck(GetType(),
HealthCheckResult.Warning,
_localizationService.GetLocalizedString("UpdateAvailableHealthCheckMessage", new Dictionary<string, object>
{
{ "version", $"v{latestAvailable.Version}" }
}));
}
}
return new HealthCheck(GetType());

View File

@ -2037,7 +2037,7 @@
"UpcomingSeriesDescription": "Series has been announced but no exact air date yet",
"UpdateAll": "Update All",
"UpdateAutomaticallyHelpText": "Automatically download and install updates. You will still be able to install from System: Updates",
"UpdateAvailableHealthCheckMessage": "New update is available",
"UpdateAvailableHealthCheckMessage": "New update is available: {version}",
"UpdateFiltered": "Update Filtered",
"UpdateMechanismHelpText": "Use {appName}'s built-in updater or a script",
"UpdateMonitoring": "Update Monitoring",