mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-08 12:37:05 +03:00
Also check values for not equals
This commit is contained in:
@@ -136,19 +136,18 @@ function compileConfig(config: string): AdvancedSkipRuleSet[] | null {
|
|||||||
return null; // Invalid attribute or operator
|
return null; // Invalid attribute or operator
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ([SkipRuleOperator.Equal, SkipRuleOperator.NotEqual].includes(operator)) {
|
||||||
if (attribute === SkipRuleAttribute.Category
|
if (attribute === SkipRuleAttribute.Category
|
||||||
&& operator === SkipRuleOperator.Equal
|
|
||||||
&& !CompileConfig.categoryList.includes(value as string)) {
|
&& !CompileConfig.categoryList.includes(value as string)) {
|
||||||
return null; // Invalid category value
|
return null; // Invalid category value
|
||||||
} else if (attribute === SkipRuleAttribute.ActionType
|
} else if (attribute === SkipRuleAttribute.ActionType
|
||||||
&& operator === SkipRuleOperator.Equal
|
|
||||||
&& !ActionTypes.includes(value as ActionType)) {
|
&& !ActionTypes.includes(value as ActionType)) {
|
||||||
return null; // Invalid category value
|
return null; // Invalid category value
|
||||||
} else if (attribute === SkipRuleAttribute.Source
|
} else if (attribute === SkipRuleAttribute.Source
|
||||||
&& operator === SkipRuleOperator.Equal
|
|
||||||
&& !["local", "youtube", "autogenerated", "server"].includes(value as string)) {
|
&& !["local", "youtube", "autogenerated", "server"].includes(value as string)) {
|
||||||
return null; // Invalid category value
|
return null; // Invalid category value
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ruleSet.rules.push({
|
ruleSet.rules.push({
|
||||||
attribute,
|
attribute,
|
||||||
|
|||||||
Reference in New Issue
Block a user