fix
This commit is contained in:
1 parent
1e1b20428c
commit
2dd2e46f1b
3 files changed
+12
-6
No files matched your search
+10
-4
@@ -144,13 +144,9 @@ class MangaInfo(BaseModel):
|
|||||||
chapter_link: List[HttpUrl]
|
chapter_link: List[HttpUrl]
|
||||||
"""章节链接"""
|
"""章节链接"""
|
||||||
|
|
||||||
chapters_name: List[str]
|
|
||||||
"""章节名称"""
|
|
||||||
|
|
||||||
#list_chapter: dict[Chapter]
|
#list_chapter: dict[Chapter]
|
||||||
#status: str
|
#status: str
|
||||||
#tags: List[str]
|
#tags: List[str]
|
||||||
|
|
||||||
@field_validator('chapter_link', mode='before')
|
@field_validator('chapter_link', mode='before')
|
||||||
def validate_chapter_link(cls, v):
|
def validate_chapter_link(cls, v):
|
||||||
if isinstance(v, str) and not v.startswith('http'):
|
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 [HttpUrl(cls.base_url + chapter) for chapter in v]
|
||||||
return 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):
|
def get_list_chapter(cls):
|
||||||
chapters_name = cls.chapters_name
|
chapters_name = cls.chapters_name
|
||||||
chapter_link = cls.chapter_link
|
chapter_link = cls.chapter_link
|
||||||
|
|||||||
+1
-1
@@ -375,7 +375,7 @@ class CBZUtils:
|
|||||||
logger.error(f"删除 {file} 发生错误 {e},已跳过")
|
logger.error(f"删除 {file} 发生错误 {e},已跳过")
|
||||||
return False
|
return False
|
||||||
if self._zip_compression(source_dir=chapter_dir, target_file=self.cbz_path, remove=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)
|
time.sleep(0.5)
|
||||||
if clear_chapter:
|
if clear_chapter:
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -195,7 +195,7 @@ class MangaManager:
|
|||||||
|
|
||||||
if title != None:
|
if title != None:
|
||||||
print(f"\n {title}")
|
print(f"\n {title}")
|
||||||
print(f"\n总进度: {completed_chapters}/{total_chapters} 章")
|
print(f"总进度: {completed_chapters}/{total_chapters} 章")
|
||||||
|
|
||||||
elif result['type'] == 'chapter_error':
|
elif result['type'] == 'chapter_error':
|
||||||
logger.error(f"章节 {result['chapter']} 下载失败: {result['error']}")
|
logger.error(f"章节 {result['chapter']} 下载失败: {result['error']}")
|
||||||
|
|||||||
Reference in new issue
Block a user