Hi, I'm trying to get filebot to add [Dual Audio] to files containing audio streams in different languages.
Right now what I'm doing is just checking if audio[1].language is not null, but that will tag all files that have two or more audio streams even if they're all the same language.
What I'm thinking of replacing it with is either to compare first and second language and if they don't match and 2nd stream is not null, then tag as dual.
Or, if you can test for the amount of objects returned from audio.languages or audioLanguages and tag if it returns more than one.
Anyone that could help me with some syntax for one of these would be appreciated!?
Thanks!
Tag multiple audio
-
- Posts: 17
- Joined: 11 May 2019, 11:13
Re: Tag multiple audio
Just realized after posting that I could probably just check if audioLanguages contains a comma since it separates multiple languages with comma.
I think I'll try that for the time being unless someone has a better solution..
Could probably do a comma count check and change from [dual audio] to [multi audio] if 2 or more commas as well.
Cheers!
I think I'll try that for the time being unless someone has a better solution..
Could probably do a comma count check and change from [dual audio] to [multi audio] if 2 or more commas as well.
Cheers!
-
- Posts: 17
- Joined: 11 May 2019, 11:13
Re: Tag multiple audio
Solved it as such for the time being:
Seems pretty clean to me, though don't know how to detect if it contains multiple commas...
Code: Select all
{audioLanguages =~ ',' ? '[Dual Audio]' : null}
Re: Tag multiple audio
You can try using tokenize to split by commas.
I only work in black and sometimes very, very dark grey. (Batman)
Re: Tag multiple audio
Code: Select all
{audioLanguages.size() > 1 ? '[Dual Audio]' : null}
so maybe use:
Code: Select all
{audio.Language.unique().size() > 1 ? '[Dual Audio]' : null}
Re: Tag multiple audio
Yes, {audioLanguages} does indeed do a unique() implicitly, so I'd do it like this as well:
Code: Select all
{audioLanguages.size() > 1 ? '[Dual Audio]' : null}