1
0
mirror of https://github.com/ciromattia/kcc synced 2026-01-07 13:59:34 +00:00

Set first image in folder as cover

The walk() function does not necessarily return filenames in
alphabetical order. This leads to a random cover image.

Sorting filenames before setting the cover images fixes this issue.
This commit is contained in:
fsteffek
2015-02-19 22:33:25 +01:00
parent 68521f7c63
commit f404b9090d

View File

@@ -424,6 +424,7 @@ def buildEPUB(path, chapterNames, tomeNumber):
f.close()
for (dirpath, dirnames, filenames) in walk(os.path.join(path, 'OEBPS', 'Images')):
chapter = False
filenames.sort()
for afile in filenames:
filename = getImageFileName(afile)
if '-kcc-hq' not in filename[0]: