Extension for download sub-folder, add series-id to file-pattern. #194
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "distinct_series"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Refers to issue #183, maybe #139
The changes in
settings.inisuggest sub-folders by series number/titel, but any of the other file name pattern are good for it, too.I think this is going in the right direction, but I don't like having the separate ini variable for the subdirectory. It feels a little messy, plus, it only allows one level of nesting. Say someone wanted to organize by fandom first, then series - this doesn't allow that.
Instead, I propose allowing the special character
/inside FileNamePattern to represent directories. This allows users to construct any directory structure they prefer, while (hopefully) keeping the code changes fairly simple - you can probably keep most everything the same except for some changes in fileio.save_bytes.Make sure to consider the following in your implementation:
What happens if a section of the pattern evaluates to an empty string
{fandom}/{series_title}/{title}. For works that are not in a series, a naive implementation will result in a folder path that looks likeFandom//Title.epubwhich is not valid. You will need to come up with some way of handling this that will be intuitive for the user.File name truncation must not result in nonsensical file paths
{fandom}/{title}, and the fandom name is longer than FileNameLength, if you truncate the pattern as a whole, every fic in that fandom will be saved in the root directory as "{partial fandom name}.epub". (Even worse, they'll all overwrite each other because they will have the exact same file name.) Make sure to handle this type of scenario in some way.Optionally, you might want to include a way to choose how fics with multiple values in one of the variables are organized
{fandom}/{title}and you download a crossover, you'll end up with a folder structure likeI think that's basically fine, and has the advantage that each work is only saved once, but it might be cool to include some way to indicate (maybe using another one of the reserved special characters) that a variable in the folder path should be split out like so
Like I said, totally up to you if you want to attempt this one, but it could be a fun challenge!
Thanks again for your work on this, and if you run into any problems (or anything is unclear) please feel free to ping me with questions any time.
Thank you for your points!
A
//in the path shouldn't be a problem on Linux systems, but I'm not sure about Windows -- it's better to remove it.The file name truncation was the main reason I introduced the new DirNamePattern -- I'm with you removing that and allowing
/in FileNamePattern is a better way.How to handle works belonging to multiple fandoms/series might be a tricky one ... I'd prefer the second of your options. Not sure how other people'd see that?
I'll update my PR next week.
Functionality has now been rolled into the program - thank you again for your work on this!
Pull request closed