mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-04-24 13:57:11 -04:00
Fixed: (Cardigann) Apply RateLimit by using RequestDelay from definitions
This commit is contained in:
parent
6646734510
commit
aa8048968c
2 changed files with 17 additions and 1 deletions
|
@ -30,9 +30,24 @@ namespace NzbDrone.Core.Indexers.Cardigann
|
||||||
public override IndexerPrivacy Privacy => IndexerPrivacy.Private;
|
public override IndexerPrivacy Privacy => IndexerPrivacy.Private;
|
||||||
|
|
||||||
// Page size is different per indexer, setting to 1 ensures we don't break out of paging logic
|
// Page size is different per indexer, setting to 1 ensures we don't break out of paging logic
|
||||||
// thinking its a partial page and insteaad all search_path requests are run for each indexer
|
// thinking its a partial page and instead all search_path requests are run for each indexer
|
||||||
public override int PageSize => 1;
|
public override int PageSize => 1;
|
||||||
|
|
||||||
|
public override TimeSpan RateLimit
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
var definition = _definitionService.GetCachedDefinition(Settings.DefinitionFile);
|
||||||
|
|
||||||
|
if (definition.RequestDelay.HasValue && definition.RequestDelay.Value > base.RateLimit.TotalSeconds)
|
||||||
|
{
|
||||||
|
return TimeSpan.FromSeconds(definition.RequestDelay.Value);
|
||||||
|
}
|
||||||
|
|
||||||
|
return base.RateLimit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public override IIndexerRequestGenerator GetRequestGenerator()
|
public override IIndexerRequestGenerator GetRequestGenerator()
|
||||||
{
|
{
|
||||||
var generator = _generatorCache.Get(Settings.DefinitionFile, () =>
|
var generator = _generatorCache.Get(Settings.DefinitionFile, () =>
|
||||||
|
|
|
@ -41,6 +41,7 @@ namespace NzbDrone.Core.Indexers.Cardigann
|
||||||
public string Type { get; set; }
|
public string Type { get; set; }
|
||||||
public string Language { get; set; }
|
public string Language { get; set; }
|
||||||
public string Encoding { get; set; }
|
public string Encoding { get; set; }
|
||||||
|
public double? RequestDelay { get; set; }
|
||||||
public List<string> Links { get; set; }
|
public List<string> Links { get; set; }
|
||||||
public List<string> Legacylinks { get; set; }
|
public List<string> Legacylinks { get; set; }
|
||||||
public bool Followredirect { get; set; } = false;
|
public bool Followredirect { get; set; } = false;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue