Page 1 of 1

Double Episode error (with complex custom format)

Posted: 24 Dec 2020, 20:37
by jerome
I use the GUI version of Filebot on Windows 10.

On a prior post >> viewtopic.php?f=10&t=6218&start=50
Kim posted the wonderful script below. I had been looking for a way to tag tv episode files with the imdb tt reference and this script ended that search. However, when there is a file with a double episode the script returns an error such as:

[Undefined Variable: Cannot get property 'id' on null object] 2 Broke Girls - 1x23 & 1x24 - And Martha Stewart Have a Ball

Would there a work around for this error or will I need to manually edit the combined episode files?

Kim's GUI script using TVDB:

Code: Select all

{import net.filebot.Cache; 
def epId = net.filebot.WebServices.TheTVDB.getEpisodeList(id, null, Locale.US).find{it =~ sxe || it =~ it.special}.id; 
def epTVDbInfo = (epId != null) ? net.filebot.WebServices.TheTVDB.requestJson("episodes/${epId}", Locale.US, Cache.ONE_WEEK).data : null; 
def epImdbId = epTVDbInfo.imdbId; 
def OMDbEpisodeInfo = (epImdbId != null) ? net.filebot.WebServices.OMDb.request(['i':epImdbId]) : null; 
def epOMDbVotes = any{OMDbEpisodeInfo.imdbVotes as int}{null}; 
(allOf{ny}{s00e00}{t}{genres}{any{certification}{omdb.Certification.replaceAll(/N\/A/)}{'NR'}}{'r'+any{epOMDbVotes >= 5 ? OMDbEpisodeInfo.imdbRating : null}{omdb.votes >= 5 ? omdb.rating : null}{votes >= 5 ? rating : null}{' '}}{vf}{vc}{ac}{any{epImdbId}{OMDbEpisodeInfo.imdbID}{'tt'+(omdb.ImdbId).pad(7)}{''}}).join(' ')}
Thanks

J

Re: Double Episode error

Posted: 25 Dec 2020, 05:46
by rednoah
You'd have to debug and fix your custom format. If you use the {plex} format then everything will work out-of-the-box, but with complex custom formats, all bets are off, because custom formats aren't typically written for and tested with all the corner cases (avoiding unnecessary work and complexity that wasn't required for the task at hand, at least for the original author).