refactor(subscribe): unify best_version episode upgrade logic and always track downloads in note

- Simplify and centralize logic for filtering TV episodes during best_version (wash) mode, ensuring only episodes with strictly higher priority are considered for upgrade.
- Always update subscribe.note with downloaded episodes regardless of best_version state, ensuring download history is reliably tracked and available for all subscription modes.
- Remove redundant episode_group field from subscribe dict output.
- Refactor search: remove multi-page search logic, streamline concurrent site search for both sync and async paths, and update progress reporting accordingly.
- Remove obsolete tests for allowed_episodes propagation and note tracking, as logic is now unified and simplified.
This commit is contained in:
jxxghp
2026-05-22 12:34:13 +08:00
parent 9319b47fad
commit cb15b711b9
3 changed files with 77 additions and 4 deletions
+2 -3
View File
@@ -882,7 +882,6 @@ class SearchChain(ChainBase):
# 开始匹配
_match_torrents = []
torrenthelper = TorrentHelper()
try:
# 英文标题应该在别名/原标题中,不需要再匹配
logger.info(f"开始匹配结果 标题:{mediainfo.title},原标题:{mediainfo.original_title},别名:{mediainfo.names}")
@@ -916,7 +915,7 @@ class SearchChain(ChainBase):
continue
# 比对种子
if torrenthelper.match_torrent(mediainfo=mediainfo,
if TorrentHelper.match_torrent(mediainfo=mediainfo,
torrent_meta=torrent_meta,
torrent=torrent):
# 匹配成功
@@ -950,7 +949,7 @@ class SearchChain(ChainBase):
# 排序
progress.update(value=99,
text=f'正在对 {len(contexts)} 个资源进行排序,请稍候...')
contexts = torrenthelper.sort_torrents(contexts)
contexts = TorrentHelper.sort_torrents(contexts)
# 结束进度
logger.info(f'搜索完成,共 {len(contexts)} 个资源')
+1 -1
View File
@@ -1441,7 +1441,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):
# 匹配成功