mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-05 23:47:41 +08:00
fix: avoid cnsub matching file size unit
This commit is contained in:
@@ -61,6 +61,10 @@ def _parse_publish_time(publish_time: str) -> Tuple[float, ...]:
|
||||
|
||||
|
||||
class FilterModule(_ModuleBase):
|
||||
"""
|
||||
过滤器模块,负责按内置和自定义规则筛选种子资源。
|
||||
"""
|
||||
|
||||
CONFIG_WATCH = {
|
||||
SystemConfigKey.CustomFilterRules.value,
|
||||
SystemConfigKey.CustomIdentifiers.value,
|
||||
@@ -73,16 +77,22 @@ class FilterModule(_ModuleBase):
|
||||
# 运行期规则集 = 内置规则 + 自定义规则覆盖。
|
||||
rule_set: Dict[str, dict] = {}
|
||||
|
||||
def __init__(self):
|
||||
def __init__(self) -> None:
|
||||
"""
|
||||
初始化过滤器模块依赖的规则仓库。
|
||||
"""
|
||||
super().__init__()
|
||||
self.rulehelper = RuleHelper()
|
||||
|
||||
def init_module(self) -> None:
|
||||
"""
|
||||
初始化过滤规则集,合并内置规则和用户自定义规则。
|
||||
"""
|
||||
# 每次重载都先恢复为纯内置规则,避免旧的自定义规则残留在内存里。
|
||||
self.rule_set = deepcopy(self.builtin_rule_set)
|
||||
self.__init_custom_rules()
|
||||
|
||||
def on_config_changed(self):
|
||||
def on_config_changed(self) -> None:
|
||||
"""
|
||||
自定义过滤或 Meta 识别配置变更后重建规则集并刷新 Rust Meta 配置缓存。
|
||||
"""
|
||||
@@ -100,6 +110,9 @@ class FilterModule(_ModuleBase):
|
||||
|
||||
@staticmethod
|
||||
def get_name() -> str:
|
||||
"""
|
||||
获取模块名称。
|
||||
"""
|
||||
return "过滤器"
|
||||
|
||||
@staticmethod
|
||||
@@ -123,13 +136,22 @@ class FilterModule(_ModuleBase):
|
||||
"""
|
||||
return 4
|
||||
|
||||
def stop(self):
|
||||
def stop(self) -> None:
|
||||
"""
|
||||
停止过滤器模块。
|
||||
"""
|
||||
pass
|
||||
|
||||
def test(self):
|
||||
def test(self) -> None:
|
||||
"""
|
||||
测试过滤器模块状态。
|
||||
"""
|
||||
pass
|
||||
|
||||
def init_setting(self) -> Tuple[str, Union[str, bool]]:
|
||||
"""
|
||||
返回过滤器模块启用配置。
|
||||
"""
|
||||
pass
|
||||
|
||||
def filter_torrents(self, rule_groups: List[str],
|
||||
|
||||
@@ -34,7 +34,7 @@ BUILTIN_RULE_SET: Dict[str, dict] = {
|
||||
r"[中国國繁简](/|\s|\\|\|)?[繁简英粤]|[英简繁](/|\s|\\|\|)?[中繁简]"
|
||||
r"|繁體|简体|[中国國][字配]|国语|國語|中文|中字|简日|繁日|简繁|繁体"
|
||||
r"|([\s,.-\[])(chs|cht)(|[\s,.-\]])"
|
||||
r"|(?<![a-z0-9])(gb|big5)(?![a-z0-9])"
|
||||
r"|(?<![a-z0-9])(?<!\d\s)(gb|big5)(?![a-z0-9])"
|
||||
],
|
||||
"exclude": [],
|
||||
"tmdb": {
|
||||
|
||||
Reference in New Issue
Block a user