From c3ba83c7ca422a385942e2f2bf15541ccef6ca09 Mon Sep 17 00:00:00 2001 From: jxxghp Date: Tue, 9 Jan 2024 13:16:39 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E8=AE=A2=E9=98=85=E9=87=8D?= =?UTF-8?q?=E5=A4=8D=E4=B8=8B=E8=BD=BD=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/chain/download.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/app/chain/download.py b/app/chain/download.py index 4cc7fe9e..1b61366e 100644 --- a/app/chain/download.py +++ b/app/chain/download.py @@ -357,12 +357,13 @@ class DownloadChain(ChainBase): need = list(set(_need).difference(set(_current))) # 清除已下载的季信息 seas = copy.deepcopy(no_exists.get(_mid)) - for _sea in list(seas): - if _sea not in need: - no_exists[_mid].pop(_sea) - if not no_exists.get(_mid) and no_exists.get(_mid) is not None: - no_exists.pop(_mid) - break + if seas: + for _sea in list(seas): + if _sea not in need: + no_exists[_mid].pop(_sea) + if not no_exists.get(_mid) and no_exists.get(_mid) is not None: + no_exists.pop(_mid) + break return need def __update_episodes(_mid: Union[int, str], _sea: int, _need: list, _current: set) -> list: @@ -490,6 +491,9 @@ class DownloadChain(ChainBase): need_season = __update_seasons(_mid=need_mid, _need=need_season, _current=torrent_season) + if not need_season: + # 全部下载完成 + break # 电视剧季内的集匹配 if no_exists: # TMDBID列表