fix ruleparser
This commit is contained in:
parent
0bc0059638
commit
b54b98e1c3
@ -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())
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user