Determine if a movie is dubbed or in original language?

All about user-defined episode / movie / file name format expressions
Post Reply
AbedlaPaille
Posts: 107
Joined: 12 Apr 2020, 04:02

Determine if a movie is dubbed or in original language?

Post by AbedlaPaille »

I'm trying to compare info.OriginalLanguage and audio.language for a match (or a mismatch), goal being a snippet that knows if a movie has orignal language audio track or not.

My current setup :

Code: Select all

{ any
	{! (info.OriginalLanguage ==~ /en/) && audio[0].language != /en/ ? audioLanguages[0].name.upper() : ''} // Non English speaking movie AND no English audio, display Audio Language
	{info.OriginalLanguage ==~ /en/ && ! ('en' in audio.language) ? 'DUBBED' :''} // English speaking movie AND no English audio, display 'DUBBED'
	{audio.size() > 1 ? 'MULTI' : ''} // Support for multiple audio languages
}
My Issue : I don't know how to deal with multiple audio languages. Ideally Filebot would search all audio tracks for a match with Original Language, and display that language. Else, display DUBBED. I don't know if it's possible to do.
User avatar
rednoah
The Source
Posts: 22991
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Determine if a movie is dubbed or in original language?

Post by rednoah »

You could try something like this:

Code: Select all

{languages.any{ audioLanguages =~ it } ? "[Original Language]" : "[Dubbed]"}
:idea: Please read the FAQ and How to Request Help.
AbedlaPaille
Posts: 107
Joined: 12 Apr 2020, 04:02

Re: Determine if a movie is dubbed or in original language?

Post by AbedlaPaille »

Thanks man, works wonderfully. Tweaked it to fit my needs.

My result :

Code: Select all

{ any 
	{info.OriginalLanguage ==~ /fr/ && audioLanguages =~ /fr/ ? 'VF' : ''}
	{languages.any{ audioLanguages =~ it } ? '' : 'Dubbed'}
	{textLanguages =~ /fra/ ? 'VOSTFR' : textLanguages =~ /eng/ ? 'VOSTEN' : ''}
	{fn.match(/(?i)VOSTFR|(?i)VOSTEN/)}
	{! (info.SpokenLanguages =~ /en/) && languages.any{ audioLanguages =~ it } ? 'VO' : ''}
}
Those are french scene standards: VO means Original Language, VF means French Language, VOSTFR/VOSTEN means original language with French/English subtitles

1. Catches French movies with a French track (VF)
2. Catches movies without any audio track in the original language (Dubbed)
3. Catches subtitles in French, then English (VOSTFR/VOSTEN)
4. Same as previous for files with hardcoded subs (filename)
5. Catches foreign movies with an audio track in original language (VO)
Post Reply