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

Make Grabber add a _ after illegal folder names #2106

Closed
Vike91 opened this issue Sep 2, 2020 · 2 comments
Closed

Make Grabber add a _ after illegal folder names #2106

Vike91 opened this issue Sep 2, 2020 · 2 comments
Assignees
Labels
bug reproduced This issue was reproduced by the assignee. windows
Milestone

Comments

@Vike91
Copy link

Vike91 commented Sep 2, 2020

Is your feature request related to a problem? Please describe

When saving images in folders (ex. by artist), you sometimes get an artist name that is actually an illegal Windows folder name, thus halting the download.
Illegal folder names:

Describe the solution you'd like

Make Grabber add a _ after the name in this case.

Describe alternatives you've considered

To just put all images in one folder, regardless of artist.

@Bionus
Copy link
Owner

Bionus commented Sep 5, 2020

Do you have an example of illegal folder name that doesn't work?

Because Grabber already has this logic, although it adds a ! rather than a _:

// Fobidden directories or filenames
static const QStringList forbidden { "CON", "PRN", "AUX", "NUL", "COM1", "COM2", "COM3", "COM4", "COM5", "COM6", "COM7", "COM8", "COM9", "LPT1", "LPT2", "LPT3", "LPT4", "LPT5", "LPT6", "LPT7", "LPT8", "LPT9" };

if (invalidChars && forbidden.contains(part)) {
part = part + "!";
}

assertFixFilename(0, "COM1\\image.jpg", "C:\\test\\", "COM1!\\image.jpg");

@Bionus Bionus self-assigned this Sep 5, 2020
@Bionus Bionus added bug cant-reproduce This issue could not be reproduced by the assignee. labels Sep 5, 2020
@Vike91
Copy link
Author

Vike91 commented Sep 5, 2020

From https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file

`Do not use the following reserved names for the name of a file:

CON, PRN, AUX, NUL, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9, LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, and LPT9. `

@Bionus Bionus added reproduced This issue was reproduced by the assignee. windows and removed cant-reproduce This issue could not be reproduced by the assignee. labels Sep 5, 2020
@Bionus Bionus added this to the 7.3.3 milestone Sep 5, 2020
@Bionus Bionus closed this as completed in a3e9e64 Mar 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug reproduced This issue was reproduced by the assignee. windows
Projects
None yet
Development

No branches or pull requests

2 participants