-
|
I've been downloading manga more, and a common problem is chapter titles are inconsistent. My desired format is To express it as an ugly-as-hell ternary, my goal would be I have looked at similar discussions, but the conditional syntax gets extremely tedious and verbose when the pattern has to be repeated for a number of variables like directory, metadata, and post-processing (If I could create custom variables and reuse them in all of these various directives, it would simplify life a lot). I don't believe the more compact "?" form applies here since the issue isn't formatting, but instead it's including a string literal. This goes beyond just this, however. Long-term I'd like to apply this kind of conditional text to alter the directory based on the presence of variables (for instance, add a subdirectory based on certain variables being present). Any experts in conditional filenames out there? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
"directory": ["{category}", "[{author[0]}] {manga}", "v{volume:0>2} c{chapter:0>3}{title:? - //}"]
|
Beta Was this translation helpful? Give feedback.
-
|
I figured out a few more things, like chaining the "?" with formatters, so for instance I have this in my directory: For instance, I tried: If there's a way to test for empty and return something, then I can do that, but I didn't see anything that would allow taking an action when empty (or negation). Along the lines of keeping directories organized, is there any way to use straight up conditionals? For instance, a field only interpolates if it's a specific value? Like |
Beta Was this translation helpful? Give feedback.
-
|
Heh, you've created a monster. :) Posting this here as it has a variety of techniques merged into a single config that might be useful to someone else: This separates out manga first by source (comick), then by author/title, and then keeps official items in their own folder (since they are likely duplicative; I might even filter them out as I prefer the fan ones in almost all cases), and then keeps "No Volume" items separate from those with a volume assigned. I also keep the archive file separate for each manga; this way I can easily reset a given manga if I need to, copy it to another system with the archive intact, etc. I find a single archive file too restrictive. Also does a bunch of formatting on the chapter titles, since not every chapter has a volume, sometimes there is a "chapter minor" for things like tankoubon extras, and titles can be hit-and-miss by group. So hopefully this takes all of that into account and keeps it clean. Finally, I do a fair amount of post-processing, as I want chapters in cbz files to cut down on the sheer number of files on disk, BUT I want to keep the metadata separate, in case I want to do some kind of programmatic processing. So we write the metadata for each chapter, then move it out of the way before zipping the images, and change the extension from zip to cbz. |
Beta Was this translation helpful? Give feedback.
There is, and it is also how you'd need to handle the
No Volumecase.https://gdl-org.github.io/docs/configuration.html#extractor-directory