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(' ')}
J