mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-04-24 22:07:32 -04:00
Fixed: (Cardigann) Respect the categories from search paths
This commit is contained in:
parent
59b6e8af27
commit
ef1ad59f59
1 changed files with 8 additions and 4 deletions
|
@ -1044,8 +1044,6 @@ namespace NzbDrone.Core.Indexers.Definitions.Cardigann
|
|||
mappedCategories = _defaultCategories;
|
||||
}
|
||||
|
||||
variables[".Categories"] = mappedCategories;
|
||||
|
||||
var keywordTokens = new List<string>();
|
||||
var keywordTokenKeys = new List<string> { "Q", "Series", "Movie", "Year" };
|
||||
foreach (var key in keywordTokenKeys)
|
||||
|
@ -1069,20 +1067,26 @@ namespace NzbDrone.Core.Indexers.Definitions.Cardigann
|
|||
var searchPaths = search.Paths;
|
||||
foreach (var searchPath in searchPaths)
|
||||
{
|
||||
variables[".Categories"] = mappedCategories;
|
||||
|
||||
// skip path if categories don't match
|
||||
if (searchPath.Categories != null && mappedCategories.Count > 0)
|
||||
{
|
||||
var invertMatch = searchPath.Categories[0] == "!";
|
||||
var hasIntersect = mappedCategories.Intersect(searchPath.Categories).Any();
|
||||
if (invertMatch)
|
||||
|
||||
if (searchPath.Categories[0] == "!")
|
||||
{
|
||||
hasIntersect = !hasIntersect;
|
||||
}
|
||||
|
||||
if (!hasIntersect)
|
||||
{
|
||||
variables[".Categories"] = mappedCategories.Except(searchPath.Categories).ToList();
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
variables[".Categories"] = mappedCategories.Intersect(searchPath.Categories).ToList();
|
||||
}
|
||||
|
||||
// build search URL
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue