Info.original language doesn't seem to work for series

All about user-defined episode / movie / file name format expressions
Post Reply
carloscape
Posts: 9
Joined: 03 Jul 2020, 06:28

Info.original language doesn't seem to work for series

Post by carloscape »

After reading the forums I managed to make a working expression for renaming movies:

Code: Select all

{collection.colon(' - ')+'/'}{ (info.OriginalLanguage ==~ /es/) ? primarytitle.colon(' - ') : n.colon(' - ')} ({y})/{ (info.OriginalLanguage ==~ /es/) ? primarytitle.colon(' - ') : n.colon(' - ')} ({y}) {vc.replace('H.264', 'x264').replace('HEVC', 'x265').replace('ATEME','x265').replace('AVC', 'x264').replace('V_MS VFW FOURCC','Xvid')} {vf} {def x = fps.round(0,); if (x > 50) "$x fps"} {vs} {audio[0].language.replace('es','es-lat')} {audio[1].language.replace('es','es-lat')} {audio[2].language.replace('es','es-lat')} {def x = text.language.findResults{ it.toLocale() }.join(' '); if (x) "subt $x"}
So I adapted the expression to work for series:

Code: Select all

{ (info.OriginalLanguage ==~ /es/) ? primarytitle.colon(' - ') : n.colon(' - ')} ({y})/{'S'+s00}/{ (info.OriginalLanguage ==~ /es/) ? primarytitle.colon(' - ') : n.colon(' - ')} - {s00e00} - {t} ({vf}  {audio[0].language.replace('es','es-lat')} {audio[1].language.replace('es','es-lat')} {audio[2].language.replace('es','es-lat')} {def x = text.language.findResults{ it.toLocale() }.join(' '); if (x) "subt $x"})
Problem is it won't work, it ends up something like:

Code: Select all

(2019)/- S02E02 - Leeches
If I use:

Code: Select all

{n.colon(' - ')} ({y})/{'S'+s00}/{n.colon(' - ')} - {s00e00} - {t} ({vf}  {audio[0].language.replace('es','es-lat')} {audio[1].language.replace('es','es-lat')} {audio[2].language.replace('es','es-lat')} {def x = text.language.findResults{ it.toLocale() }.join(' '); if (x) "subt $x"})
That works just fine.

Basically, I would like shows in Spanish to retain their original name and episode naming, and everything else can be renamed to English (default). The expression for movies works rather well, but for series it isn't working for me. I would like some insight on how to fix the expression.
User avatar
rednoah
The Source
Posts: 23946
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Info.original language doesn't seem to work for series

Post by rednoah »

{info} bindings are generic and may provide different kinds of extended information depending on the selected database.

As far as I know, TheTVDB does not currently offer that piece of information. (EDIT: Neither does TheMovieDB::TV)

You may consider using {audioLanguages} to guess episode language based on MediaInfo information.
:idea: Please read the FAQ and How to Request Help.
carloscape
Posts: 9
Joined: 03 Jul 2020, 06:28

Re: Info.original language doesn't seem to work for series

Post by carloscape »

I'm using tmdb as the database of choice for both movies and series.
User avatar
rednoah
The Source
Posts: 23946
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Info.original language doesn't seem to work for series

Post by rednoah »

TheMovieDB::TV support for {info.SpokenLanguages} has been implemented in the latest beta:
viewtopic.php?t=1609


:idea: {info.network} could potentially be used as well to identify Spanish shows, since Spanish shows are likely to be aired on Spanish networks.
:idea: Please read the FAQ and How to Request Help.
carloscape
Posts: 9
Joined: 03 Jul 2020, 06:28

Re: Info.original language doesn't seem to work for series

Post by carloscape »

That seems interesting, I'll check it out.
carloscape
Posts: 9
Joined: 03 Jul 2020, 06:28

Re: Info.original language doesn't seem to work for series

Post by carloscape »

Tested with the beta, and the results are promising.

Code: Select all

Siempre Bruja (2019)/S01/Siempre Bruja - S01E02 - A University Witch
Which variable would I need to use to get the episode name in Spanish ?
User avatar
rednoah
The Source
Posts: 23946
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Info.original language doesn't seem to work for series

Post by rednoah »

You can use {localize} for that:
viewtopic.php?t=3761

e.g.

Code: Select all

{localize.spa.n}
:idea: Please read the FAQ and How to Request Help.
carloscape
Posts: 9
Joined: 03 Jul 2020, 06:28

Re: Info.original language doesn't seem to work for series

Post by carloscape »

Thanks, I'll test.
Post Reply