mirror of
https://github.com/ciromattia/kcc
synced 2026-05-22 07:22:14 +00:00
don't overwrite mobi output with same name (#1246)
This commit is contained in:
@@ -963,6 +963,13 @@ def getOutputFilename(srcpath, wantedname, ext, tomenumber):
|
|||||||
while os.path.isfile(basename + '_kcc' + str(counter) + ext):
|
while os.path.isfile(basename + '_kcc' + str(counter) + ext):
|
||||||
counter += 1
|
counter += 1
|
||||||
filename = basename + '_kcc' + str(counter) + ext
|
filename = basename + '_kcc' + str(counter) + ext
|
||||||
|
elif options.format == 'MOBI' and ext == '.epub':
|
||||||
|
counter = 0
|
||||||
|
basename = os.path.splitext(filename)[0]
|
||||||
|
if os.path.isfile(basename + '.mobi'):
|
||||||
|
while os.path.isfile(basename + '_kcc' + str(counter) + '.mobi'):
|
||||||
|
counter += 1
|
||||||
|
filename = basename + '_kcc' + str(counter) + ext
|
||||||
return filename
|
return filename
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user