Need season interval

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
pr1nc1p3
Posts: 8
Joined: 22 Jan 2012, 14:09

Need season interval

Post by pr1nc1p3 »

Can I do this with actual regular expression funcionality? We maybe would need/create a tag like "seasonairdate" for archive shows:

Expression ---> Result

"\Season {s} ({seasonairdate})\" ---> "Season 4 (2010-2011)"


First year is date of first episode and second is the last episode of the season.


Lot of thanks!! Filebot is the best!!!
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Need season interval

Post by rednoah »

Sorry, that info so not available in the context of an episode expression. Don't really plan on supporting something like that now.

When I get back from my holiday I'll see if I can write you an expression hooking into Filebot internals. That should work just like localised titles long before it was actually supported.
:idea: Please read the FAQ and How to Request Help.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Need season interval

Post by rednoah »

I'm not adding that as an official binding but here is how it works:

Code: Select all

{def tvdb = net.sourceforge.filebot.WebServices.TheTVDB; def y = tvdb.getEpisodeList(tvdb.search(n)[0], Locale.ENGLISH).findAll{it.season == s}.airdate.year; y.min() + '-' + y.max()}
:idea: Please read the FAQ and How to Request Help.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Need season interval

Post by rednoah »

This simplified expression works in newer versions:

Code: Select all

{episodelist.findAll{it.season == s}.airdate.year[0,-1].join('-')}
:idea: Please read the FAQ and How to Request Help.
pr1nc1p3
Posts: 8
Joined: 22 Jan 2012, 14:09

Re: Need season interval

Post by pr1nc1p3 »

Lot of thanks!!!!
Post Reply