refactor(helper): 将DirectoryHelper、RuleHelper和TorrentHelper方法改为静态方法

- 移除不必要的实例化操作,直接使用类方法
This commit is contained in:
Attente
2026-03-13 19:50:10 +08:00
parent e09cfc6704
commit b89825525a
20 changed files with 81 additions and 79 deletions
+2 -3
View File
@@ -875,7 +875,6 @@ class SubscribeChain(ChainBase):
# 遍历预识别后的种子
_match_context = []
torrenthelper = TorrentHelper()
systemconfig = SystemConfigOper()
wordsmatcher = WordsMatcher()
for domain, contexts in processed_torrents.items():
@@ -926,7 +925,7 @@ class SubscribeChain(ChainBase):
not torrent_mediainfo.tmdb_id and not torrent_mediainfo.douban_id):
logger.debug(
f'{torrent_info.site_name} - {torrent_info.title} 重新识别失败,尝试通过标题匹配...')
if torrenthelper.match_torrent(mediainfo=mediainfo,
if TorrentHelper.match_torrent(mediainfo=mediainfo,
torrent_meta=torrent_meta,
torrent=torrent_info):
# 匹配成功
@@ -992,7 +991,7 @@ class SubscribeChain(ChainBase):
continue
# 匹配订阅附加参数
if not torrenthelper.filter_torrent(torrent_info=torrent_info,
if not TorrentHelper.filter_torrent(torrent_info=torrent_info,
filter_params=self.get_params(subscribe)):
continue