Limit episode season year to 1 year (or 2) maybe

Support for Windows users
Post Reply
ChefGregS
Posts: 101
Joined: 30 Mar 2016, 11:14

Limit episode season year to 1 year (or 2) maybe

Post by ChefGregS »

I use the code:

Code: Select all

any{"Season $s [$sy]" }
to add the season number and the year(s) of that season. This normally works just fine as MOST shows seasons are in the same year or over 2 years. EX: Season 1 [1992, 1993]

However, I have a couple shows that for whatever reason pull sometimes up to 10 years for 1 season. This becomes a file name nightmare and can very easily make a name so long that PLEX won't read it.

Using the above code I can end up with (and have....)
Season 2 [1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004]
And that being one small part of the file name...well, you see the problem. LOL

Is there a way to set the number it will pull like we do with

Code: Select all

genres.take(2).join 
to limit genre to only 2 at most?

I know I may have just answered my question but I've tried several variations of that but having issues because sy is converted to a string value. Or maybe I'm remembering my coding days from 40 years ago wrong.

Greg

PS: The worst part of all this is that all the DB's have the info WRONG for the series. Batman: The Animated Series. It's ONLY 2 seasons but the only way to get the right info (most have it as 4 seasons in most iterations and 3 in others...) but thetvdb does have it correctly as Blueray but FileBot doesn't access the Blueray option. DVD option lists it as 3 seasons but that is actually not correct. Even IMDB shows it as 4. It was NOT 4 seasons. Sometimes, this stuff is maddening! LOL
User avatar
rednoah
The Source
Posts: 23059
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Limit episode season year to 1 year (or 2) maybe

Post by rednoah »

e.g. first and last season year:

Format: Select all

{ sy.bounds().joining('-', ' [', ']') }
e.g. first and second season year:

Format: Select all

{ sy.take(2).joining('-', ' [', ']') }
:idea: Please read the FAQ and How to Request Help.
ChefGregS
Posts: 101
Joined: 30 Mar 2016, 11:14

Re: Limit episode season year to 1 year (or 2) maybe

Post by ChefGregS »

rednoah wrote: 07 May 2024, 13:32 e.g. first and last season year:

Format: Select all

{ sy.bounds().joining('-', ' [', ']') }
That's exactly what I needed. Thank you!

Greg
Post Reply