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

Possible to use conditional filenames? #1394

Closed
KonoVitoDa opened this issue Mar 21, 2021 · 2 comments
Closed

Possible to use conditional filenames? #1394

KonoVitoDa opened this issue Mar 21, 2021 · 2 comments

Comments

@KonoVitoDa
Copy link

I would like to use different file name patterns, depending on given conditions. It is possible? Or will it be someday?

@mikf
Copy link
Owner

mikf commented Jun 5, 2021

Conditional filenames are now possible with 4cf4043. Not sure if this is the best or a good way of doing it, but for now you set the default filename like before with the filename option, and everything that depends on a condition with filename-conditions:

    "sitename": {
        "filename": "default filename",
        "filename-conditions": {
            "extension == 'mp4'": "video filename",
            "len(title) < 16"   : "some other filename"
        }
    }

I've also considered combining the two into just the regular filename option like the following. It looks cleaner here, but the underlying code it more awkward.

    "sitename": {
        "filename": {
            "extension == 'mp4'": "video filename",
            "len(title) < 16"   : "some other filename",
            "": "default filename"
        }
    }

Let me know if this is OK like this or how I should change things.

@mikf
Copy link
Owner

mikf commented Jun 19, 2021

Update: I changed it to the second example from #1394 (comment), i.e. filename-conditions got dropped and everything is done with just filename.

@mikf mikf closed this as completed Jun 19, 2021
mikf added a commit that referenced this issue Jun 22, 2021
They work the same way as conditional filenames (84d2e64), e.g.

"directory": {
    "score >= 20": ["high score"],
    "score >= 5" : ["mid score"],
    ""           : ["{category}", "default"]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants