Fixed: Don't fetch capabilities for disabled Newznab/Torznab indexers on create

Also prevent NullRef in GetProxy since definition is null when using FetchCapabilities on add
This commit is contained in:
Bogdan
2023-08-02 14:54:01 +03:00
parent d897b50f80
commit bc53fab966
2 changed files with 5 additions and 5 deletions
+3 -3
View File
@@ -281,10 +281,10 @@ namespace NzbDrone.Core.Indexers
SetProviderCharacteristics(provider, definition);
if (definition.Implementation is nameof(Newznab.Newznab) or nameof(Torznab.Torznab))
if (definition.Enable && definition.Implementation is nameof(Newznab.Newznab) or nameof(Torznab.Torznab))
{
var settings = (NewznabSettings)definition.Settings;
settings.Categories = _newznabCapabilitiesProvider.GetCapabilities(settings, definition)?.Categories.GetTorznabCategoryList() ?? null;
settings.Categories = _newznabCapabilitiesProvider.GetCapabilities(settings, definition)?.Categories.GetTorznabCategoryList();
}
if (definition.Implementation == nameof(Cardigann))
@@ -304,7 +304,7 @@ namespace NzbDrone.Core.Indexers
if (definition.Enable && definition.Implementation is nameof(Newznab.Newznab) or nameof(Torznab.Torznab))
{
var settings = (NewznabSettings)definition.Settings;
settings.Categories = _newznabCapabilitiesProvider.GetCapabilities(settings, definition)?.Categories.GetTorznabCategoryList() ?? null;
settings.Categories = _newznabCapabilitiesProvider.GetCapabilities(settings, definition)?.Categories.GetTorznabCategoryList();
}
if (definition.Implementation == nameof(Cardigann))