Page 1 of 1

Naming in 2 languages

Posted: 10 Dec 2013, 17:59
by eminkoff
Hello.
Is it possible to rename using next scheme:
RussianName (EnglishName) [Year,720p]?

Also, for some reason, with my current scheme ({n} {[y, {vf}]}) i'm getting script67$_run_closure1@ error instead of 720p/1080p marks.
How could i fix that?

Thank you.

Re: Naming in 2 languages

Posted: 10 Dec 2013, 18:11
by rednoah
1.
There is {n} for your preferred language and {primaryTitle} which is always English. So set Preferred Language to Russian first then just use these two.

2.
Learn from my examples:
http://www.filebot.net/forums/viewtopic.php?f=5&t=2

Re: Naming in 2 languages

Posted: 10 Dec 2013, 19:03
by eminkoff
rednoah wrote:1.
There is {n} for your preferred language and {primaryTitle} which is always English. So set Preferred Language to Russian first then just use these two.
It helped, thank you, however IMDB doesn't provide names on russian, although TheMovieDB does.
rednoah wrote:2.
Learn from my examples:
http://www.filebot.net/forums/viewtopic.php?f=5&t=2
After much digging, i did get it to work! thank you for all your help! :)

Re: Naming in 2 languages

Posted: 19 Dec 2013, 18:50
by noimporta
@eminkoff : would it be possible for you to paste your code for russian for movies?

I've been trying to get dual language titles for movies but I'm stuck. I've checked other threads referenced for episodes and the pyload script for original/german. So far I've tried the following dir structure

Code: Select all

/cygdrive/z/test/The.Great.Gatsby.2013.720p/the.great.gatsby.2013.720p.mkv
and I've tried with the following script

Code: Select all

#!/bin/sh
PATH=/home/usuario/FileBot:/cygdrive/c/Program\ Files/Java/jre7/bin/:$PATH
#FileBot-defs
MovieFormat="movieFormat=Movies/{net.sourceforge.filebot.WebServices.TMDb.getMovieInfo(movie, Locale.SPANISH).name} {'('+y+')'}/{net.sourceforge.filebot.WebServices.TMDb.getMovieInfo(movie, Locale.SPANISH).name} {'('+y+')'}"
Extras="clean=y artwork=n subtitles=es"
FILEBOT="filebot.cmd"
OUTPUT_DIR="z:/test/"
# Filebot-Part
$FILEBOT -script "fn:cleaner" "$OUTPUT_DIR"
$FILEBOT -script "fn:amc" --log all -non-strict -no-analytics --output "$OUTPUT_DIR/OUT"  --conflict override --def "$MovieFormat" "$Extras" "$OUTPUT_DIR"
I think it's because the WebService doesn't work like I think

Code: Select all

MissingMethodException: No signature of method: org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.executeScript() is applicable for argument types: (java.lang.String, java.util.LinkedHashMap, java.util.ArrayList) values: [fn:cleaner, [root:false], [Z:\test]]
groovy.lang.MissingMethodException: No signature of method: org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.executeScript() is applicable for argument types: (java.lang.String, java.util.LinkedHashMap, java.util.ArrayList) values: [fn:cleaner, [root:false], [Z:\test]]
        at Script3.run(Script3.groovy:378)
        at net.sourceforge.filebot.cli.ScriptShell.evaluate(Unknown Source)
        at net.sourceforge.filebot.cli.ScriptShell.runScript(Unknown Source)
        at net.sourceforge.filebot.cli.ArgumentProcessor.process(Unknown Source)
        at net.sourceforge.filebot.Main.main(Unknown Source)
Failure (▒_▒)

The path and output file looks like this:

Code: Select all

/cygdrive/z/test/OUT/Movies/ (2013)/ (2013).mkv
Any ideas?

Re: Naming in 2 languages

Posted: 19 Dec 2013, 19:17
by rednoah
1.
Are you using the latest version?

2.
Why don't you just use {n} and set --lang es to get Spanish data?

Re: Naming in 2 languages

Posted: 19 Dec 2013, 21:48
by noimporta
@rednoah : thanks for the reply and for the brilliant software.

Yes, I think it's the last version

Code: Select all

FileBot 3.8 (r1840) / Java(TM) SE Runtime Environment 1.7.0_09
Somehow I though I had to use locales, never guessed --lang would be that straight fordward. With your answer I got it fixed. So for future references from other users:

Code: Select all

filebot.cmd -rename MOVIE_FILE --lang es --db tmdb -non-strict --format {primaryTitle}.{y}.{n}.{vf}
where as rednoah said : primaryTitle will usually mean english and n is the language from --lang

Re: Naming in 2 languages

Posted: 25 Apr 2020, 04:10
by AbedlaPaille
I've been trying to set up an automatized bilingual French/English {n} using French as preferred language with a fall back to Primary Title if the movie/show isn't French like this thread is saying.

I've come up with this

Code: Select all

{audio[0].language =~ /fr/ || info.OriginalLanguage =~ /fr/ ? norm(n) : norm(primaryTitle)}}
Why does it not work exactly? Why does the field being undefined means Filebot prints no name instead of falling back to english?

Re: Naming in 2 languages

Posted: 25 Apr 2020, 05:27
by rednoah
AbedlaPaille wrote: 25 Apr 2020, 04:10 Why does it not work exactly? Why does the field being undefined means Filebot prints no name instead of falling back to english?
You're not covering the error case, so there's plenty of opportunity for this snippet to fail without producing any value:
viewtopic.php?t=1895


:?: What does the status message say?


:idea: If you're using the CLI to prototype your format, use the GUI instead, so you can see status messages.

Re: Naming in 2 languages

Posted: 25 Apr 2020, 17:43
by AbedlaPaille
Mmh, i've seen this thread but i don't understand what i should do?

I'm not using command line no, just copying format expression in the gui. Where are status messages?

Edit: wow so i tried my luck just adding self like this :

Code: Select all

{self.info.OriginalLanguage =~ /fr/ || self.audio[0].language =~ /fr/ || self.languages =~ /fr/ ? norm(n) : norm(primaryTitle)}
and it's just worked for the english file i was testing on.. Did i find the answer to prevent crashing the expression if not French yet still check if French? I don't get what self is exactly.

edit 2: nope didn't work, it printed english show in French mb. Working on getting you the screenshots, cheers a lot for the support

Re: Naming in 2 languages

Posted: 25 Apr 2020, 17:48
by rednoah
AbedlaPaille wrote: 25 Apr 2020, 17:43 I'm not using command line no, just copying format expression in the gui. Where are status messages?
I'd point them out, but you didn't include screenshots... Please read How to Request Help. ;)

Re: Naming in 2 languages

Posted: 27 Apr 2020, 03:00
by AbedlaPaille
My problem was you can't play around n and primaryTitle on TV shows like you can on movies. If matching in French primaryTitle will also be in French wheras for movies it gives me the title in the original language.

Guess i'll run my French shows with French preferred and my English shows with English, and i'll be pleased of my bilingual movie scheme :D

Thanks so much for this wonderful tool, best soft i've ever bought and the help here is amazing, allows noobs like me to piece something together and even learn.