mirror of
https://github.com/ciromattia/kcc
synced 2026-02-19 02:29:04 +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):
|
||||
counter += 1
|
||||
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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user