fix(download): apply custom words to torrent episodes (#6234)

This commit is contained in:
jxxghp
2026-08-09 16:32:12 +08:00
parent e6d7d57e6f
commit 15c73240ac
4 changed files with 74 additions and 5 deletions
+6 -2
View File
@@ -366,9 +366,13 @@ class TorrentHelper:
return result
@staticmethod
def get_torrent_episodes(files: list) -> list:
def get_torrent_episodes(files: list, custom_words: Optional[List[str]] = None) -> list:
"""
从种子的文件清单中获取所有集数
:param files: 种子文件清单
:param custom_words: 当前下载来源的临时自定义识别词
:return: 识别到的全部集数
"""
episodes = []
for file in files:
@@ -378,7 +382,7 @@ class TorrentHelper:
if not file_path.suffix or file_path.suffix.lower() not in settings.RMT_MEDIAEXT:
continue
# 只使用文件名识别
meta = MetaInfo(file_path.name)
meta = MetaInfo(file_path.name, custom_words=custom_words)
if not meta.begin_episode:
continue
episodes = list(set(episodes).union(set(meta.episode_list)))