remove_old_chapter

This commit is contained in:
caiwx86 2025-02-09 20:39:37 +08:00
parent 2dd2e46f1b
commit 0d5e26662f

View File

@ -91,18 +91,9 @@ class BaseSite(ABC):
down_chapter = []
for chapter in list_chapter:
cbz_path = FileNaming.chapter_cbz(manga_info=manga_info,chapter=chapter)
old_cbz_path = FileNaming.old_chapter_cbz(manga_info=manga_info,chapter=chapter)
if os.path.exists(cbz_path):
logger.debug(f"{chapter.title} 章节已存在")
chapter.status = "downloaded"
if os.path.exists(old_cbz_path):
logger.debug(f"{chapter.title} Old章节存在")
if not os.path.exists(os.path.dirname(cbz_path)): os.makedirs(cbz_path)
CBZUtils()._clean_old_cbz(old_cbz_path)
if os.path.exists(old_cbz_path):
shutil.copy(old_cbz_path, cbz_path)
logger.info(f"{old_cbz_path} ==> {cbz_path} 已复制")
chapter.status = "downloaded"
down_chapter.append(chapter)
return down_chapter
except Exception as e: