Also check values for not equals

This commit is contained in:
Ajay
2025-06-06 23:54:57 -04:00
parent b2461a6a30
commit ec1df44cbc

View File

@@ -136,19 +136,18 @@ function compileConfig(config: string): AdvancedSkipRuleSet[] | null {
return null; // Invalid attribute or operator
}
if (attribute === SkipRuleAttribute.Category
&& operator === SkipRuleOperator.Equal
&& !CompileConfig.categoryList.includes(value as string)) {
return null; // Invalid category value
} else if (attribute === SkipRuleAttribute.ActionType
&& operator === SkipRuleOperator.Equal
&& !ActionTypes.includes(value as ActionType)) {
return null; // Invalid category value
} else if (attribute === SkipRuleAttribute.Source
&& operator === SkipRuleOperator.Equal
&& !["local", "youtube", "autogenerated", "server"].includes(value as string)) {
return null; // Invalid category value
}
if ([SkipRuleOperator.Equal, SkipRuleOperator.NotEqual].includes(operator)) {
if (attribute === SkipRuleAttribute.Category
&& !CompileConfig.categoryList.includes(value as string)) {
return null; // Invalid category value
} else if (attribute === SkipRuleAttribute.ActionType
&& !ActionTypes.includes(value as ActionType)) {
return null; // Invalid category value
} else if (attribute === SkipRuleAttribute.Source
&& !["local", "youtube", "autogenerated", "server"].includes(value as string)) {
return null; // Invalid category value
}
}
ruleSet.rules.push({
attribute,