Page 1 of 1

Tag multiple audio

Posted: 19 Jun 2019, 14:39
by aktersnurra95
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!

Re: Tag multiple audio

Posted: 19 Jun 2019, 14:42
by aktersnurra95
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!

Re: Tag multiple audio

Posted: 19 Jun 2019, 15:07
by aktersnurra95
Solved it as such for the time being:

Code: Select all

{audioLanguages =~ ',' ? '[Dual Audio]' : null}
Seems pretty clean to me, though don't know how to detect if it contains multiple commas...

Re: Tag multiple audio

Posted: 19 Jun 2019, 15:49
by devster
You can try using tokenize to split by commas.

Re: Tag multiple audio

Posted: 19 Jun 2019, 17:23
by kim

Code: Select all

{audioLanguages.size() > 1 ? '[Dual Audio]' : null}
looks like audioLanguages already does a unique on it ?

so maybe use:

Code: Select all

{audio.Language.unique().size() > 1 ? '[Dual Audio]' : null}

Re: Tag multiple audio

Posted: 20 Jun 2019, 02:43
by rednoah
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}