|
|
|
@ -8,6 +8,7 @@ using NzbDrone.Core.ThingiProvider.Events;
|
|
|
|
|
|
|
|
|
|
namespace NzbDrone.Core.HealthCheck.Checks
|
|
|
|
|
{
|
|
|
|
|
[CheckOn(typeof(ProviderAddedEvent<IIndexer>))]
|
|
|
|
|
[CheckOn(typeof(ProviderUpdatedEvent<IIndexer>))]
|
|
|
|
|
[CheckOn(typeof(ProviderDeletedEvent<IIndexer>))]
|
|
|
|
|
[CheckOn(typeof(ProviderStatusChangedEvent<IIndexer>))]
|
|
|
|
@ -23,12 +24,15 @@ namespace NzbDrone.Core.HealthCheck.Checks
|
|
|
|
|
|
|
|
|
|
public override HealthCheck Check()
|
|
|
|
|
{
|
|
|
|
|
var jackettAllProviders = _providerFactory.All().Where(
|
|
|
|
|
i => i.ConfigContract.Equals("TorznabSettings") &&
|
|
|
|
|
((i.Settings as TorznabSettings).BaseUrl.Contains("/torznab/all/api", StringComparison.InvariantCultureIgnoreCase) ||
|
|
|
|
|
(i.Settings as TorznabSettings).BaseUrl.Contains("/api/v2.0/indexers/all/results/torznab", StringComparison.InvariantCultureIgnoreCase) ||
|
|
|
|
|
(i.Settings as TorznabSettings).ApiPath.Contains("/torznab/all/api", StringComparison.InvariantCultureIgnoreCase) ||
|
|
|
|
|
(i.Settings as TorznabSettings).ApiPath.Contains("/api/v2.0/indexers/all/results/torznab", StringComparison.InvariantCultureIgnoreCase)));
|
|
|
|
|
var jackettAllProviders = _providerFactory.All()
|
|
|
|
|
.Where(
|
|
|
|
|
i => i.Enable &&
|
|
|
|
|
i.ConfigContract.Equals("TorznabSettings") &&
|
|
|
|
|
(((TorznabSettings)i.Settings).BaseUrl.Contains("/torznab/all/api", StringComparison.InvariantCultureIgnoreCase) ||
|
|
|
|
|
((TorznabSettings)i.Settings).BaseUrl.Contains("/api/v2.0/indexers/all/results/torznab", StringComparison.InvariantCultureIgnoreCase) ||
|
|
|
|
|
((TorznabSettings)i.Settings).ApiPath.Contains("/torznab/all/api", StringComparison.InvariantCultureIgnoreCase) ||
|
|
|
|
|
((TorznabSettings)i.Settings).ApiPath.Contains("/api/v2.0/indexers/all/results/torznab", StringComparison.InvariantCultureIgnoreCase)))
|
|
|
|
|
.ToArray();
|
|
|
|
|
|
|
|
|
|
if (jackettAllProviders.Empty())
|
|
|
|
|
{
|
|
|
|
@ -37,8 +41,7 @@ namespace NzbDrone.Core.HealthCheck.Checks
|
|
|
|
|
|
|
|
|
|
return new HealthCheck(GetType(),
|
|
|
|
|
HealthCheckResult.Warning,
|
|
|
|
|
string.Format(_localizationService.GetLocalizedString("IndexerJackettAll"),
|
|
|
|
|
string.Join(", ", jackettAllProviders.Select(i => i.Name))),
|
|
|
|
|
string.Format(_localizationService.GetLocalizedString("IndexerJackettAll"), string.Join(", ", jackettAllProviders.Select(i => i.Name))),
|
|
|
|
|
"#jackett-all-endpoint-used");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|