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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user