This commit is contained in:
cwx committed 2023-03-30 02:01:06 +08:00
1 parent eaf15969f0
commit 25be464102
8 files changed
+119 -121

No files matched your search

+24 -11
View File
@@ -13,6 +13,8 @@ class comicInfo():
PROGRESS_CBZ = "cbz"
PROGRESS_DONE = "done"
PROGRESS_NONE = "none"
IS_NEW_ICON = False
document = Document()
path_comic_info = None
@@ -50,6 +52,7 @@ class comicInfo():
str_files_img = None
str_chapter_index= None
str_value1 = None
str_current_chapter_img = None
list_skip = []
chapter_node = None
@@ -88,8 +91,7 @@ class comicInfo():
@classmethod
def setComicValue(cls,value):
result = None
if value != None or value != "":
result = value
if value != None or value != "": result = value
return result
@classmethod
@@ -97,6 +99,10 @@ class comicInfo():
@classmethod
def setChapterImgs(cls, value): cls.str_chapter_imgs = cls.setComicValue(value)
@classmethod
def setCurrentChapterImg(cls, value): cls.str_current_chapter_img = cls.setComicValue(value)
@classmethod
def getCurrentChapterImg(cls): return cls.str_current_chapter_img
@classmethod
def getChapterImgs(cls): return cls.str_chapter_imgs
@classmethod
def getLenChapters(cls): return len(cls.str_list_chapter)
@@ -142,7 +148,7 @@ class comicInfo():
@classmethod
def setPageCount(cls,value):
cls.str_page_count = cls.setComicValue(int(value)+1)
cls.str_page_count = cls.setComicValue(int(value))
cls.page_count_node = cls.setNodeAndValue(cls.page_count,cls.str_page_count)
@classmethod
@@ -151,13 +157,14 @@ class comicInfo():
su = "."+str(value[0]).split(".")[-1]
join_list=",".join(value).replace(su,"")
value = join_list.split(",")
cls.setPageCount(str(len(value)))
cls.setPageCount(len(value)+1 if cls.IS_NEW_ICON else len(value))
root_node = cls.document.createElement(cls.pages)
#添加封面
icon_node = cls.document.createElement("Page")
icon_node.setAttribute("Image","000")
icon_node.setAttribute("Type","FrontCover")
root_node.appendChild(icon_node)
if cls.IS_NEW_ICON:
#添加封面
icon_node = cls.document.createElement("Page")
icon_node.setAttribute("Image","000")
icon_node.setAttribute("Type","FrontCover")
root_node.appendChild(icon_node)
for page in value:
c_node = cls.document.createElement("Page")
page = page.split("_")[-1]
@@ -275,6 +282,11 @@ class comicInfo():
def getNewCBZComicChapter(cls,type="dir"): return cls.getNewToComicChapter(".CBZ", type)
@classmethod
def getNewIconComicChapter(cls,type="dir"): return cls.getNewToComicChapter(".jpg", type)
@classmethod
def getNewFileCBZComicChapter(cls,type="file"): return cls.getNewToComicChapter(".CBZ", type)
@classmethod
def getNewFileIconComicChapter(cls,type="file"): return cls.getNewToComicChapter(".jpg", type)
@classmethod
def getNewToComicChapter(cls,su,type="dir"):
@@ -437,7 +449,7 @@ class comicInfo():
@classmethod
def setComicInfo(cls,comicname=None,homepage=None,alias=None,author=None,icon=None,tags=None,
dep=None,genre=None,lang=None,chapters=None,update_at=None):
dep=None,genre=None,lang=None,chapters=None,update_at=None,current_chapter_img=None):
author = str(author).replace("&",",").replace(" ",",")
cls.setHomePage(homepage)
cls.setComicName(str(comicname))
@@ -450,4 +462,5 @@ class comicInfo():
if genre != None: cls.setGenre(genre)
cls.setLang(lang)
cls.setListChapter(chapters)
cls.setUpdateAt(update_at)
cls.setUpdateAt(update_at)
cls.setCurrentChapterImg(current_chapter_img)
+1 -1
View File
@@ -9,7 +9,7 @@ class pathStr:
comic_url_main = None
base_comic_out = os.path.join("/mnt", "Comics")
base_unzip_path = os.path.join("/mnt","OldComics")
old_cbz_path = os.path.join("/mnt","OldComics")
@classmethod
def base_cbz(cls): return cls.getBaseComicPath("CBZ")
@classmethod