Skip to content

Commit d189f99

Browse files
authored
don't overwrite mobi output with same name (ciromattia#1246)
1 parent 1dce4f8 commit d189f99

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

kindlecomicconverter/comic2ebook.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -963,6 +963,13 @@ def getOutputFilename(srcpath, wantedname, ext, tomenumber):
963963
while os.path.isfile(basename + '_kcc' + str(counter) + ext):
964964
counter += 1
965965
filename = basename + '_kcc' + str(counter) + ext
966+
elif options.format == 'MOBI' and ext == '.epub':
967+
counter = 0
968+
basename = os.path.splitext(filename)[0]
969+
if os.path.isfile(basename + '.mobi'):
970+
while os.path.isfile(basename + '_kcc' + str(counter) + '.mobi'):
971+
counter += 1
972+
filename = basename + '_kcc' + str(counter) + ext
966973
return filename
967974

968975

0 commit comments

Comments
 (0)