From 7a595657612dbc6a46c218e50df0eb2181a65958 Mon Sep 17 00:00:00 2001 From: jxxghp Date: Wed, 22 Jan 2025 16:37:49 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E4=BC=98=E5=8C=96=E8=AE=A2=E9=98=85?= =?UTF-8?q?=E5=8C=B9=E9=85=8D=E7=9A=84=E8=AF=86=E5=88=AB=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/chain/subscribe.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/app/chain/subscribe.py b/app/chain/subscribe.py index 2be6da33..0873173b 100644 --- a/app/chain/subscribe.py +++ b/app/chain/subscribe.py @@ -573,9 +573,9 @@ class SubscribeChain(ChainBase, metaclass=Singleton): continue # 有自定义识别词时,需要判断是否需要重新识别 - apply_words = None if custom_words_list: - _, apply_words = WordsMatcher().prepare(torrent_info.title, + # 使用org_string,应用一次后理论上不能再次应用 + _, apply_words = WordsMatcher().prepare(torrent_meta.org_string, custom_words=custom_words_list) if apply_words: logger.info( @@ -583,6 +583,8 @@ class SubscribeChain(ChainBase, metaclass=Singleton): # 重新识别元数据 torrent_meta = MetaInfo(title=torrent_info.title, subtitle=torrent_info.description, custom_words=custom_words_list) + # 更新元数据缓存 + context.meta_info = torrent_meta # 媒体信息需要重新识别 torrent_mediainfo = None @@ -593,8 +595,7 @@ class SubscribeChain(ChainBase, metaclass=Singleton): torrent_mediainfo = self.recognize_media(meta=torrent_meta) if torrent_mediainfo: # 更新种子缓存 - if not apply_words: - context.media_info = torrent_mediainfo + context.media_info = torrent_mediainfo else: # 通过标题匹配兜底 logger.warn( @@ -606,9 +607,7 @@ class SubscribeChain(ChainBase, metaclass=Singleton): logger.info( f'{mediainfo.title_year} 通过标题匹配到可选资源:{torrent_info.site_name} - {torrent_info.title}') torrent_mediainfo = mediainfo - # 更新种子缓存 - if not apply_words: - context.media_info = mediainfo + context.media_info = torrent_mediainfo else: continue