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
String Formatting: Leave empty/skip if keyword isn't present rather than "None" #4492
Comments
Similar issue with MangaDex folder and file names formatting. Default format string somehow add «chapter_minor» if it present like this: Documentation doesn't cover this. What should I do? |
What is If you want a value or nothing if not present, use the empty string:
Or, maybe also useful in general, use the
Can also be done on CLI: |
Ah, does this stem from the combination example in
Here's how I understand it, please correct me if wrong: The example field |
This is supposed to work, but it actually doesn't ... As an alternative, one can use
That's how it is supposed to be understood, yes.
Use
( |
It doesn't work? 🤔 That's strange, because I have been using this format for custom path prefixes in my
Or does it work because I also have set Or does it work because these keywords are initially set like this |
This. When the last field in a list of alternatives is considered false, like an empty string, you get the |
fixes {fieldname|''} evaluating to the value of 'keywords-default' instead of an empty string
Looks like I overlooked something. |
Awesome, so FWIW I think where I and maybe @Linda-chan got the presumption of |
If I have a directory
/booru
where search urls create a subdirectory named by{search_tags}
, how can I skip that part of the path and place the image directly in/booru
when{search_tags}
isn't present?For extractor.danbooru,
"directory":["booru","{empty|search_tags}"],
gives me/booru/None/*.jpg
, for invidual posts which don't return asearch_tags
with gallery-dl -K.Originally I thought it would be a matter of filtering
None
with a Format Specifier, butsearch_tags
isn't returned at all with -K, so I guess it inserts the None as a config fallback.invididual post example url: https://danbooru.donmai.us/posts/6640084?q=link
search example url (-K returns search_tags): https://danbooru.donmai.us/posts?tags=konnyakutarooou&z=1
The text was updated successfully, but these errors were encountered: