From b124547f2456bad63dba7e3eabc1428d2e3f46dd Mon Sep 17 00:00:00 2001 From: caiwx86 Date: Sun, 13 Jul 2025 02:34:51 +0800 Subject: [PATCH] update --- src/common/item.py | 2 +- src/sites/base.py | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/common/item.py b/src/common/item.py index a282602..a202517 100644 --- a/src/common/item.py +++ b/src/common/item.py @@ -214,7 +214,7 @@ class MangaInfo(BaseModel): # 如果章节名称列表长度大于1且最后一个章节名称与传入的章节名称相同 if len(cls.chapters_name) > 1 and str_chapter == FileNaming.chinese_file_name(cls.chapters_name[-1]): # 检查状态是否为已完结 - # if cls.status == "已完结": return True + if cls.status == "已完结": return True # 检查章节名称是否包含已完结的关键字 str_chapter_key = str_chapter.replace("-", " ").split(" ") # 如果章节名称包含已完结的关键字,则返回True diff --git a/src/sites/base.py b/src/sites/base.py index a02a40f..c303b48 100644 --- a/src/sites/base.py +++ b/src/sites/base.py @@ -87,6 +87,7 @@ class BaseSite(ABC): """获取章节列表""" try: list_chapter = manga_info.get_list_chapter() + is_ended_chapter = False down_chapter = [] downloaded_chapter = [] number = 0 @@ -94,8 +95,9 @@ class BaseSite(ABC): number += 1 cbz_path = FileNaming.chapter_cbz(manga_info=manga_info,chapter=chapter) if os.path.exists(cbz_path): - # 判断是否是最新章节 - if manga_info.is_chapter_ended(chapter.title): + # 判断是否是最新章节 + is_ended_chapter = manga_info.is_chapter_ended(chapter.title) + if is_ended_chapter: # 如果是最新章节且漫画已完结,则不再下 # if ci.Count != "" and int(ci.Count) != 0 and int(ci.Count) != int(number): # count = number @@ -110,7 +112,7 @@ class BaseSite(ABC): chapter.status = "downloaded" downloaded_chapter.append({ "name" : chapter.title, "status": chapter.status, "path" : cbz_path }) down_chapter.append(chapter) - if manga_info.status == "已完结": + if is_ended_chapter: from src.common.utils import KomgaAPI, MangaUtils is_update_komga_ended = MangaUtils("mangas_ended.json").search_manga(name= manga_info.title) if is_update_komga_ended != None: