From 3acb2b254cc38a083f8ee163ab121e772db10d69 Mon Sep 17 00:00:00 2001 From: jxxghp Date: Fri, 25 Aug 2023 17:05:31 +0800 Subject: [PATCH] =?UTF-8?q?fix=20#270=20=E8=AE=BE=E7=BD=AE=E4=BA=86?= =?UTF-8?q?=E5=BC=80=E5=A7=8B=E9=9B=86=E6=95=B0=E6=97=B6=E6=80=BB=E9=9B=86?= =?UTF-8?q?=E6=95=B0=E6=AF=94=E5=AF=B9=E5=87=BA=E9=94=99=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/chain/download.py | 10 +++++----- app/chain/subscribe.py | 12 ++++++------ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/app/chain/download.py b/app/chain/download.py index fa3bbf95..63bca8bd 100644 --- a/app/chain/download.py +++ b/app/chain/download.py @@ -241,10 +241,10 @@ class DownloadChain(ChainBase): 获取需要的季的集数 """ if not no_exists.get(tmdbid): - return 0 + return 9999 no_exist = no_exists.get(tmdbid) if not no_exist.get(season): - return 0 + return 9999 return no_exist[season].total_episode # 分组排序 @@ -298,9 +298,9 @@ class DownloadChain(ChainBase): if not torrent_path: continue torrent_episodes = self.torrent.get_torrent_episodes(torrent_files) - if not torrent_episodes \ - or len(torrent_episodes) >= __get_season_episodes(need_tmdbid, - torrent_season[0]): + if torrent_episodes \ + and len(torrent_episodes) >= __get_season_episodes(need_tmdbid, + torrent_season[0]): # 下载 download_id = self.download_single(context=context, torrent_file=torrent_path, diff --git a/app/chain/subscribe.py b/app/chain/subscribe.py index 2ecc3c00..0054b120 100644 --- a/app/chain/subscribe.py +++ b/app/chain/subscribe.py @@ -283,7 +283,7 @@ class SubscribeChain(ChainBase): # 如果是电视剧过滤掉已经下载的集数 if torrent_mediainfo.type == MediaType.TV: if self.__check_subscribe_note(subscribe, torrent_meta.episode_list): - logger.info(f'{torrent_info.title} 对应剧集 {torrent_meta.episodes} 已下载过') + logger.info(f'{torrent_info.title} 对应剧集 {torrent_meta.episode_list} 已下载过') continue else: # 洗版时,非整季不要 @@ -488,11 +488,11 @@ class SubscribeChain(ChainBase): set(torrent_meta.episode_list) ): logger.info( - f'{torrent_info.title} 对应剧集 {torrent_meta.episodes} 未包含缺失的剧集') + f'{torrent_info.title} 对应剧集 {torrent_meta.episode_list} 未包含缺失的剧集') continue # 过滤掉已经下载的集数 if self.__check_subscribe_note(subscribe, torrent_meta.episode_list): - logger.info(f'{torrent_info.title} 对应剧集 {torrent_meta.episodes} 已下载过') + logger.info(f'{torrent_info.title} 对应剧集 {torrent_meta.episode_list} 已下载过') continue else: # 洗版时,非整季不要 @@ -670,8 +670,8 @@ class SubscribeChain(ChainBase): :param no_exists: 缺失季集列表 :param tmdb_id: TMDB ID :param begin_season: 开始季 - :param total_episode: 总集数 - :param start_episode: 开始集数 + :param total_episode: 订阅设定总集数 + :param start_episode: 订阅设定开始集数 """ # 使用订阅的总集数和开始集数替换no_exists if no_exists \ @@ -696,7 +696,7 @@ class SubscribeChain(ChainBase): elif not total_episode: # 有开始集没有总集数 episodes = list(range(start_episode, max(episode_list or [total]) + 1)) - total_episode = max(episode_list or [total]) + total_episode = no_exist_season.total_episode else: return no_exists # 与原有集取交集