mirror of
https://github.com/ciromattia/kcc
synced 2026-10-20 08:22:33 +00:00
rename kepubs with folder input
This commit is contained in:
@@ -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):
|
||||||
|
|||||||
Reference in New Issue
Block a user