fix ruleparser

This commit is contained in:
jxxghp 2023-06-07 21:43:07 +08:00
parent 0bc0059638
commit b54b98e1c3
2 changed files with 3 additions and 3 deletions

View File

@ -41,7 +41,7 @@ class RuleParser:
if __name__ == '__main__':
# 测试代码
expression = "!BLU & 4K & CN > !BLU & 1080P & CN > !BLU & 4K > !BLU & 1080P"
for exp in expression.split('>'):
expression_str = "!BLU & 4K & CN > !BLU & 1080P & CN > !BLU & 4K > !BLU & 1080P"
for exp in expression_str.split('>'):
parsed_expr = RuleParser().parse(exp)
print(parsed_expr.as_list())

View File

@ -94,7 +94,7 @@ class FilterModule(_ModuleBase):
for rule_group in rule_groups:
# 解析规则组
parsed_group = self.parser.parse(rule_group.strip())
if self.__match_group(torrent, parsed_group.as_list()):
if self.__match_group(torrent, parsed_group.as_list()[0]):
# 出现匹配时中断
matched = True
torrent.pri_order = res_order