mirror of
https://github.com/Jackett/Jackett.git
synced 2025-09-17 17:34:09 +02:00
cardigann: respect the categories from search paths (#14395)
This commit is contained in:
@@ -1349,8 +1349,6 @@ namespace Jackett.Common.Indexers
|
||||
mappedCategories = DefaultCategories;
|
||||
}
|
||||
|
||||
variables[".Categories"] = mappedCategories;
|
||||
|
||||
var KeywordTokens = new List<string>();
|
||||
var KeywordTokenKeys = new List<string> { "Q", "Series", "Movie", "Year" };
|
||||
foreach (var key in KeywordTokenKeys)
|
||||
@@ -1369,15 +1367,26 @@ namespace Jackett.Common.Indexers
|
||||
var SearchPaths = Search.Paths;
|
||||
foreach (var SearchPath in SearchPaths)
|
||||
{
|
||||
variables[".Categories"] = mappedCategories;
|
||||
|
||||
// skip path if categories don't match
|
||||
if (SearchPath.Categories.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
|
||||
|
Reference in New Issue
Block a user