From ea8ceaebb35737afed43ee51be779b59637ea1c5 Mon Sep 17 00:00:00 2001 From: Qstick Date: Tue, 23 Mar 2021 21:58:06 -0400 Subject: [PATCH] Fixed: Rework RSS Check to Enabled Check --- ...CheckFixture.cs => IndexerCheckFixture.cs} | 22 +------------------ .../{IndexerRssCheck.cs => IndexerCheck.cs} | 13 +++-------- src/NzbDrone.Core/Localization/Core/en.json | 3 +-- 3 files changed, 5 insertions(+), 33 deletions(-) rename src/NzbDrone.Core.Test/HealthCheck/Checks/{IndexerRssCheckFixture.cs => IndexerCheckFixture.cs} (76%) rename src/NzbDrone.Core/HealthCheck/Checks/{IndexerRssCheck.cs => IndexerCheck.cs} (62%) diff --git a/src/NzbDrone.Core.Test/HealthCheck/Checks/IndexerRssCheckFixture.cs b/src/NzbDrone.Core.Test/HealthCheck/Checks/IndexerCheckFixture.cs similarity index 76% rename from src/NzbDrone.Core.Test/HealthCheck/Checks/IndexerRssCheckFixture.cs rename to src/NzbDrone.Core.Test/HealthCheck/Checks/IndexerCheckFixture.cs index c311fe199..a409908d7 100644 --- a/src/NzbDrone.Core.Test/HealthCheck/Checks/IndexerRssCheckFixture.cs +++ b/src/NzbDrone.Core.Test/HealthCheck/Checks/IndexerCheckFixture.cs @@ -9,7 +9,7 @@ using NzbDrone.Core.Test.Framework; namespace NzbDrone.Core.Test.HealthCheck.Checks { [TestFixture] - public class IndexerRssCheckFixture : CoreTest + public class IndexerCheckFixture : CoreTest { private Mock _indexerMock; @@ -47,17 +47,6 @@ namespace NzbDrone.Core.Test.HealthCheck.Checks .Returns(new List { _indexerMock.Object }); } - private void GivenRssFiltered() - { - Mocker.GetMock() - .Setup(s => s.Enabled(false)) - .Returns(new List { _indexerMock.Object }); - - Mocker.GetMock() - .Setup(s => s.GetLocalizedString(It.IsAny())) - .Returns("recent indexer errors"); - } - [Test] public void should_return_error_when_no_indexer_present() { @@ -88,14 +77,5 @@ namespace NzbDrone.Core.Test.HealthCheck.Checks Subject.Check().ShouldBeError(); } - - [Test] - public void should_return_filter_warning_if_rss_is_enabled_but_filtered() - { - GivenIndexer(true, false); - GivenRssFiltered(); - - Subject.Check().ShouldBeWarning("recent indexer errors"); - } } } diff --git a/src/NzbDrone.Core/HealthCheck/Checks/IndexerRssCheck.cs b/src/NzbDrone.Core/HealthCheck/Checks/IndexerCheck.cs similarity index 62% rename from src/NzbDrone.Core/HealthCheck/Checks/IndexerRssCheck.cs rename to src/NzbDrone.Core/HealthCheck/Checks/IndexerCheck.cs index 32a0a14bc..f25db9b15 100644 --- a/src/NzbDrone.Core/HealthCheck/Checks/IndexerRssCheck.cs +++ b/src/NzbDrone.Core/HealthCheck/Checks/IndexerCheck.cs @@ -9,11 +9,11 @@ namespace NzbDrone.Core.HealthCheck.Checks [CheckOn(typeof(ProviderUpdatedEvent))] [CheckOn(typeof(ProviderDeletedEvent))] [CheckOn(typeof(ProviderStatusChangedEvent))] - public class IndexerRssCheck : HealthCheckBase + public class IndexerCheck : HealthCheckBase { private readonly IIndexerFactory _indexerFactory; - public IndexerRssCheck(IIndexerFactory indexerFactory, ILocalizationService localizationService) + public IndexerCheck(IIndexerFactory indexerFactory, ILocalizationService localizationService) : base(localizationService) { _indexerFactory = indexerFactory; @@ -25,14 +25,7 @@ namespace NzbDrone.Core.HealthCheck.Checks if (enabled.Empty()) { - return new HealthCheck(GetType(), HealthCheckResult.Error, _localizationService.GetLocalizedString("IndexerRssHealthCheckNoIndexers")); - } - - var active = _indexerFactory.Enabled(true); - - if (active.Empty()) - { - return new HealthCheck(GetType(), HealthCheckResult.Warning, _localizationService.GetLocalizedString("IndexerRssHealthCheckNoAvailableIndexers")); + return new HealthCheck(GetType(), HealthCheckResult.Error, _localizationService.GetLocalizedString("IndexerHealthCheckNoIndexers")); } return new HealthCheck(GetType()); diff --git a/src/NzbDrone.Core/Localization/Core/en.json b/src/NzbDrone.Core/Localization/Core/en.json index 6edff7f27..160daeea0 100644 --- a/src/NzbDrone.Core/Localization/Core/en.json +++ b/src/NzbDrone.Core/Localization/Core/en.json @@ -147,8 +147,7 @@ "IndexerPriority": "Indexer Priority", "IndexerPriorityHelpText": "Indexer Priority from 1 (Highest) to 50 (Lowest). Default: 25.", "IndexerQuery": "Indexer Query", - "IndexerRssHealthCheckNoAvailableIndexers": "All rss-capable indexers are temporarily unavailable due to recent indexer errors", - "IndexerRssHealthCheckNoIndexers": "No indexers available with RSS sync enabled, Prowlarr will not grab new releases automatically", + "IndexerHealthCheckNoIndexers": "No indexers enabled, Prowlarr will not return search results", "Indexers": "Indexers", "IndexersSelectedInterp": "{0} Indexer(s) Selected", "IndexerStatusCheckAllClientMessage": "All indexers are unavailable due to failures",