mirror of
https://github.com/Prowlarr/Prowlarr
synced 2026-02-06 23:12:33 +01:00
Fixed: Rework RSS Check to Enabled Check
This commit is contained in:
parent
01415e4b7e
commit
ea8ceaebb3
3 changed files with 5 additions and 33 deletions
|
|
@ -9,7 +9,7 @@
|
|||
namespace NzbDrone.Core.Test.HealthCheck.Checks
|
||||
{
|
||||
[TestFixture]
|
||||
public class IndexerRssCheckFixture : CoreTest<IndexerRssCheck>
|
||||
public class IndexerCheckFixture : CoreTest<IndexerCheck>
|
||||
{
|
||||
private Mock<IIndexer> _indexerMock;
|
||||
|
||||
|
|
@ -47,17 +47,6 @@ private void GivenRssEnabled()
|
|||
.Returns(new List<IIndexer> { _indexerMock.Object });
|
||||
}
|
||||
|
||||
private void GivenRssFiltered()
|
||||
{
|
||||
Mocker.GetMock<IIndexerFactory>()
|
||||
.Setup(s => s.Enabled(false))
|
||||
.Returns(new List<IIndexer> { _indexerMock.Object });
|
||||
|
||||
Mocker.GetMock<ILocalizationService>()
|
||||
.Setup(s => s.GetLocalizedString(It.IsAny<string>()))
|
||||
.Returns("recent indexer errors");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_return_error_when_no_indexer_present()
|
||||
{
|
||||
|
|
@ -88,14 +77,5 @@ public void should_return_error_if_rss_is_supported_but_disabled()
|
|||
|
||||
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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -9,11 +9,11 @@ namespace NzbDrone.Core.HealthCheck.Checks
|
|||
[CheckOn(typeof(ProviderUpdatedEvent<IIndexer>))]
|
||||
[CheckOn(typeof(ProviderDeletedEvent<IIndexer>))]
|
||||
[CheckOn(typeof(ProviderStatusChangedEvent<IIndexer>))]
|
||||
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 @@ public override HealthCheck Check()
|
|||
|
||||
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());
|
||||
|
|
@ -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",
|
||||
|
|
|
|||
Loading…
Reference in a new issue