From ec1df44cbcefd418e84894c0e5bdc28af3a20ee1 Mon Sep 17 00:00:00 2001 From: Ajay Date: Fri, 6 Jun 2025 23:54:57 -0400 Subject: [PATCH] Also check values for not equals --- .../options/AdvancedSkipOptionsComponent.tsx | 25 +++++++++---------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/src/components/options/AdvancedSkipOptionsComponent.tsx b/src/components/options/AdvancedSkipOptionsComponent.tsx index 5daf0373..71bbce6f 100644 --- a/src/components/options/AdvancedSkipOptionsComponent.tsx +++ b/src/components/options/AdvancedSkipOptionsComponent.tsx @@ -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,