Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable file renaming for files with the same extension when input and output folders are different #652

Closed
Leska1337 opened this issue Dec 28, 2023 · 4 comments · Fixed by #657
Labels
Enhancement New feature or request good first issue Good for newcomers GUI

Comments

@Leska1337
Copy link

When input and output files have the same extension (CBZ to CBZ conversion for example) kcc automatically adds "kcc_" to the output file name. I understand why it's for, but this also happens when you choose different output folder via shift click.

@axu2
Copy link
Collaborator

axu2 commented Dec 28, 2023

I didn't know you could specify output folder. Where do I shift click? @Leska1337

@Leska1337
Copy link
Author

Convert button. I move files to folder that I set up in Calibre and they are automatically added to my library. But like I said you have to rename them again by hand if the file extensions are the same. For now I rename my cbz input files to zip but this adds an extra step, so would be cool if this is changed in the next update.

@axu2 axu2 added Enhancement New feature or request GUI good first issue Good for newcomers labels Dec 29, 2023
@VampiroMedicado
Copy link
Contributor

VampiroMedicado commented Jan 2, 2024

The problem seems to be because options.output isn't set. So, when the program tries not to overwrite files, it ends up using the only path it knows.

if wantedname is given, it looks for a name in that directory using options.output:

if wantedname is not None:
if wantedname.endswith(ext):
filename = os.path.abspath(wantedname)
elif os.path.isdir(srcpath):
filename = os.path.join(os.path.abspath(options.output), os.path.basename(srcpath) + ext)
else:
filename = os.path.join(os.path.abspath(options.output),
os.path.basename(os.path.splitext(srcpath)[0]) + ext)

With the change done in 69b4ee5 the issue seems to be fixed.

@Leska1337 can you check if it works correctly for you? #657

https://github.com/ciromattia/kcc/wiki/Installation#install-from-source

@Leska1337
Copy link
Author

Yeah, it does, ty

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request good first issue Good for newcomers GUI
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants