rename kepubs with folder input

This commit is contained in:
Alex Xu
2026-10-18 15:34:26 -07:00
parent 4b48b045d2
commit dd7978adb0
+2 -2
View File
@@ -1099,8 +1099,6 @@ def getOutputFilename(srcpath, wantedname, ext, tomenumber):
filename = os.path.join(os.path.abspath(options.output), source_path.stem + tomenumber + ext) filename = os.path.join(os.path.abspath(options.output), source_path.stem + tomenumber + ext)
else: else:
filename = os.path.join(os.path.abspath(options.output), source_path.name + tomenumber + ext) filename = os.path.join(os.path.abspath(options.output), source_path.name + tomenumber + ext)
elif os.path.isdir(srcpath):
filename = srcpath + tomenumber + ext
else: else:
if 'Ko' in options.profile and options.format == 'EPUB': if 'Ko' in options.profile and options.format == 'EPUB':
if source_path.is_file(): if source_path.is_file():
@@ -1108,6 +1106,8 @@ def getOutputFilename(srcpath, wantedname, ext, tomenumber):
else: else:
name = KOBO_TOUCH_DRIVER_REGEX.sub('_', source_path.name) + tomenumber + ext name = KOBO_TOUCH_DRIVER_REGEX.sub('_', source_path.name) + tomenumber + ext
filename = source_path.with_name(name) filename = source_path.with_name(name)
elif os.path.isdir(srcpath):
filename = srcpath + tomenumber + ext
else: else:
filename = os.path.splitext(srcpath)[0] + tomenumber + ext filename = os.path.splitext(srcpath)[0] + tomenumber + ext
if os.path.exists(filename): if os.path.exists(filename):