1
0
mirror of https://github.com/Radarr/Radarr.git synced 2026-04-25 22:37:27 -04:00

New: Translations support for Health Checks

This commit is contained in:
Qstick
2020-07-08 10:40:08 -04:00
parent 200c7487b9
commit bfc0361784
36 changed files with 247 additions and 72 deletions
@@ -1,5 +1,6 @@
using NzbDrone.Common.Extensions;
using NzbDrone.Common.Extensions;
using NzbDrone.Core.Indexers;
using NzbDrone.Core.Localization;
using NzbDrone.Core.ThingiProvider.Events;
namespace NzbDrone.Core.HealthCheck.Checks
@@ -12,7 +13,8 @@ namespace NzbDrone.Core.HealthCheck.Checks
{
private readonly IIndexerFactory _indexerFactory;
public IndexerSearchCheck(IIndexerFactory indexerFactory)
public IndexerSearchCheck(IIndexerFactory indexerFactory, ILocalizationService localizationService)
: base(localizationService)
{
_indexerFactory = indexerFactory;
}
@@ -23,21 +25,21 @@ namespace NzbDrone.Core.HealthCheck.Checks
if (automaticSearchEnabled.Empty())
{
return new HealthCheck(GetType(), HealthCheckResult.Warning, "No indexers available with Automatic Search enabled, Radarr will not provide any automatic search results");
return new HealthCheck(GetType(), HealthCheckResult.Warning, _localizationService.GetLocalizedString("IndexerSearchCheckNoAutomaticMessage"));
}
var interactiveSearchEnabled = _indexerFactory.InteractiveSearchEnabled(false);
if (interactiveSearchEnabled.Empty())
{
return new HealthCheck(GetType(), HealthCheckResult.Warning, "No indexers available with Interactive Search enabled, Radarr will not provide any interactive search results");
return new HealthCheck(GetType(), HealthCheckResult.Warning, _localizationService.GetLocalizedString("IndexerSearchCheckNoInteractiveMessage"));
}
var active = _indexerFactory.AutomaticSearchEnabled(true);
if (active.Empty())
{
return new HealthCheck(GetType(), HealthCheckResult.Warning, "All search-capable indexers are temporarily unavailable due to recent indexer errors");
return new HealthCheck(GetType(), HealthCheckResult.Warning, _localizationService.GetLocalizedString("IndexerSearchCheckNoAvailableIndexersMessage"));
}
return new HealthCheck(GetType());