German & English Filename

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
MoraX
Posts: 11
Joined: 03 May 2013, 11:20

German & English Filename

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

Re: German & English Filename

Post 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.
:idea: Please read the FAQ and How to Request Help.
MoraX
Posts: 11
Joined: 03 May 2013, 11:20

Re: German & English Filename

Post by MoraX »

sorry, but what can i do with this code?
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: German & English Filename

Post 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}
:idea: Please read the FAQ and How to Request Help.
MoraX
Posts: 11
Joined: 03 May 2013, 11:20

Re: German & English Filename

Post by MoraX »

Thank you very much!
It's working fine!

What about the Movie Format :P ?


Lord of the Rings [GERMAN TITLE] (2003)
stereotype
Posts: 8
Joined: 04 Jan 2013, 17:21

Re: German & English Filename

Post 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
Hansdampf12345
Posts: 6
Joined: 20 May 2013, 17:02

Re: German & English Filename

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

Re: German & English Filename

Post by rednoah »

No longer supported.
:idea: Please read the FAQ and How to Request Help.
Hansdampf12345
Posts: 6
Joined: 20 May 2013, 17:02

Re: German & English Filename

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

Re: German & English Filename

Post 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.
:idea: Please read the FAQ and How to Request Help.
Hansdampf12345
Posts: 6
Joined: 20 May 2013, 17:02

Re: German & English Filename

Post by Hansdampf12345 »

You are my hero :)
MoraX
Posts: 11
Joined: 03 May 2013, 11:20

Re: German & English Filename

Post by MoraX »

Thank you so much, for keeping this going!!!

Merry Christmas..
MoraX
Posts: 11
Joined: 03 May 2013, 11:20

Re: German & English Filename

Post by MoraX »

It is not working anymore...

Binding exception: database undefined


Any ideas?
MoraX
Posts: 11
Joined: 03 May 2013, 11:20

Re: German & English Filename

Post by MoraX »

Any ideas?
emkayyy
Posts: 2
Joined: 08 Jun 2014, 08:30

Re: German & English Filename

Post 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 :)
MoraX
Posts: 11
Joined: 03 May 2013, 11:20

Re: German & English Filename

Post by MoraX »

Thank you so much!
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: German & English Filename

Post 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}
:idea: Please read the FAQ and How to Request Help.
Hansdampf12345
Posts: 6
Joined: 20 May 2013, 17:02

Re: German & English Filename

Post by Hansdampf12345 »

I get this error "BindingException: "info" Extended meta data not available", but it works :)

THX so much!!!
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: German & English Filename

Post by rednoah »

The new {localize} binding makes things more elegant:
viewtopic.php?f=5&t=3321&p=18449#p18449
:idea: Please read the FAQ and How to Request Help.
Post Reply