Page 1 of 1
java.lang.NullPointerException
Posted: 03 Jan 2014, 19:29
by joshua
Hi,
Filebot version 3.8 (lastest)
java version "1.7.0_40"
Java(TM) SE Runtime Environment (build 1.7.0_40-b43)
Java HotSpot(TM) 64-Bit Server VM (build 24.0-b56, mixed mode)
(I removed all the non-essential for the purpose of this bug report) I used this as the format line :
Code: Select all
{def db = net.sourceforge.filebot.WebServices.TheTVDB; db.getEpisodeList(db.search(n)[0], null, Locale.FRENCH).find{episode.season == it.season && episode.episode == it.episode}.title}
When i tried to fetch data with the file
"supernatural.3x01.avi" i have this on the "New names" side :
Code: Select all
[java.lang.NullPointerException] Supernatural - 3x01 - The Magnificent Seven
I tested with Locale.ENGLISH/Locale.getDefault() and i still get the same exception. And with all the "Episode Mode" : TheTVDB, TVRage, AniDB.
Note : The expression
returns the title correctly (in english), but i need it in french.
Is this a known bug ? Or am i doing something wrong?
If you need more details i will try to be as clear as possible!
Regards
Re: java.lang.NullPointerException
Posted: 03 Jan 2014, 20:34
by rednoah
It's not a bug if it's in your code.
So if you need the title in French, why don't you set "Preferred Language" to French so {t} is just French? If you'd still like {n} to be in English you can use {primaryTitle}
The issue is that the hack above is not reliable, and when back-referencing by series name it comes up with different results from a series with the same name from 1977, which doesn't have that episode, so you get back null when you try to get the title.
Search for Supernatural, get back Supernatural 1977 ... Bad luck:
Code: Select all
{def db = net.sourceforge.filebot.WebServices.TheTVDB; db.getEpisodeList(db.search(n)[0], null, Locale.FRENCH)}
This works for TheTVDB if {series} is a TheTVDB object:
Code: Select all
{def db = net.sourceforge.filebot.WebServices.TheTVDB; db.getEpisodeList(series, null, Locale.FRENCH)}
Re: java.lang.NullPointerException
Posted: 03 Jan 2014, 21:14
by joshua
Thanks a lot ! Problem solved.
I didn't know about "{primaryTitle}" this i why i used English as preferred language to have the serie name in english, but i wanted the episode name in french.
Thanks again!

Re: java.lang.NullPointerException
Posted: 03 Jan 2014, 21:40
by joshua
I think i have the same problem with the serie year.
I used the code you provided :
Code: Select all
{episodelist.findAll{it.season == s}.airdate.year[0,-1].unique().join('-')}
But i think i'm still on the Supernatural 1977 for "episodelist" because the airdate array seems to be empty.
Code: Select all
[java.lang.ArrayIndexOutOfBoundsException: Negative array index [-1] too large for array size 0] Supernatural - 3x01 - The Magnificent Seven
I tried to use this :
Code: Select all
{def db = net.sourceforge.filebot.WebServices.TheTVDB; db.getEpisodeList(series, null, Locale.getDefault()).find{episode.season == it.season}.airdate.year[0,-1].unique().join('-')}
But i'm getting a error "No signature method..."
It's really hard sometimes to get a little bit "out-of-the-box". (It's not a complain! I really love Filebot i use it everyday!).
Re: java.lang.NullPointerException
Posted: 04 Jan 2014, 06:59
by rednoah
Haha, this one is hard because it's not supported.
Try the {episodelist} binding in r1968+ for better results.
You made a mistake in your expression. This works:
Code: Select all
{def db = net.sourceforge.filebot.WebServices.TheTVDB; db.getEpisodeList(series, null, Locale.getDefault()).findAll{episode.season == it.season}.airdate.year[0,-1].unique().join('-')}
You can't get first and last year if you're just selecting a single episode.
Re: java.lang.NullPointerException
Posted: 04 Jan 2014, 18:50
by joshua
Thanks again, works perfectly! (as always

)