Page 1 of 1

German & English Filename

Posted: 03 May 2013, 11:25
by MoraX
Hi!

Is it possible to give a file the episode name from 2 languages?

Example:

Alias - S01E01 - "German Title" ("English Title")


Any Ideas?

Re: German & English Filename

Posted: 03 May 2013, 12:23
by rednoah
It's a hack but it works:

Code: Select all

{def db = net.sourceforge.filebot.WebServices.TheTVDB; db.getEpisodeList(db.search(n)[0], null, Locale.GERMAN).find{ episode.season == it.season && episode.episode == it.episode}.title}
This {expression} will get you the german episode title.

Re: German & English Filename

Posted: 06 May 2013, 12:59
by MoraX
sorry, but what can i do with this code?

Re: German & English Filename

Posted: 06 May 2013, 13:22
by rednoah
Edit Format => Set Episode Format

Format Expression:
http://www.filebot.net/naming.html

e.g. Alias - S01E01 - German Title - English Title

Code: Select all

{n} - {s00e00} - {t} - {def db = net.sourceforge.filebot.WebServices.TheTVDB; db.getEpisodeList(db.search(n)[0], null, Locale.GERMAN).find{ episode.season == it.season && episode.episode == it.episode}.title}

Re: German & English Filename

Posted: 06 May 2013, 13:38
by MoraX
Thank you very much!
It's working fine!

What about the Movie Format :P ?


Lord of the Rings [GERMAN TITLE] (2003)

Re: German & English Filename

Posted: 11 Feb 2014, 12:12
by stereotype
I have a nearly similar question:

I want to check if my episode has a german audiotrack. If that's true, the title should be german, if not it should be english.

I've tried something like that:

Code: Select all

{if (audio.language == 'de'.echo {t} ) else ({def db = net.sourceforge.filebot.WebServices.TheTVDB; db.getEpisodeList(db.search(n)[0], null, Locale.ENGLISH).find{ episode.season == it.season && episode.episode == it.episode}.title}
) }
but that doesn't work, can somebody help me please?

regards, stereo

Re: German & English Filename

Posted: 04 Oct 2014, 15:38
by Hansdampf12345
rednoah wrote:It's a hack but it works:

Code: Select all

{def db = net.sourceforge.filebot.WebServices.TheTVDB; db.getEpisodeList(db.search(n)[0], null, Locale.GERMAN).find{ episode.season == it.season && episode.episode == it.episode}.title}
This {expression} will get you the german episode title.
Unfortunately this doesn't work anymore in FileBot 4.2
It says "BindingException: "net":undefined"

Any idea how to fix that?

Re: German & English Filename

Posted: 28 Oct 2014, 14:09
by rednoah
No longer supported.

Re: German & English Filename

Posted: 29 Oct 2014, 10:22
by Hansdampf12345
Is there another option to get the title in more than one language?

What about not to choose the language for the title in the settings but with an code like this {t;de} or {t;en} for example?

Would be awesome if you could implement something like that.

Re: German & English Filename

Posted: 29 Oct 2014, 10:30
by rednoah
Had another look and this should work with newer versions:

Code: Select all

{database.getEpisodeList(database.search(n)[0], null, Locale.GERMAN).find{ episode.numbers == it.numbers }.title}
Keep in mind that this is still a hack, and completely unofficial / unsupported.

Re: German & English Filename

Posted: 29 Oct 2014, 11:27
by Hansdampf12345
You are my hero :)

Re: German & English Filename

Posted: 21 Dec 2014, 12:27
by MoraX
Thank you so much, for keeping this going!!!

Merry Christmas..

Re: German & English Filename

Posted: 30 Jan 2015, 15:43
by MoraX
It is not working anymore...

Binding exception: database undefined


Any ideas?

Re: German & English Filename

Posted: 18 Feb 2015, 13:03
by MoraX
Any ideas?

Re: German & English Filename

Posted: 23 Feb 2015, 17:23
by emkayyy
MoraX wrote:Any ideas?
After a lot of messing around and analyzing the Java Exceptions I came up with this fix:

For Series (german):

Code: Select all

{def db = net.filebot.WebServices.TheTVDB; db.getEpisodeList(db.search(n,Locale.GERMAN)[0], null, Locale.GERMAN).find{ episode.season == it.season && episode.episode == it.episode}.title}
This will return the german title of a specific episode.

For Movies (german):

Code: Select all

{net.filebot.WebServices.TheMovieDB.getMovieInfo(movie, Locale.GERMAN,true).name}
I did not change this one as it's still working well for me. Seems like only the Series part broke a bit.

Hope this helps :)

Re: German & English Filename

Posted: 24 Feb 2015, 14:07
by MoraX
Thank you so much!

Re: German & English Filename

Posted: 25 Feb 2015, 04:11
by rednoah
I've had a look at these formats and made some optimizations.

This should work for FileBot v4.5.6 and up.

German Episode Title:

Code: Select all

{net.filebot.WebServices.TheTVDB.getEpisodeList(info.id, null, Locale.GERMAN).find{ it.numbers == episode.numbers }.title}
German Movie Title:

Code: Select all

{net.filebot.WebServices.TheMovieDB.getMovieDescriptor(movie, Locale.GERMAN).name}

Re: German & English Filename

Posted: 26 Mar 2015, 19:34
by Hansdampf12345
I get this error "BindingException: "info" Extended meta data not available", but it works :)

THX so much!!!

Re: German & English Filename

Posted: 21 Jan 2016, 11:03
by rednoah
The new {localize} binding makes things more elegant:
viewtopic.php?f=5&t=3321&p=18449#p18449