Page 1 of 1

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

Posted: 03 Jul 2020, 06:53
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.

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

Posted: 03 Jul 2020, 07:08
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.

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

Posted: 03 Jul 2020, 07:23
by carloscape
I'm using tmdb as the database of choice for both movies and series.

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

Posted: 03 Jul 2020, 07:55
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.

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

Posted: 03 Jul 2020, 16:06
by carloscape
That seems interesting, I'll check it out.

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

Posted: 03 Jul 2020, 20:18
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 ?

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

Posted: 04 Jul 2020, 03:41
by rednoah
You can use {localize} for that:
viewtopic.php?t=3761

e.g.

Code: Select all

{localize.spa.n}

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

Posted: 04 Jul 2020, 04:33
by carloscape
Thanks, I'll test.