1
0
mirror of https://github.com/ciromattia/kcc synced 2026-05-30 11:13:15 +00:00

add tome text for splits (#963)

This commit is contained in:
Alex Xu
2025-06-13 12:22:07 -07:00
committed by GitHub
parent 87c2ef8033
commit eb0abb538c
2 changed files with 21 additions and 10 deletions
+3 -3
View File
@@ -423,7 +423,7 @@ def buildOPF(dstdir, title, filelist, cover=None):
"</container>"])
f.close()
def buildEPUB(path, chapternames, tomenumber, ischunked, cover: image.Cover):
def buildEPUB(path, chapternames, tomenumber, ischunked, cover: image.Cover, len_tomes=0):
filelist = []
chapterlist = []
os.mkdir(os.path.join(path, 'OEBPS', 'Text'))
@@ -503,7 +503,7 @@ def buildEPUB(path, chapternames, tomenumber, ischunked, cover: image.Cover):
"}\n"])
f.close()
build_html_start = perf_counter()
cover.save_to_epub(os.path.join(path, 'OEBPS', 'Images', 'cover.jpg'), tomenumber)
cover.save_to_epub(os.path.join(path, 'OEBPS', 'Images', 'cover.jpg'), tomenumber, len_tomes)
options.covers.append((cover, options.uuid))
for dirpath, dirnames, filenames in os.walk(os.path.join(path, 'OEBPS', 'Images')):
chapter = False
@@ -1284,7 +1284,7 @@ def makeBook(source, qtgui=None):
else:
print("Creating EPUB file...")
if len(tomes) > 1:
buildEPUB(tome, chapterNames, tomeNumber, True, cover)
buildEPUB(tome, chapterNames, tomeNumber, True, cover, len(tomes))
filepath.append(getOutputFilename(source, options.output, '.epub', ' ' + str(tomeNumber)))
else:
buildEPUB(tome, chapterNames, tomeNumber, False, cover)