This commit is contained in:
caiwx86 2023-01-16 04:02:00 +08:00
parent 82a2e8cffe
commit cffce0f8b7
2 changed files with 9 additions and 2 deletions

View File

@ -448,9 +448,12 @@ class comicInfo():
cls.nextSavePath("done_",data) cls.nextSavePath("done_",data)
@classmethod @classmethod
def nextExistsGetPath(cls,msg): def nextExistsGetPath(cls,msg,remove=False):
path = cls.nextSavePath(msg) path = cls.nextSavePath(msg)
return os.path.exists(path) is_exists = os.path.exists(path)
if remove and is_exists:
os.remove(path)
return is_exists
@classmethod @classmethod
def saveConfComicData(cls,fileName,data,comicName=None): def saveConfComicData(cls,fileName,data,comicName=None):

View File

@ -40,6 +40,8 @@ class baseComic:
cbz_path = comicInfo.getNewCBZComicChapter("file") cbz_path = comicInfo.getNewCBZComicChapter("file")
comicInfo.getNewIconComicChapter() comicInfo.getNewIconComicChapter()
CBZUtils.replaceZip(cbz_path) CBZUtils.replaceZip(cbz_path)
if comicInfo.nextExistsGetPath("done_") and not os.path.exists(cbz_path):
comicInfo.nextExistsGetPath("done_",remove=True)
chapter_index = chapter_index + 1 chapter_index = chapter_index + 1
return None return None
@ -69,6 +71,8 @@ class baseComic:
chapter = chapters[cls.count_chapter] chapter = chapters[cls.count_chapter]
comicInfo.setChapterIndex(cls.count_chapter+1) comicInfo.setChapterIndex(cls.count_chapter+1)
comicInfo.setChapterName(chapter) comicInfo.setChapterName(chapter)
if comicInfo.nextExistsGetPath("done_") and not os.path.exists(comicInfo.getNewCBZComicChapter("file")):
comicInfo.nextExistsGetPath("done_",remove=True)
if not comicInfo.nextExistsGetPath("done_"): if not comicInfo.nextExistsGetPath("done_"):
cls.comicChapter(href,scramble=True,sleep=random.randint(5,15)) cls.comicChapter(href,scramble=True,sleep=random.randint(5,15))
#存在就校验CBZ包是否完整 #存在就校验CBZ包是否完整