mirror of
https://github.com/Prowlarr/Prowlarr
synced 2025-12-06 16:43:25 +01:00
Include available version in update health check
(cherry picked from commit 15e3c3efb18242caf28b9bfc77a72a78296018bf)
This commit is contained in:
parent
eec3b01f5b
commit
c22b27525a
2 changed files with 14 additions and 3 deletions
|
|
@ -86,9 +86,20 @@ public override HealthCheck Check()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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}" }
|
||||||
|
}),
|
||||||
|
"#new-update-is-available");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return new HealthCheck(GetType());
|
return new HealthCheck(GetType());
|
||||||
|
|
|
||||||
|
|
@ -740,7 +740,7 @@
|
||||||
"UnsavedChanges": "Unsaved Changes",
|
"UnsavedChanges": "Unsaved Changes",
|
||||||
"UnselectAll": "Unselect All",
|
"UnselectAll": "Unselect All",
|
||||||
"UpdateAutomaticallyHelpText": "Automatically download and install updates. You will still be able to install from System: Updates",
|
"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}",
|
||||||
"UpdateMechanismHelpText": "Use {appName}'s built-in updater or a script",
|
"UpdateMechanismHelpText": "Use {appName}'s built-in updater or a script",
|
||||||
"UpdateScriptPathHelpText": "Path to a custom script that takes an extracted update package and handle the remainder of the update process",
|
"UpdateScriptPathHelpText": "Path to a custom script that takes an extracted update package and handle the remainder of the update process",
|
||||||
"UpdateStartupNotWritableHealthCheckMessage": "Cannot install update because startup folder '{startupFolder}' is not writable by the user '{userName}'.",
|
"UpdateStartupNotWritableHealthCheckMessage": "Cannot install update because startup folder '{startupFolder}' is not writable by the user '{userName}'.",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue