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

Add option to shorten names of files and directories if too long. #10

Open
0fbcb238c0 opened this issue Jul 9, 2023 · 2 comments
Open
Labels
enhancement New feature or request

Comments

@0fbcb238c0
Copy link

Description

One of the artists I am currently downloading has a few posts, whose filenames surpasses the limit of 255 characters.
Please add an option to shorten filenames to a certain length if they are too long.
I am aware of the option to change the filename template but this is not a solution for me, as this would lead to inconsistency between new and already downloaded files.

Thank you

@Ovear
Copy link
Owner

Ovear commented Jul 11, 2023

Hi,

The windows limit not only file name length but also full path length. It's a bit tricky to make sure it won't hit the limit as the path of parent directory may hit that limit already, which means it will extremely limit the length file name.

The approach that limits file name only may not handle this well, but let me check what I can do here...

But for your question, python provide a powerful string format mini language, which may help. Please refer https://docs.python.org/3/library/string.html#formatspec

@0fbcb238c0
Copy link
Author

0fbcb238c0 commented Jul 19, 2023

I am actually using a Linux filesystem, which has no such limit on absolute path length, every directory in a directory tree can be 255 characters long, including the files.
The absolute path length is therefore of no concern, only a filename or directory name may not be longer than those 255 characters.

@0fbcb238c0 0fbcb238c0 changed the title Add option to shorten names of files if too long. Add option to shorten names of files and directories if too long. Jul 20, 2023
@Ovear Ovear added the enhancement New feature or request label May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants