-
-
Notifications
You must be signed in to change notification settings - Fork 991
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
[Question] How to use condition? #525
Comments
Not possible at the moment, but it'll probably look something like Maybe it would also be in order to change/cleanup the (sidecar_)shortcode labels, so that |
I would like this as a generic solution.
And +1 for consistency. |
The format string '{a|b|c}' will now try to use the value from 'a' and fall back to 'b' and 'c' if accessing a field raises an exception or if its value is None.
That's now implemented in v.1.13.0.
Well, I ultimately didn't change anything in that regard, because it actually is consistent as is:
So |
@mikf I'm dealing with a submission that erroneously has a None date. Unfortunately, my filename string breaks when you customize the format string like this: {date:.%Y%m%d_%H%M%S} When changed to just {date}, it instead prints the text 'None'. A fallback will work without customizing the date format, but all my files are already in the other style. Ideally, I want it to be blank when I hit a rogue submission that doesn't have date metadata for whatever reason. Ideally I would like something akin to {date:.%Y%m%d_%H%M%S|} (a pipe with no fallback), where if it catches that |
Try The |
@mikf That works, thank you. |
@mikf For twitter, how can I fallback to I want my config like this: |
… and not just None (#525) It would be better to consistently use None for all non-existent fields and/or fields without a valid value, but this is a good enough workaround for now.
I want to make use of the end part of this url for my directory naming.
https://www.instagram.com/p/B6RlaWXJZ3k/
IG posts with multiple media has
sidecar_shortcode
while posts with single media hasshortcode
. How can I useshortcode
instead ifsidecar_shortcode
is missing?"directory": ["{category}", "{username}", "{date:%Y-%m-%dT%H:%M:%SZ} {sidecar_shortcode}"]
This is my config right now.
The text was updated successfully, but these errors were encountered: