From 51d22bed2a19fc244d3f3320d34305f731e149e9 Mon Sep 17 00:00:00 2001 From: Bogdan Date: Sun, 18 Aug 2024 18:16:58 +0300 Subject: [PATCH] Include available version in update health check (cherry picked from commit 15e3c3efb18242caf28b9bfc77a72a78296018bf) (cherry picked from commit 3b29096e402c9a738b12ca8085b97924c52577f9) Closes #4949 Closes #5000 --- .../HealthCheck/Checks/UpdateCheck.cs | 16 ++++++++++++++-- src/NzbDrone.Core/Localization/Core/ca.json | 2 +- src/NzbDrone.Core/Localization/Core/de.json | 2 +- src/NzbDrone.Core/Localization/Core/el.json | 2 +- src/NzbDrone.Core/Localization/Core/en.json | 2 +- src/NzbDrone.Core/Localization/Core/es.json | 2 +- src/NzbDrone.Core/Localization/Core/fi.json | 2 +- src/NzbDrone.Core/Localization/Core/fr.json | 2 +- src/NzbDrone.Core/Localization/Core/hu.json | 2 +- src/NzbDrone.Core/Localization/Core/it.json | 2 +- src/NzbDrone.Core/Localization/Core/nl.json | 2 +- src/NzbDrone.Core/Localization/Core/pl.json | 2 +- src/NzbDrone.Core/Localization/Core/pt.json | 2 +- src/NzbDrone.Core/Localization/Core/pt_BR.json | 2 +- src/NzbDrone.Core/Localization/Core/ru.json | 2 +- src/NzbDrone.Core/Localization/Core/tr.json | 2 +- src/NzbDrone.Core/Localization/Core/uk.json | 2 +- src/NzbDrone.Core/Localization/Core/zh_CN.json | 2 +- 18 files changed, 31 insertions(+), 19 deletions(-) diff --git a/src/NzbDrone.Core/HealthCheck/Checks/UpdateCheck.cs b/src/NzbDrone.Core/HealthCheck/Checks/UpdateCheck.cs index bf77de8d7..aae6658ea 100644 --- a/src/NzbDrone.Core/HealthCheck/Checks/UpdateCheck.cs +++ b/src/NzbDrone.Core/HealthCheck/Checks/UpdateCheck.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using System.IO; using NzbDrone.Common.Disk; using NzbDrone.Common.EnvironmentInfo; @@ -68,9 +69,20 @@ 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("UpdateAvailable"), "#new-update-is-available"); + var latestAvailable = _checkUpdateService.AvailableUpdate(); + + if (latestAvailable != null) + { + return new HealthCheck(GetType(), + HealthCheckResult.Warning, + _localizationService.GetLocalizedString("UpdateAvailableHealthCheckMessage", new Dictionary + { + { "version", $"v{latestAvailable.Version}" } + }), + "#new-update-is-available"); + } } return new HealthCheck(GetType()); diff --git a/src/NzbDrone.Core/Localization/Core/ca.json b/src/NzbDrone.Core/Localization/Core/ca.json index 10ccb1c41..87b07c05f 100644 --- a/src/NzbDrone.Core/Localization/Core/ca.json +++ b/src/NzbDrone.Core/Localization/Core/ca.json @@ -658,7 +658,7 @@ "RootFolderCheckSingleMessage": "Falta la carpeta arrel: {0}", "SystemTimeCheckMessage": "L'hora del sistema està apagada durant més d'1 dia. És possible que les tasques programades no s'executin correctament fins que no es corregeixi l'hora", "CutoffFormatScoreHelpText": "Un cop s'arribi a aquesta puntuació de format personalitzat, {appName} ja no baixarà pel·lícules", - "UpdateAvailable": "Nova actualització disponible", + "UpdateAvailableHealthCheckMessage": "Nova actualització disponible", "ImportListStatusCheckSingleClientMessage": "Llistes no disponibles a causa d'errors: {0}", "ImportMechanismHealthCheckMessage": "Activa la gestió de baixades completades", "IndexerRssHealthCheckNoIndexers": "No hi ha indexadors disponibles amb la sincronització RSS activada, {appName} no capturarà les noves versions automàticament", diff --git a/src/NzbDrone.Core/Localization/Core/de.json b/src/NzbDrone.Core/Localization/Core/de.json index c90f2fa5a..1df123ee4 100644 --- a/src/NzbDrone.Core/Localization/Core/de.json +++ b/src/NzbDrone.Core/Localization/Core/de.json @@ -888,7 +888,7 @@ "ReplaceWithSpaceDash": "Mit Leerzeichen Bindestrich ersetzen", "RootFolderCheckSingleMessage": "Fehlender Stammordner: {0}", "RootFolderCheckMultipleMessage": "Es fehlen mehrere Stammordner: {0}", - "UpdateAvailable": "Neue Version verfügbar", + "UpdateAvailableHealthCheckMessage": "Neue Version verfügbar", "UpdateCheckStartupNotWritableMessage": "Update kann nicht installiert werden, da der Startordner '{0}' vom Benutzer '{1}' nicht beschreibbar ist.", "UpdateCheckStartupTranslocationMessage": "Update kann nicht installiert werden, da sich der Startordner '{0}' in einem App Translocation-Ordner befindet.", "UpdateCheckUINotWritableMessage": "Update kann nicht installiert werden, da der Benutzeroberflächenordner '{0}' vom Benutzer '{1}' nicht beschreibbar ist.", diff --git a/src/NzbDrone.Core/Localization/Core/el.json b/src/NzbDrone.Core/Localization/Core/el.json index 577e98bdd..d14c8c527 100644 --- a/src/NzbDrone.Core/Localization/Core/el.json +++ b/src/NzbDrone.Core/Localization/Core/el.json @@ -905,7 +905,7 @@ "ReplaceWithDash": "Αντικαταστήστε με Dash", "RootFolderCheckSingleMessage": "Λείπει ριζικός φάκελος: {0}", "SystemTimeCheckMessage": "Ο χρόνος συστήματος είναι απενεργοποιημένος για περισσότερο από 1 ημέρα. Οι προγραμματισμένες εργασίες ενδέχεται να μην εκτελούνται σωστά έως ότου διορθωθεί η ώρα", - "UpdateAvailable": "Νέα ενημέρωση είναι διαθέσιμη", + "UpdateAvailableHealthCheckMessage": "Νέα ενημέρωση είναι διαθέσιμη", "DownloadClientCheckNoneAvailableMessage": "Δεν υπάρχει διαθέσιμο πρόγραμμα Λήψης", "DownloadClientStatusCheckSingleClientMessage": "Προγράμματα λήψης που είναι μη διαθέσιμα λόγων αποτυχιών: {0}", "IndexerLongTermStatusCheckAllClientMessage": "Όλοι οι δείκτες δεν είναι διαθέσιμοι λόγω αστοχιών για περισσότερο από 6 ώρες", diff --git a/src/NzbDrone.Core/Localization/Core/en.json b/src/NzbDrone.Core/Localization/Core/en.json index 649257baa..466664174 100644 --- a/src/NzbDrone.Core/Localization/Core/en.json +++ b/src/NzbDrone.Core/Localization/Core/en.json @@ -1263,7 +1263,7 @@ "UnmonitoredOnly": "Unmonitored Only", "UpdateAll": "Update All", "UpdateAutomaticallyHelpText": "Automatically download and install updates. You will still be able to install from System: Updates", - "UpdateAvailable": "New update is available", + "UpdateAvailableHealthCheckMessage": "New update is available: {version}", "UpdateCheckStartupNotWritableMessage": "Cannot install update because startup folder '{0}' is not writable by the user '{1}'.", "UpdateCheckStartupTranslocationMessage": "Cannot install update because startup folder '{0}' is in an App Translocation folder.", "UpdateCheckUINotWritableMessage": "Cannot install update because UI folder '{0}' is not writable by the user '{1}'.", diff --git a/src/NzbDrone.Core/Localization/Core/es.json b/src/NzbDrone.Core/Localization/Core/es.json index 95614b326..2cbcc7f3a 100644 --- a/src/NzbDrone.Core/Localization/Core/es.json +++ b/src/NzbDrone.Core/Localization/Core/es.json @@ -656,7 +656,7 @@ "RootFolderCheckMultipleMessage": "Varias carpetas de origen no existen: {0}", "RootFolderCheckSingleMessage": "La carpeta de origen no existe: {0}", "SystemTimeCheckMessage": "El reloj del sistema está retrasado más de un día. Las tareas de mantenimiento no se ejecutarán correctamente hasta que se haya corregido", - "UpdateAvailable": "La nueva actualización está disponible", + "UpdateAvailableHealthCheckMessage": "La nueva actualización está disponible", "UpdateCheckStartupNotWritableMessage": "No se puede instalar la actualización porque la carpeta de arranque '{0}' no tiene permisos de escritura para el usuario '{1}'.", "UpdateCheckStartupTranslocationMessage": "No se puede instalar la actualización porque la carpeta de arranque '{0}' está en una carpeta de \"App Translocation\".", "ShownClickToHide": "Mostrado, haz clic para ocultar", diff --git a/src/NzbDrone.Core/Localization/Core/fi.json b/src/NzbDrone.Core/Localization/Core/fi.json index 51faf1702..f51f129f8 100644 --- a/src/NzbDrone.Core/Localization/Core/fi.json +++ b/src/NzbDrone.Core/Localization/Core/fi.json @@ -972,7 +972,7 @@ "DownloadClientRemovesCompletedDownloadsHealthCheckMessage": "Lataustyökalu \"{0}\" on määritetty poistamaan valmistuneet lataukset, jonka seuraksena ne saatetaan poistaa ennen kuin {1} ehtii tuoda niitä.", "Enabled": "Käytössä", "RemotePathMappingCheckLocalFolderMissing": "Etälataustyökalu \"{0}\" tallentaa lataukset kohteeseen \"{1}\", mutta sitä ei näytä olevan olemassa. Todennäköinen syy on puuttuva tai virheellinen etäsijainnin kohdistus.", - "UpdateAvailable": "Uusi päivitys on saatavilla", + "UpdateAvailableHealthCheckMessage": "Uusi päivitys on saatavilla", "UpdateMonitoring": "Päivitä valvontatila", "ApplyTagsHelpTextHowToApplyImportLists": "Tunnisteiden käyttö valituissa tuontilistoissa", "AutomaticUpdatesDisabledDocker": "Automaattisia päivityksiä ei tueta suoraan käytettäessä Dockerin päivitysmekanismia. Docker-säiliö on päivitettävä {appName}in ulkopuolella tai päivitys on suoritettava komentosarjalla.", diff --git a/src/NzbDrone.Core/Localization/Core/fr.json b/src/NzbDrone.Core/Localization/Core/fr.json index 0fad97553..6be83438d 100644 --- a/src/NzbDrone.Core/Localization/Core/fr.json +++ b/src/NzbDrone.Core/Localization/Core/fr.json @@ -745,7 +745,7 @@ "ThereWasAnErrorLoadingThisItem": "Une erreur s'est produite lors du chargement de cet élément", "ThereWasAnErrorLoadingThisPage": "Une erreur s'est produite lors du chargement de cette page", "UpdateCheckUINotWritableMessage": "Impossible d'installer la mise à jour car le dossier d'interface utilisateur '{0}' n'est pas accessible en écriture par l'utilisateur '{1}'.", - "UpdateAvailable": "Une nouvelle mise à jour est disponible", + "UpdateAvailableHealthCheckMessage": "Une nouvelle mise à jour est disponible", "UpdateCheckStartupNotWritableMessage": "Impossible d'installer la mise à jour car le dossier de démarrage '{0}' n'est pas accessible en écriture par l'utilisateur '{1}'.", "UpdateCheckStartupTranslocationMessage": "Impossible d'installer la mise à jour car le dossier de démarrage '{0}' se trouve dans un dossier App Translocation.", "DeleteRemotePathMapping": "Supprimer la correspondance de chemin distant", diff --git a/src/NzbDrone.Core/Localization/Core/hu.json b/src/NzbDrone.Core/Localization/Core/hu.json index b70352b60..7b3da4338 100644 --- a/src/NzbDrone.Core/Localization/Core/hu.json +++ b/src/NzbDrone.Core/Localization/Core/hu.json @@ -912,7 +912,7 @@ "RootFolderCheckMultipleMessage": "Több gyökérmappa hiányzik: {0}", "RootFolderCheckSingleMessage": "Hiányzó gyökérmappa: {0}", "SystemTimeCheckMessage": "A rendszeridő több mint 1 napja nem frissült. Előfordulhat, hogy az ütemezett feladatok az idő kijavításáig nem futnak megfelelően", - "UpdateAvailable": "Új frissítés elérhető", + "UpdateAvailableHealthCheckMessage": "Új frissítés elérhető", "UpdateCheckStartupNotWritableMessage": "A frissítés nem telepíthető, mert a (z) „{0}” indítási mappát a „{1}” felhasználó nem írhatja.", "UpdateCheckStartupTranslocationMessage": "Nem lehet telepíteni a frissítést, mert a (z) „{0}” indítási mappa az Alkalmazások Transzlokációs mappájában található.", "UpdateCheckUINotWritableMessage": "Nem lehet telepíteni a frissítést, mert a(z) „{0}” felhasználói felület mappát nem írhatja a „{1}” felhasználó.", diff --git a/src/NzbDrone.Core/Localization/Core/it.json b/src/NzbDrone.Core/Localization/Core/it.json index 385e9abb6..e44e32c90 100644 --- a/src/NzbDrone.Core/Localization/Core/it.json +++ b/src/NzbDrone.Core/Localization/Core/it.json @@ -731,7 +731,7 @@ "RootFolderCheckMultipleMessage": "Ci sono più cartelle radice mancanti: {0}", "RootFolderCheckSingleMessage": "Cartella radice mancante: {0}", "SystemTimeCheckMessage": "L'orario di sistema è sbagliato di più di un giorno. Le attività pianificate potrebbero non essere eseguite correttamente fino alla correzione", - "UpdateAvailable": "É disponibile un nuovo aggiornamento", + "UpdateAvailableHealthCheckMessage": "É disponibile un nuovo aggiornamento", "DeleteRemotePathMapping": "Elimina la Mappatura dei Percorsi Remoti", "BlocklistReleaseHelpText": "Impedisci a {appName} di re-acquisire automaticamente questa versione", "FailedToLoadQueue": "Impossibile caricare la coda", diff --git a/src/NzbDrone.Core/Localization/Core/nl.json b/src/NzbDrone.Core/Localization/Core/nl.json index a3dbcb481..d86944eff 100644 --- a/src/NzbDrone.Core/Localization/Core/nl.json +++ b/src/NzbDrone.Core/Localization/Core/nl.json @@ -665,7 +665,7 @@ "RootFolderCheckMultipleMessage": "Meerdere hoofdmappen ontbreken: {0}", "RootFolderCheckSingleMessage": "Ontbrekende hoofdmap: {0}", "SystemTimeCheckMessage": "De systeemtijd loopt verkeerd met meer dan 1 dag. Geplande taken worden mogelijk niet goed uitgevoerd tot dit is opgelost", - "UpdateAvailable": "Nieuwe update is beschikbaar", + "UpdateAvailableHealthCheckMessage": "Nieuwe update is beschikbaar", "UpdateCheckStartupNotWritableMessage": "Kan de update niet installeren omdat de map '{0}' niet schrijfbaar is voor de gebruiker '{1}'.", "UpdateCheckStartupTranslocationMessage": "Kan de update niet installeren omdat de map '{0}' zich in een 'App Translocation' map bevindt.", "UpdateCheckUINotWritableMessage": "Kan de update niet installeren omdat de UI map '{0}' niet schrijfbaar is voor de gebruiker '{1}'.", diff --git a/src/NzbDrone.Core/Localization/Core/pl.json b/src/NzbDrone.Core/Localization/Core/pl.json index 105b4182b..332a43d3a 100644 --- a/src/NzbDrone.Core/Localization/Core/pl.json +++ b/src/NzbDrone.Core/Localization/Core/pl.json @@ -658,7 +658,7 @@ "RootFolderCheckMultipleMessage": "Brakuje wielu folderów głównych: {0}", "RootFolderCheckSingleMessage": "Brak folderu głównego: {0}", "SystemTimeCheckMessage": "Czas systemowy jest wyłączony o więcej niż 1 dzień. Zaplanowane zadania mogą nie działać poprawnie, dopóki czas nie zostanie skorygowany", - "UpdateAvailable": "Dostępna jest aktualizacja", + "UpdateAvailableHealthCheckMessage": "Dostępna jest aktualizacja", "UpdateCheckStartupNotWritableMessage": "Nie można zainstalować aktualizacji, ponieważ użytkownik „{1}” nie ma prawa zapisu do folderu startowego „{0}”.", "Language": "Język", "DeleteRemotePathMapping": "Edytuj zdalne mapowanie ścieżki", diff --git a/src/NzbDrone.Core/Localization/Core/pt.json b/src/NzbDrone.Core/Localization/Core/pt.json index b2e69c442..e0d38c9a0 100644 --- a/src/NzbDrone.Core/Localization/Core/pt.json +++ b/src/NzbDrone.Core/Localization/Core/pt.json @@ -733,7 +733,7 @@ "RootFolderCheckMultipleMessage": "Múltiplas pastas raiz estão ausentes: {0}", "RootFolderCheckSingleMessage": "Pasta raiz não encontrada: {0}", "SystemTimeCheckMessage": "A hora do sistema está atrasada em mais de 1 dia. As tarefas agendadas podem não ocorrer corretamente até a hora ser corrigida", - "UpdateAvailable": "Nova atualização disponível", + "UpdateAvailableHealthCheckMessage": "Nova atualização disponível", "UpdateCheckStartupNotWritableMessage": "Não é possível instalar a atualização porque a pasta de arranque \"{0}\" não tem permissões de escrita para o utilizador \"{1}\".", "ApiKeyValidationHealthCheckMessage": "Por favor, atualize a sua API Key para ter no mínimo {0} caracteres. Pode fazer através das definições ou do ficheiro de configuração", "DeleteRemotePathMapping": "Editar mapeamento de caminho remoto", diff --git a/src/NzbDrone.Core/Localization/Core/pt_BR.json b/src/NzbDrone.Core/Localization/Core/pt_BR.json index ac34a22a2..aa79380fb 100644 --- a/src/NzbDrone.Core/Localization/Core/pt_BR.json +++ b/src/NzbDrone.Core/Localization/Core/pt_BR.json @@ -928,7 +928,7 @@ "SystemTimeCheckMessage": "A hora do sistema está desligada por mais de 1 dia. Tarefas agendadas podem não ser executadas corretamente até que o horário seja corrigido", "ThereWasAnErrorLoadingThisItem": "Ocorreu um erro ao carregar este item", "ThereWasAnErrorLoadingThisPage": "Ocorreu um erro ao carregar esta página", - "UpdateAvailable": "Nova atualização está disponível", + "UpdateAvailableHealthCheckMessage": "Nova atualização está disponível", "UpdateCheckStartupNotWritableMessage": "Não é possível instalar a atualização porque a pasta de inicialização '{0}' não pode ser gravada pelo usuário '{1}'.", "UpdateCheckStartupTranslocationMessage": "Não é possível instalar a atualização porque a pasta de inicialização '{0}' está em uma pasta de translocação de aplicativo.", "Total": "Total", diff --git a/src/NzbDrone.Core/Localization/Core/ru.json b/src/NzbDrone.Core/Localization/Core/ru.json index 57458034a..7951f1741 100644 --- a/src/NzbDrone.Core/Localization/Core/ru.json +++ b/src/NzbDrone.Core/Localization/Core/ru.json @@ -673,7 +673,7 @@ "SystemTimeCheckMessage": "Расхождение системного времени более чем на 1 день. Запланированные задачи могут работать некорректно, пока не будет исправлено время", "UnableToLoadCustomFormats": "Невозможно загрузить пользовательские форматы", "UnableToLoadInteractiveSearch": "Невозможно загрузить результаты поиска по этому фильму. Попробуйте позже", - "UpdateAvailable": "Доступно новое обновление", + "UpdateAvailableHealthCheckMessage": "Доступно новое обновление", "UpdateCheckStartupNotWritableMessage": "Невозможно установить обновление так как загрузочная папка '{0}' недоступна для записи для пользователя '{1}'.", "UpdateCheckStartupTranslocationMessage": "Не удается установить обновление, поскольку папка автозагрузки \"{0}\" находится в папке перемещения приложений.", "ApiKeyValidationHealthCheckMessage": "Пожалуйста, обновите свой ключ API, чтобы он был длиной не менее {0} символов. Вы можете сделать это через настройки или файл конфигурации", diff --git a/src/NzbDrone.Core/Localization/Core/tr.json b/src/NzbDrone.Core/Localization/Core/tr.json index 65122f8a8..6d6d9e4f4 100644 --- a/src/NzbDrone.Core/Localization/Core/tr.json +++ b/src/NzbDrone.Core/Localization/Core/tr.json @@ -926,7 +926,7 @@ "SizeLimit": "Boyut Limiti", "OnHealthRestored": "Sağlığın İyileştirilmesi Hakkında", "RemoveTagsAutomaticallyHelpText": "Koşullar karşılanmazsa otomatik etiketlemeyi kaldırın", - "UpdateAvailable": "Yeni güncelleme mevcut", + "UpdateAvailableHealthCheckMessage": "Yeni güncelleme mevcut", "NotificationsTelegramSettingsIncludeAppName": "{appName}'i Başlığa dahil et", "NotificationsTelegramSettingsIncludeAppNameHelpText": "Farklı uygulamalardan gelen bildirimleri ayırt etmek için isteğe bağlı olarak mesaj başlığının önüne {appName} ekleyin", "RemotePathMappingCheckImportFailed": "{appName} filmi içe aktaramadı. Ayrıntılar için günlüklerinizi kontrol edin.", diff --git a/src/NzbDrone.Core/Localization/Core/uk.json b/src/NzbDrone.Core/Localization/Core/uk.json index 2b8b12d8e..8c6874cf2 100644 --- a/src/NzbDrone.Core/Localization/Core/uk.json +++ b/src/NzbDrone.Core/Localization/Core/uk.json @@ -518,7 +518,7 @@ "AuthenticationRequired": "Потрібна Автентифікація", "Yesterday": "Вчора", "ArtistType": "Тип Виконавця", - "UpdateAvailable": "Доступне нове оновлення", + "UpdateAvailableHealthCheckMessage": "Доступне нове оновлення", "AddArtistWithName": "Додати {artistName}", "AddNewArtist": "Додати Нового Виконавця", "AddNewArtistSearchForMissingAlbums": "Почніть пошук відсутніх альбомів", diff --git a/src/NzbDrone.Core/Localization/Core/zh_CN.json b/src/NzbDrone.Core/Localization/Core/zh_CN.json index 88a0ce058..96455b6f8 100644 --- a/src/NzbDrone.Core/Localization/Core/zh_CN.json +++ b/src/NzbDrone.Core/Localization/Core/zh_CN.json @@ -913,7 +913,7 @@ "ThereWasAnErrorLoadingThisPage": "加载此页时出错", "UnableToLoadCustomFormats": "无法加载自定义格式", "UnableToLoadInteractiveSearch": "无法加载该专辑的搜索结果,请稍后重试", - "UpdateAvailable": "有新的更新可用", + "UpdateAvailableHealthCheckMessage": "有新的更新可用", "UpdateCheckStartupNotWritableMessage": "无法安装更新,因为用户“{1}”对于启动文件夹“{0}”没有写入权限。", "UpdateCheckStartupTranslocationMessage": "无法安装更新,因为启动文件夹“{0}”在一个应用程序迁移文件夹。Cannot install update because startup folder '{0}' is in an App Translocation folder.", "UpdateCheckUINotWritableMessage": "无法安装升级,因为用户“{1}”不可写入界面文件夹“{0}”。",