This commit is contained in:
caiwx86 2025-02-06 18:54:27 +08:00
parent 1e1b20428c
commit 2dd2e46f1b
3 changed files with 12 additions and 6 deletions

View File

@ -144,13 +144,9 @@ class MangaInfo(BaseModel):
chapter_link: List[HttpUrl]
"""章节链接"""
chapters_name: List[str]
"""章节名称"""
#list_chapter: dict[Chapter]
#status: str
#tags: List[str]
@field_validator('chapter_link', mode='before')
def validate_chapter_link(cls, v):
if isinstance(v, str) and not v.startswith('http'):
@ -160,6 +156,16 @@ class MangaInfo(BaseModel):
return [HttpUrl(cls.base_url + chapter) for chapter in v]
return v
chapters_name: List[str]
"""章节名称"""
@field_validator('chapters_name', mode='before')
def validate_chapters_name(cls, v):
#1
if isinstance(v , str):
list_name = []
return list_name.append(v)
return v
def get_list_chapter(cls):
chapters_name = cls.chapters_name
chapter_link = cls.chapter_link

View File

@ -375,7 +375,7 @@ class CBZUtils:
logger.error(f"删除 {file} 发生错误 {e},已跳过")
return False
if self._zip_compression(source_dir=chapter_dir, target_file=self.cbz_path, remove=False):
logger.debug(f"章节 {chapter_dir.name} 打包完成: {self.cbz_path}")
logger.info(f"章节 {chapter_dir.name} 打包完成: {self.cbz_path}")
time.sleep(0.5)
if clear_chapter:
try:

View File

@ -195,7 +195,7 @@ class MangaManager:
if title != None:
print(f"\n {title}")
print(f"\n总进度: {completed_chapters}/{total_chapters}")
print(f"总进度: {completed_chapters}/{total_chapters}")
elif result['type'] == 'chapter_error':
logger.error(f"章节 {result['chapter']} 下载失败: {result['error']}")