mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2026-04-23 22:45:06 -04:00
Fixed: (Apps) Ensure populated capabilities for Torznab/Newznab definitions
This commit is contained in:
@@ -43,14 +43,12 @@ namespace NzbDrone.Core.Indexers.Newznab
|
||||
|
||||
public string[] GetBaseUrlFromSettings()
|
||||
{
|
||||
var baseUrl = "";
|
||||
|
||||
if (Definition == null || Settings == null || Settings.Categories == null)
|
||||
if (Definition == null || Settings?.Categories == null)
|
||||
{
|
||||
return new string[] { baseUrl };
|
||||
return new[] { "" };
|
||||
}
|
||||
|
||||
return new string[] { Settings.BaseUrl };
|
||||
return new[] { Settings.BaseUrl };
|
||||
}
|
||||
|
||||
protected override NewznabSettings GetDefaultBaseUrl(NewznabSettings settings)
|
||||
@@ -62,7 +60,7 @@ namespace NzbDrone.Core.Indexers.Newznab
|
||||
{
|
||||
var caps = new IndexerCapabilities();
|
||||
|
||||
if (Definition == null || Settings == null || Settings.Categories == null)
|
||||
if (Definition == null || Settings?.Categories == null)
|
||||
{
|
||||
return caps;
|
||||
}
|
||||
|
||||
@@ -34,9 +34,8 @@ namespace NzbDrone.Core.Indexers.Newznab
|
||||
public IndexerCapabilities GetCapabilities(NewznabSettings indexerSettings, ProviderDefinition definition)
|
||||
{
|
||||
var key = indexerSettings.ToJson();
|
||||
var capabilities = _capabilitiesCache.Get(key, () => FetchCapabilities(indexerSettings, definition), TimeSpan.FromDays(7));
|
||||
|
||||
return capabilities;
|
||||
return _capabilitiesCache.Get(key, () => FetchCapabilities(indexerSettings, definition), TimeSpan.FromDays(7));
|
||||
}
|
||||
|
||||
private IndexerCapabilities FetchCapabilities(NewznabSettings indexerSettings, ProviderDefinition definition)
|
||||
|
||||
Reference in New Issue
Block a user