From 1e5652744bd4249ec0b0c3855ccdcc8c069158b4 Mon Sep 17 00:00:00 2001 From: caiwx86 Date: Sun, 15 Jan 2023 20:00:55 +0800 Subject: [PATCH] fix --- utils/comic/ComicInfo.py | 12 ++++++++++-- utils/entity/BaseComicEntity.py | 9 ++++----- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/utils/comic/ComicInfo.py b/utils/comic/ComicInfo.py index c71234a..03748ab 100644 --- a/utils/comic/ComicInfo.py +++ b/utils/comic/ComicInfo.py @@ -293,10 +293,18 @@ class comicInfo(): @classmethod def getNewCBZComicChapter(cls): + return cls.getNewToComicChapter(".CBZ") + + @classmethod + def getNewIconComicChapter(cls): + return cls.getNewToComicChapter(".jpg") + + @classmethod + def getNewToComicChapter(cls,su): c_dir = cls.getDirCBZComicChapter() s_dir = cls.getSortDirCBZComicChapter() - c_path = cls.getDirCBZComicChapter()+".CBZ" - s_path = cls.getSortDirCBZComicChapter()+".CBZ" + c_path = cls.getDirCBZComicChapter()+su + s_path = cls.getSortDirCBZComicChapter()+su if os.path.exists(c_path) and s_path != None: shutil.move(c_path, s_path) print("文件已移动至:", s_path) diff --git a/utils/entity/BaseComicEntity.py b/utils/entity/BaseComicEntity.py index 5fff72c..55f2a27 100644 --- a/utils/entity/BaseComicEntity.py +++ b/utils/entity/BaseComicEntity.py @@ -34,11 +34,8 @@ class baseComic: for chapter in chapters: comicInfo.setChapterIndex(chapter_index) comicInfo.setChapterName(chapter) - c_img_path = comicInfo.getDirCBZComicChapter()+".jpg" - s_img_path = comicInfo.getNewCBZComicChapter()+".jpg" - if os.path.exists(c_img_path): - shutil.move(s_img_path) - print(f"已从{c_img_path}移至:{s_img_path}") + comicInfo.getNewCBZComicChapter() + comicInfo.getNewIconComicChapter() chapter_index = chapter_index + 1 return None @@ -154,6 +151,8 @@ class baseComic: #验证数据是已存在且是否完整 #cbz_path = comicInfo.getDirCBZComicChapter()+".CBZ" cbz_path = comicInfo.getNewCBZComicChapter()+".CBZ" + #更新Icon + comicInfo.getNewIconComicChapter() is_next = True if os.path.exists(cbz_path): try: