fix
This commit is contained in:
parent
0b597305f4
commit
0515c24436
15
test.py
15
test.py
@ -110,15 +110,16 @@ class comicInfo:
|
|||||||
pages = root.find('Pages')
|
pages = root.find('Pages')
|
||||||
if pages is None:
|
if pages is None:
|
||||||
print("XML 中缺少 Pages 标签")
|
print("XML 中缺少 Pages 标签")
|
||||||
return {"metadata": metadata, "pages": None}
|
#return {"metadata": metadata, "pages": None}
|
||||||
|
|
||||||
page_list = pages.findall('Page')
|
if pages != None: page_list = pages.findall('Page')
|
||||||
if not page_list:
|
#if not page_list:
|
||||||
print("Pages 标签下无 Page 元素")
|
# print("Pages 标签下无 Page 元素")
|
||||||
return {"metadata": metadata, "pages": None}
|
# return {"metadata": metadata, "pages": None}
|
||||||
|
|
||||||
# 收集图片路径
|
# 收集图片路径
|
||||||
image_paths = [page.get('Image') for page in page_list if page.get('Image')]
|
if pages != None: image_paths = [page.get('Image') for page in page_list if page.get('Image')]
|
||||||
|
else: image_paths = []
|
||||||
if len(image_paths) == 0:
|
if len(image_paths) == 0:
|
||||||
print(f"{cbz_path} {image_paths} 为空")
|
print(f"{cbz_path} {image_paths} 为空")
|
||||||
img_count = 1
|
img_count = 1
|
||||||
@ -286,7 +287,7 @@ if __name__ == "__main__":
|
|||||||
create_time = time.localtime(os.path.getctime(file)) # 注意:st_birthtime 在Linux/MacOS中可用,但不是所有系统都支持
|
create_time = time.localtime(os.path.getctime(file)) # 注意:st_birthtime 在Linux/MacOS中可用,但不是所有系统都支持
|
||||||
# 格式化时间
|
# 格式化时间
|
||||||
formatted_time = time.strftime('%Y%m%d%H', create_time)
|
formatted_time = time.strftime('%Y%m%d%H', create_time)
|
||||||
if int(formatted_time) == 2025021020:
|
if int(formatted_time) < 2025020401:
|
||||||
print(f"{file} 文件创建时间:", formatted_time)
|
print(f"{file} 文件创建时间:", formatted_time)
|
||||||
comicInfo().update_comicinfo_cbz(file)
|
comicInfo().update_comicinfo_cbz(file)
|
||||||
#if size < 3000:
|
#if size < 3000:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user