Page 1 of 1

Conditional formating "LANG"

Posted: 20 Dec 2017, 12:31
by noviceiii
Dear all

I have a bit a hard time to figure out the correct syntax. Maybe someone could give me a hand?

I would like to label video files according their language - if any has been detected by filebot. If none has been found, it should remain empty.
Therefore I have {lang} in my formating.

Example
if I have "Avatar2017.stuff.n.things.mp4" in English and would like to get "Avatar (2017).eng.mp4".

So far, so good.
However, if "lang" hasn't been detected, it remains empty and gives "Avatar (2017)..mp4". I would like it to be substituted with "NOLANG".

I was trying with no luck:
- {lang ~= // ? lang : 'NOLANG'}
- {lang = "" ? 'NOLANG' : lang}
- {lang.length < 2 ? lang : 'NOLANG'}

How would it be correct?

Kind regards
n3

Re: Conditional formating "LANG"

Posted: 20 Dec 2017, 14:54
by rednoah
This thread should get you on the right track:
viewtopic.php?f=5&t=1895

Let me know if anything isn't clear.

Re: Conditional formating "LANG"

Posted: 22 Dec 2017, 01:07
by kim
I think you are looking for something like this?

Code: Select all

{any{languages}{'NOLANG'}.join('.')}

Code: Select all

{any{languages}{'NOLANG'}.first()}
{lang} is from filename or subs
{languages} is Spoken Languages