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

Cook your own download folder/file path #126

Open
clragon opened this issue Mar 29, 2024 · 1 comment
Open

Cook your own download folder/file path #126

clragon opened this issue Mar 29, 2024 · 1 comment
Assignees
Labels
feature New feature or improvement p3 This will not be worked on until further notice

Comments

@clragon
Copy link
Owner

clragon commented Mar 29, 2024

Is your feature request related to a problem? Please describe.

Users wish to decide where their downloaded files go and how they are named

Describe the solution you'd like

template string

We should provide a way for users to customize their folder and file paths!
We can reuse a common idea where users provide a templated path and the app inserts variables based on context.

example

The app provides the following variables: [host, artists, id, ext]
The user may enter any path, containing these variables prefixed with $, e.g.
/$host/$artists - $id.$ext
which for a post from e621 from the artist blitzdrachin with the id 4687398 and extension png would look like:
/e621/blitzdrachin - 4687398.png

pools

Additionally, this could include a variable for the current pool the post is in.
This only applies if the user is inside a search with a single pool tag.

In that case, the $pool variable would contain the name of the pool.
This would allow users to specify e.g.

/$pool/$id.$ext

The variables could also include $index, which indicates which spot the post occupies in the pool,
or maybe the surrounding search.

In cases where a variable is empty and the only part of a given path segment e.g. /$pool/,
the segment should be skipped entirely (Should it work this way?).

Additionally, if a pool name contains characters which are not allowed in folder names, they should be removed
(Which characters are allowed in folder names?).

folders

as seen in the example, the template path may contain folder names.
if a folder does not exist, the app will create it.
the last segment of the path is seen as the file name, regardless of whether it contains the extension variable or not.

@clragon clragon added the feature New feature or improvement label Mar 29, 2024
@clragon clragon self-assigned this Mar 29, 2024
@clragon clragon added the p3 This will not be worked on until further notice label Mar 29, 2024
@clragon
Copy link
Owner Author

clragon commented Mar 29, 2024

One thing that this syntax does not let user express is conditionals.

E.g. a user cannot define a path that either sorts posts by artists or by pools.
This might be an acceptable downside.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or improvement p3 This will not be worked on until further notice
Projects
None yet
Development

No branches or pull requests

1 participant