From 0000f3df38dbf2ea724d3c7ca3b98ffd51ac267a Mon Sep 17 00:00:00 2001 From: caiwx86 Date: Tue, 4 Feb 2025 21:30:55 +0800 Subject: [PATCH] fix --- src/sites/manager.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/sites/manager.py b/src/sites/manager.py index 2f58626..e006c0a 100644 --- a/src/sites/manager.py +++ b/src/sites/manager.py @@ -173,7 +173,8 @@ class MangaManager: try: total_chapters = 0 completed_chapters = 0 - + success_chapters = 0 + async for result in manager.process_manga(url, status_callback=cls.print_progress): if result['type'] == 'progress': total_chapters = result['total_chapters'] @@ -190,6 +191,7 @@ class MangaManager: f"{chapter_result['failed']} 张失败" ) else: + success_chapters += 1 logger.info(f"章节 {result['chapter']} 完成") print(f"\n总进度: {completed_chapters}/{total_chapters} 章") @@ -201,7 +203,7 @@ class MangaManager: logger.error(f"下载出错: {result['error']}") # 全部下载完成 - if int(total_chapters) == int(completed_chapters): + if int(total_chapters) == int(success_chapters): MangaUtils().add_manga(title, created_at=created_at) logger.info(f"全部完成 {title}, {created_at}") except MangaException as e: