fix #306
This commit is contained in:
parent
8f352c23c8
commit
05a0026ea4
@ -319,17 +319,26 @@ class DownloadChain(ChainBase):
|
||||
if not torrent_path:
|
||||
continue
|
||||
torrent_episodes = self.torrent.get_torrent_episodes(torrent_files)
|
||||
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,
|
||||
save_path=save_path,
|
||||
userid=userid)
|
||||
if torrent_episodes:
|
||||
# 总集数
|
||||
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} 解析文件集数为 [{begin_ep}-{end_ep}],不是完整合集")
|
||||
continue
|
||||
else:
|
||||
# 下载
|
||||
download_id = self.download_single(context=context,
|
||||
torrent_file=torrent_path,
|
||||
save_path=save_path,
|
||||
userid=userid)
|
||||
else:
|
||||
logger.info(
|
||||
f"{meta.org_string} 解析文件集数为 {len(torrent_episodes)},未含所需集数")
|
||||
f"{meta.org_string} 解析文件集数为 {len(torrent_episodes)},不是完整合集")
|
||||
continue
|
||||
else:
|
||||
# 下载
|
||||
|
@ -440,9 +440,21 @@ class MetaBase(object):
|
||||
elif len(ep) > 1 and str(ep[0]).isdigit() and str(ep[-1]).isdigit():
|
||||
self.begin_episode = int(ep[0])
|
||||
self.end_episode = int(ep[-1])
|
||||
self.total_episode = (self.end_episode - self.begin_episode) + 1
|
||||
elif str(ep).isdigit():
|
||||
self.begin_episode = int(ep)
|
||||
self.end_episode = None
|
||||
|
||||
def set_episodes(self, begin: int, end: int):
|
||||
"""
|
||||
设置开始集结束集
|
||||
"""
|
||||
if begin:
|
||||
self.begin_episode = begin
|
||||
if end:
|
||||
self.end_episode = end
|
||||
if self.begin_episode and self.end_episode:
|
||||
self.total_episode = (self.end_episode - self.begin_episode) + 1
|
||||
|
||||
def merge(self, meta: Self):
|
||||
"""
|
||||
|
Loading…
x
Reference in New Issue
Block a user