remove_old_chapter
This commit is contained in:
parent
2dd2e46f1b
commit
0d5e26662f
@ -91,18 +91,9 @@ class BaseSite(ABC):
|
|||||||
down_chapter = []
|
down_chapter = []
|
||||||
for chapter in list_chapter:
|
for chapter in list_chapter:
|
||||||
cbz_path = FileNaming.chapter_cbz(manga_info=manga_info,chapter=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):
|
if os.path.exists(cbz_path):
|
||||||
logger.debug(f"{chapter.title} 章节已存在")
|
logger.debug(f"{chapter.title} 章节已存在")
|
||||||
chapter.status = "downloaded"
|
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)
|
down_chapter.append(chapter)
|
||||||
return down_chapter
|
return down_chapter
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user