Fixed: Prevent endless loop when calling IndexerUrls for Newznab

Fixes #982
pull/968/head v0.3.0.1724
Qstick 3 years ago
parent 88ddb373cc
commit dc3fa51d88

@ -57,6 +57,11 @@ namespace NzbDrone.Core.Indexers.Newznab
return new string[] { Settings.BaseUrl }; return new string[] { Settings.BaseUrl };
} }
protected override NewznabSettings GetDefaultBaseUrl(NewznabSettings settings)
{
return settings;
}
public IndexerCapabilities GetCapabilitiesFromSettings() public IndexerCapabilities GetCapabilitiesFromSettings()
{ {
var caps = new IndexerCapabilities(); var caps = new IndexerCapabilities();

@ -146,7 +146,7 @@ namespace NzbDrone.Core.Indexers
return result.DistinctBy(v => v.Guid).ToList(); return result.DistinctBy(v => v.Guid).ToList();
} }
protected TSettings GetDefaultBaseUrl(TSettings settings) protected virtual TSettings GetDefaultBaseUrl(TSettings settings)
{ {
var defaultLink = IndexerUrls.FirstOrDefault(); var defaultLink = IndexerUrls.FirstOrDefault();
@ -154,8 +154,7 @@ namespace NzbDrone.Core.Indexers
{ {
settings.BaseUrl = defaultLink; settings.BaseUrl = defaultLink;
} }
else if (settings.BaseUrl.IsNotNullOrWhiteSpace() && LegacyUrls.Contains(settings.BaseUrl))
if (settings.BaseUrl.IsNotNullOrWhiteSpace() && LegacyUrls.Contains(settings.BaseUrl))
{ {
_logger.Debug(string.Format("Changing legacy site link from {0} to {1}", settings.BaseUrl, defaultLink)); _logger.Debug(string.Format("Changing legacy site link from {0} to {1}", settings.BaseUrl, defaultLink));
settings.BaseUrl = defaultLink; settings.BaseUrl = defaultLink;

Loading…
Cancel
Save