mirror of https://github.com/Jackett/Jackett
cardigannIndexer: add validate field filter
will mostly be used with sites that used tags, to remove the non-genre chaff from the genre field.
This commit is contained in:
parent
f90186a648
commit
a8b1001e91
|
@ -796,7 +796,7 @@
|
|||
"properties": {
|
||||
"name": {
|
||||
"type": "string",
|
||||
"enum": ["querystring", "timeparse", "dateparse", "regexp", "re_replace", "split", "replace", "trim", "prepend", "append", "tolower", "toupper", "urldecode", "urlencode", "timeago", "reltime", "fuzzytime", "validfilename", "diacritics", "jsonjoinarray", "hexdump", "strdump"]
|
||||
"enum": ["querystring", "timeparse", "dateparse", "regexp", "re_replace", "split", "replace", "trim", "prepend", "append", "tolower", "toupper", "urldecode", "urlencode", "timeago", "reltime", "fuzzytime", "validfilename", "diacritics", "jsonjoinarray", "hexdump", "strdump", "validate"]
|
||||
},
|
||||
"args": {
|
||||
"oneOf": [
|
||||
|
|
|
@ -1129,6 +1129,14 @@ namespace Jackett.Common.Indexers
|
|||
strTag = ":";
|
||||
logger.Debug(string.Format("CardigannIndexer ({0}): strdump{1} {2}", Id, strTag, DebugData));
|
||||
break;
|
||||
case "validate":
|
||||
char[] delimiters = { ',', ' ', '/', ')', '(', '.' };
|
||||
var args = (string)Filter.Args;
|
||||
var argsList = args.ToLower().Split(delimiters, System.StringSplitOptions.RemoveEmptyEntries);
|
||||
var validList = argsList.ToList();
|
||||
var validIntersect = validList.Intersect(Data.ToLower().Split(delimiters, System.StringSplitOptions.RemoveEmptyEntries)).ToList();
|
||||
Data = string.Join(", ", validIntersect);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue