mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
Fixed: (Cardigann) Replace legacy links with default link when making requests
This commit is contained in:
@@ -816,5 +816,24 @@ namespace NzbDrone.Core.Indexers.Cardigann
|
|||||||
{
|
{
|
||||||
return new Uri(currentUrl ?? new Uri(SiteLink), path);
|
return new Uri(currentUrl ?? new Uri(SiteLink), path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected string ResolveSiteLink()
|
||||||
|
{
|
||||||
|
var settingsBaseUrl = Settings?.BaseUrl;
|
||||||
|
var defaultLink = _definition.Links.First();
|
||||||
|
|
||||||
|
if (settingsBaseUrl == null)
|
||||||
|
{
|
||||||
|
return defaultLink;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_definition.Legacylinks.Contains(settingsBaseUrl))
|
||||||
|
{
|
||||||
|
_logger.Trace("Changing legacy site link from {0} to {1}", settingsBaseUrl, defaultLink);
|
||||||
|
return defaultLink;
|
||||||
|
}
|
||||||
|
|
||||||
|
return settingsBaseUrl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -21,7 +21,7 @@ namespace NzbDrone.Core.Indexers.Cardigann
|
|||||||
{
|
{
|
||||||
public Action<IDictionary<string, string>, DateTime?> CookiesUpdater { get; set; }
|
public Action<IDictionary<string, string>, DateTime?> CookiesUpdater { get; set; }
|
||||||
|
|
||||||
protected override string SiteLink => Settings?.BaseUrl ?? _definition.Links.First();
|
protected override string SiteLink => ResolveSiteLink();
|
||||||
|
|
||||||
public CardigannParser(IConfigService configService,
|
public CardigannParser(IConfigService configService,
|
||||||
CardigannDefinition definition,
|
CardigannDefinition definition,
|
||||||
|
@@ -27,7 +27,7 @@ namespace NzbDrone.Core.Indexers.Cardigann
|
|||||||
public IDictionary<string, string> Cookies { get; set; }
|
public IDictionary<string, string> Cookies { get; set; }
|
||||||
protected HttpResponse landingResult;
|
protected HttpResponse landingResult;
|
||||||
protected IHtmlDocument landingResultDocument;
|
protected IHtmlDocument landingResultDocument;
|
||||||
protected override string SiteLink => Settings?.BaseUrl ?? _definition.Links.First();
|
protected override string SiteLink => ResolveSiteLink();
|
||||||
|
|
||||||
public CardigannRequestGenerator(IConfigService configService,
|
public CardigannRequestGenerator(IConfigService configService,
|
||||||
CardigannDefinition definition,
|
CardigannDefinition definition,
|
||||||
|
Reference in New Issue
Block a user