name duplicated kepubs with kcc0, kcc1, etc

This commit is contained in:
Alex Xu
2026-10-18 15:42:42 -07:00
parent dd7978adb0
commit bf3de53eb5
+2
View File
@@ -1113,6 +1113,8 @@ def getOutputFilename(srcpath, wantedname, ext, tomenumber):
if os.path.exists(filename):
counter = 0
basename = os.path.splitext(filename)[0]
if ext == '.kepub.epub':
basename = os.path.splitext(basename)[0]
while os.path.exists(basename + '_kcc' + str(counter) + ext):
counter += 1
filename = basename + '_kcc' + str(counter) + ext