mirror of
https://github.com/Prowlarr/Prowlarr
synced 2026-04-22 12:50:48 +02:00
Fixed: (Cardigann) Skip duplicated GET requests
This commit is contained in:
parent
9042525f22
commit
e658e3fe48
1 changed files with 14 additions and 8 deletions
|
|
@ -1073,9 +1073,9 @@ private IEnumerable<IndexerRequest> GetRequest(Dictionary<string, object> variab
|
|||
variables[".Query.Keywords"] = string.Join(" ", keywordTokens);
|
||||
variables[".Keywords"] = ApplyFilters((string)variables[".Query.Keywords"], search.Keywordsfilters, variables);
|
||||
|
||||
// TODO: prepare queries first and then send them parallel
|
||||
var searchPaths = search.Paths;
|
||||
foreach (var searchPath in searchPaths)
|
||||
var searchUrls = new List<string>();
|
||||
|
||||
foreach (var searchPath in search.Paths)
|
||||
{
|
||||
variables[".Categories"] = mappedCategories;
|
||||
|
||||
|
|
@ -1158,14 +1158,20 @@ private IEnumerable<IndexerRequest> GetRequest(Dictionary<string, object> variab
|
|||
}
|
||||
}
|
||||
|
||||
if (method == HttpMethod.Get)
|
||||
if (method == HttpMethod.Get && queryCollection.Count > 0)
|
||||
{
|
||||
if (queryCollection.Count > 0)
|
||||
{
|
||||
searchUrl += "?" + queryCollection.GetQueryString(_encoding);
|
||||
}
|
||||
searchUrl += "?" + queryCollection.GetQueryString(_encoding);
|
||||
}
|
||||
|
||||
if (method == HttpMethod.Get && searchUrls.Contains(searchUrl))
|
||||
{
|
||||
_logger.Trace("Skip duplicated request {0}", searchUrl);
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
searchUrls.Add(searchUrl);
|
||||
|
||||
_logger.Debug($"Adding request: {searchUrl}");
|
||||
|
||||
var requestBuilder = new HttpRequestBuilder(searchUrl)
|
||||
|
|
|
|||
Loading…
Reference in a new issue