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

Archive directive does not honor base-directory, variable substitution, or path restrictions #4100

Closed
diamondsw opened this issue May 25, 2023 · 2 comments

Comments

@diamondsw
Copy link

diamondsw commented May 25, 2023

Whatever code path the "archive" option takes seems to disregard that it's part of the filesystem.

  • It ignores base-directory, so it ends up divorced from the files it's tracking.
  • It doesn't honor variables, so there's no way to use the "base-directory" with it.
  • As I found today when gallerydl redownloaded half of mangadex, it doesn't honor path-restrict or path-strip.

For instance, here's a mangadex snippet:

"base-directory": "/volume1/Archive/Media/Mangadex",
"directory": ["[{author[0]}] {manga}", "v{volume:0>2} c{chapter:0>3} - {title}"],
"archive": "/volume1/Archive/Media/Mangadex/[{author[0]}] {manga}/archive.db",

The manga title has restricted characters in it, as well as a period at the end. So my files end up in one directory (path restricted/stripped) and the archive ends up in another directory (non-path restricted/stripped, and unavailable over the network - Windows file-sharing from Linux NAS). And of course I had to specify the base-directory multiple times by hand because "archive" ignores both it and variables.

The archive is a file. Treat it like one with the same implications.

@mikf
Copy link
Owner

mikf commented May 25, 2023

Duplicate of #3359 and #3361, which were also opened by you.

archive should be treated as a plain filesystem path. It supporting metadata substitutions like {username} is a not well supported "feature" (#985) you should not rely upon unless you are aware of its shortcomings and can deal with them.

@mikf mikf closed this as not planned Won't fix, can't repro, duplicate, stale May 25, 2023
@mikf mikf added the duplicate label May 25, 2023
@diamondsw
Copy link
Author

We have a fundamental disagreement on how gallery-dl treats variable substitution - fine. I give up.

But not applying filesystem restrictions when writing to the filesystem? That's not a design choice, that is a bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants