Fetch episode and movie names in french and english

All about user-defined episode / movie format expressions
Post Reply
Baradhur
Posts: 10
Joined: 12 Jan 2016, 12:24

Fetch episode and movie names in french and english

Post by Baradhur »

Hi there,

I've been searching for a way to do this but i can't manage to find a proper answer so i'm asking here.

Im trying to build a scheme format that would include the name of a movie (or episode title) in both english and french.

My current naming format:

Code: Select all

//Films/13 Fantômes (2001) - fr 720p.avi
Expected naming output format:

Code: Select all

//Films/Horreur/13 Fantômes (2001) (Steve Beck) (Thir13en Ghosts) [fr][720p][AC3]
So something like

Code: Select all

//Films/{genres[0]}/{n.french} ({year}) ({director}) ({n.english}) [{fn.match(/fr/vostfr/multi/)'}][{vf}][{ac}]



Does this kind of elements exists {n.french} {n.english} ? If not, is there any proper way to achieve this?


(The next step for me would be to have the primary name in english and french as secondary when the lang is english, but that is another question)


Thank you very much for any help i would get!
User avatar
rednoah
The Source
Posts: 19133
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Fetch episode and movie names in french and english

Post by rednoah »

1.
{primaryTitle} may be what you're looking for. It's not the same as {n}, but since {primaryTitle} not affected by your language preferences you can probably make it work. Keep in mind that {primaryTitle} may not necessarily be English but rather the original title.

2.
A not-so-proper solution is this.

e.g.

Code: Select all

{net.filebot.WebServices.TheMovieDB.getMovieDescriptor(movie, Locale.FRENCH).name}
:idea: Please read the FAQ and How to Request Help.
Baradhur
Posts: 10
Joined: 12 Jan 2016, 12:24

Re: Fetch episode and movie names in french and english

Post by Baradhur »

Thanks it worked like a charm!! I'm now able to have the name in both languages :)

In the meantime, is it possible to have an if else statement in case the locale.FRENCH doesn't send any result to just take {n}?

Something like

Code: Select all

{net.filebot.WebServices.TheMovieDB.getMovieDescriptor(movie, Locale.FRENCH).name = "" ? {n} : {xxx}}
In the same way, is it possible to apply a treatment only if some part are match in the originale filename?

Code: Select all

{fn.match(xxx) = "" ? {true} : {false}} 
Thank you very much for your help!
User avatar
rednoah
The Source
Posts: 19133
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Fetch episode and movie names in french and english

Post by rednoah »

In theory you could do something like this:

Code: Select all

{any{ net.filebot.WebServices.TheMovieDB.getMovieDescriptor(movie, Locale.FRENCH).name }{ n }}
But it won't work because you'll always get something back, either French, or some (most likely English) default value.

@see viewtopic.php?f=5&t=1895
:idea: Please read the FAQ and How to Request Help.
Baradhur
Posts: 10
Joined: 12 Jan 2016, 12:24

Re: Fetch episode and movie names in french and english

Post by Baradhur »

Yeah i saw it yesterday when i tried to come up with something.

I tried the following kind of approach with no luck, maybe with your knowledge it would be easier:

Code: Select all

 {if {xxx.getMovieDescriptor(movie, Locale.FRENCH).name} = {xxx.getMovieDescriptor(movie, Locale.ENGLISH).name} then ""} 

Is anything like this possible?


I also tried to put the same condition but with the country of origin, but it seems that it isn't supported, based on your answer to this thread:
viewtopic.php?f=8&t=1928

Otherwise we would be able to do the following:

Code: Select all

{if {countryOrigin != "FR"} then {xxx.getMovieDescriptor(movie, Locale.ENGLISH).name} then ""}} 
Don't know either if this is a possibility.

On the overall, i'm having a hard time making if statement to work ^^


Thank you again for your time, it is very helpfull!
User avatar
rednoah
The Source
Posts: 19133
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Fetch episode and movie names in french and english

Post by rednoah »

1.
{} does not mean what you think it means, and = neither. Learn basic Groovy if you want to know more. ;)

2.
Set Preferred Language to French and then do something like this:

Code: Select all

{allOf{n}{primaryTitle}.unique().join(' - ')}
(Simple Solution == Good Solution)

3.
You can do fancy stuff, as I've shown you here:
viewtopic.php?f=8&t=1928#p14097

e.g. use n if France is in the ProductionCountries:

Code: Select all

{info.ProductionCountries.contains('FR') ? n : primaryTitle}
4.
With this kind of thing it's always good to explain what you want to achieve in the first place, i.e. what kind of filenames you want to come up with using your format.
:idea: Please read the FAQ and How to Request Help.
Baradhur
Posts: 10
Joined: 12 Jan 2016, 12:24

Re: Fetch episode and movie names in french and english

Post by Baradhur »

With you precious help, i was able to come up with something that allowed me to sort all my movies in one stroke! Thank you very much for that.

Here is the final result:

Code: Select all

/video/Films/{any{genres[0]}{"Unknown"}}/ 
{any{net.filebot.WebServices.TheMovieDB.getMovieDescriptor(movie, Locale.FRENCH).name}{n}} 
{(pn >= 2) ? " cd$pi" : ""} 
{"($y)"} {""} 
- {"($director)"} 
{net.filebot.WebServices.TheMovieDB.getMovieDescriptor(movie, Locale.FRENCH).name == net.filebot.WebServices.TheMovieDB.getMovieDescriptor(movie, Locale.ENGLISH).name ? "" : "(${net.filebot.WebServices.TheMovieDB.getMovieDescriptor(movie, Locale.ENGLISH).name})"} 
{"[${fn.lower().match(/- fr|- vostfr|- multi|\[fr\]|\[vostfr\]|\[multi\]/).replace('- ', '')}]"} 
{allOf{"$vf"}{"$vc"}{"$ac"}}
What it does:
1. Place file in folder sorted by genres
2. Select the name in french, the normal name if empty
3. add cd1,2,3 if needed
4. add year if available
5. add director if available
6. If the name in english is the same as in french, display it. Otherwise blank
7. Catch information from filename regarding languages available
8. Some resolution and codec information, displayed only if available


I'm now heading for the tv shows and anime, i hope that it will be faster now that i'm familiar with filebot :)
User avatar
rednoah
The Source
Posts: 19133
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Fetch episode and movie names in french and english

Post by rednoah »

The {localize} binding has been added with r3436 to improve support for this kind of use case.


Episode Format Example:

Code: Select all

{localize.German.title}
Movie Format Example:

Code: Select all

{localize.Chinese.name}
:idea: Please read the FAQ and How to Request Help.
Baradhur
Posts: 10
Joined: 12 Jan 2016, 12:24

Re: Fetch episode and movie names in french and english

Post by Baradhur »

Very nice! I'll update my querry asap, it will look a lot more prettier with this improvement :) Thank you very much for you hard work on this!
Baradhur
Posts: 10
Joined: 12 Jan 2016, 12:24

Re: Fetch episode and movie names in french and english

Post by Baradhur »

Hi Rednoah,

I just tried to implement your news localization binding with no luck. I've downloaded the latest version of the app available on the website. Is it included yet?

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

Re: Fetch episode and movie names in french and english

Post by rednoah »

Latest Revision > Latest Release

@see viewtopic.php?f=7&t=1609
:idea: Please read the FAQ and How to Request Help.
Baradhur
Posts: 10
Joined: 12 Jan 2016, 12:24

Re: Fetch episode and movie names in french and english

Post by Baradhur »

Hi Thank you for that.

I downloaded and replaced the lastest filebot.jar file. I'm trying to use the {localize.French.Title} tag, but it still doesn't seem to work.

Any ideas?

thank you!
User avatar
rednoah
The Source
Posts: 19133
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Fetch episode and movie names in french and english

Post by rednoah »

It works:
Image

Did you make sure that French data you want actually exists? If not, then TheTVDB will default to English.
:idea: Please read the FAQ and How to Request Help.
Baradhur
Posts: 10
Joined: 12 Jan 2016, 12:24

Re: Fetch episode and movie names in french and english

Post by Baradhur »

When i input it, it brings back nothing, not even the english title! I probably miss something when i replaced the jar file. Do i need to do something else to have the update? an dev settings somewhere maybe?
User avatar
rednoah
The Source
Posts: 19133
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Fetch episode and movie names in french and english

Post by rednoah »

1;
Define "Nothing". It'll either work, or there'll be an error. Either way, there'll be something for you to take a screenshot of.

2.
No such thing as dev settings. Just replacing the jar will do. What revision are you using? Have a look at the FAQ if you don't know how to see what revision you're using.
:idea: Please read the FAQ and How to Request Help.
Baradhur
Posts: 10
Joined: 12 Jan 2016, 12:24

Re: Fetch episode and movie names in french and english

Post by Baradhur »

By nothing, i mean it brings back no title at all and i don't have any error. When i put {Localize.French.Title} or any other languages, it remains empty. I'll post a screen shot when i get home.

As for the version, i took the latest version available on sourceforge at the time, which was like end of february. I took the following file filebot-4.6.1-r36xx-fin.jar.

I probably did something wrong, but i don't know what.
ricobelo
Posts: 3
Joined: 14 Apr 2016, 16:42

Re: Fetch episode and movie names in french and english

Post by ricobelo »

{localize.french.title is working fine for my series with version 4.6.2

Now is there a way to get the series name in french also.
I tried {localize.french.name} but it does not work with series format

thanks
User avatar
rednoah
The Source
Posts: 19133
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Fetch episode and movie names in french and english

Post by rednoah »

See properties:

Code: Select all

{localize.French}
Pick the one you want:

Code: Select all

{localize.French.SeriesName}
:idea: Please read the FAQ and How to Request Help.
Post Reply