fix
This commit is contained in:
+12
-5
@@ -4,7 +4,7 @@ import logging
|
||||
from src.config import BASE_IMAGES_DIR
|
||||
from src.sites.base import BaseSite
|
||||
from src.sites.configs.rouman import RoumanSite
|
||||
from src.common.utils import MangaDownloader, CBZUtils
|
||||
from src.common.utils import MangaDownloader, CBZUtils, MangaUtils
|
||||
from src.common.naming import DirectoryNaming, FileNaming
|
||||
from src.common.exceptions import MangaException
|
||||
from src.common.item import MangaItem, MangaInfo
|
||||
@@ -73,6 +73,9 @@ class MangaManager:
|
||||
if not chapter.status == "downloaded":
|
||||
total += 1
|
||||
total_chapters = total
|
||||
# 找到0个章节则证明已全部下载跳过
|
||||
if total == 0: MangaUtils().add_manga(manga_name)
|
||||
else: MangaUtils().delete_manga(manga_name)
|
||||
logger.info(f"找到 {total_chapters} 个章节")
|
||||
manga_item.chapters.extend(chapters) # 添加章节到 MangaItem
|
||||
yield {
|
||||
@@ -153,10 +156,14 @@ class MangaManager:
|
||||
async with list_site_handler() as site:
|
||||
manga_list = await site.get_manga_list(manga_url)
|
||||
for title,url in zip(manga_list.title, manga_list.url):
|
||||
print(title,url)
|
||||
logger.info(f"开始下载 漫画: {title}")
|
||||
logger.info(f"{url}")
|
||||
await self.download_manga(str(url))
|
||||
title = FileNaming.chinese_file_name(title)
|
||||
save_manga = MangaUtils().search_manga(title)
|
||||
if save_manga != None:
|
||||
logger.info(f"{save_manga} 已存在")
|
||||
else:
|
||||
logger.info(f"开始下载 漫画: {title}")
|
||||
logger.info(f"{url}")
|
||||
await self.download_manga(str(url))
|
||||
|
||||
@classmethod
|
||||
async def download_manga(cls, url: str, save_dir: Path = BASE_IMAGES_DIR):
|
||||
|
||||
Reference in New Issue
Block a user