Tag multiple audio

Any questions? Need some help?
Post Reply
aktersnurra95
Posts: 17
Joined: 11 May 2019, 11:13

Tag multiple audio

Post 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!
aktersnurra95
Posts: 17
Joined: 11 May 2019, 11:13

Re: Tag multiple audio

Post 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!
aktersnurra95
Posts: 17
Joined: 11 May 2019, 11:13

Re: Tag multiple audio

Post 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...
devster
Posts: 417
Joined: 06 Jun 2017, 22:56

Re: Tag multiple audio

Post by devster »

You can try using tokenize to split by commas.
I only work in black and sometimes very, very dark grey. (Batman)
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

Re: Tag multiple audio

Post 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}
User avatar
rednoah
The Source
Posts: 22974
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Tag multiple audio

Post 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}
:idea: Please read the FAQ and How to Request Help.
Post Reply