From c2dec7b9551abbf15e299ae5ff21cf5b225edb3c Mon Sep 17 00:00:00 2001 From: jxxghp Date: Fri, 20 Oct 2023 13:49:06 +0800 Subject: [PATCH] fix download --- app/chain/download.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/app/chain/download.py b/app/chain/download.py index 364aec88..ef169a17 100644 --- a/app/chain/download.py +++ b/app/chain/download.py @@ -447,13 +447,13 @@ class DownloadChain(ChainBase): logger.info(f"{meta.org_string} 解析文件集数为 {torrent_episodes}") if not torrent_episodes: continue - # 总集数 + # 更新集数范围 + begin_ep = min(torrent_episodes) + end_ep = max(torrent_episodes) + meta.set_episodes(begin=begin_ep, end=end_ep) + # 需要总集数 need_total = __get_season_episodes(need_tmdbid, torrent_season[0]) if len(torrent_episodes) < need_total: - # 更新集数范围 - begin_ep = min(torrent_episodes) - end_ep = max(torrent_episodes) - meta.set_episodes(begin=begin_ep, end=end_ep) logger.info( f"{meta.org_string} 解析文件集数发现不是完整合集") continue @@ -610,11 +610,12 @@ class DownloadChain(ChainBase): ) if not download_id: continue - # 把识别的集更新到上下文 - context.meta_info.begin_episode = min(selected_episodes) - context.meta_info.end_episode = max(selected_episodes) # 下载成功 downloaded_list.append(context) + # 更新种子集数范围 + begin_ep = min(torrent_episodes) + end_ep = max(torrent_episodes) + meta.set_episodes(begin=begin_ep, end=end_ep) # 更新仍需集数 need_episodes = __update_episodes(_tmdbid=need_tmdbid, _need=need_episodes,