anyhoo
Format Version 3.0
This will (I think) with any show with a tvdb id, if no id ADD IT
Code: Select all
{def season = (any{special ? 0 : s} {s}); def episode = (any{special ? special : e} {e}); def eAddOns = ['append_to_response':'external_ids']; def sAddOns = ['append_to_response':'external_ids,content_ratings']; def episodeInfo = net.filebot.WebServices.TheMovieDB.request(\"tv/${id}/season/${season}/episode/${episode}\", eAddOns, Locale.US); def seriesInfo = net.filebot.WebServices.TheMovieDB.request(\"tv/${id}\", sAddOns, Locale.US); def epRating = episodeInfo.vote_average; def epImdbId = episodeInfo.external_ids.imdb_id; def sImdbId = seriesInfo.external_ids.imdb_id; def sTvdbId = any{seriesInfo.external_ids.tvdb_id.toInteger()}{null}; def tvdbInfo = (sTvdbId != null) ? net.filebot.WebServices.TheTVDB.getSeriesInfo(sTvdbId, Locale.US) : null; def mpaaCountryLIST = ['CA', 'DE', 'GB', 'US']; def mpaaRating = seriesInfo.content_ratings.results.findAll{r -> mpaaCountryLIST.any{r.iso_3166_1.contains(it)}}.sort().collect{\"$it.rating\"}.last(); def newGenre = genres*.split(' & ').flatten().each{it}; (allOf{n}{s00e00}{t}{any{tvdbInfo.genres}{newGenre}}{mpaaRating}{'r'+any{epRating.toString() != '0.0' ? epRating.round(1) : null}{rating}}{vf}{vc}{ac}{'-'+any{epImdbId}{sImdbId}}).join(' ')}
the new codeMom S06E01 Pre-Washed Lettuce and a Mime [Comedy, Drama] TV-14 r6.3 -tt8355548
Code: Select all
def sTvdbId = any{seriesInfo.external_ids.tvdb_id.toInteger()}{null};
def tvdbInfo = (sTvdbId != null) ? net.filebot.WebServices.TheTVDB.getSeriesInfo(sTvdbId, Locale.US) : null;
With TVDB genres (Warning: this is not so fast anymore AND it's possible to find wrong show/info)