Need to pull YEAR of S01E01 of a series

All about user-defined episode / movie / file name format expressions
Post Reply
DavidRTurner
Power User
Posts: 85
Joined: 01 Feb 2014, 16:59

Need to pull YEAR of S01E01 of a series

Post by DavidRTurner »

After TheTVDB's overhaul last fall, I've seen many new 'specials' added which shouldn't be there, often with prior year's one-offs or other non-series items, that cause the episodelist.airdate.year(min) field to bring in a year that is wrong.
I'm working on cleanup of those, but meantime, I've done an overhaul of my collection and found numerous series with incorrect premiere year references (i.e. Twilight Zone (1959) is pulling 1952 as the first year, because of a related episode back in 1952 now listed.)

What I want is to bring in the Season 1 Episode 1 airdate.year to use as my series baseline year - i.e. SERIES NAME (YEAR-of-S01E01).

Is there a way to explicitly pull out the year from a specific episode (S01E01) to then use as a reference field in the rest of my format?

Thanks.
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

Re: Need to pull YEAR of S01E01 of a series

Post by kim »

viewtopic.php?f=8&t=6228&p=43413#p43413

Code: Select all

{episodelist.findAll{it.season == 1}.airdate.year.min()}

Code: Select all

{episodelist.find{it.season == 1 && it.episode == 1}.airdate.year}
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Need to pull YEAR of S01E01 of a series

Post by rednoah »

{y} will give you the series start year as defined in the metadata for the series.

Code: Select all

{y}

{sy} will give you the episode airdate interval for the season at hand, so {sy.min()} might work.

Code: Select all

{sy.min()}

As a last resort, you can always filter the episodes you want / not want in your own code:

Code: Select all

{episodelist.find{ it.regular }.airdate.year}
:idea: Please read the FAQ and How to Request Help.
DavidRTurner
Power User
Posts: 85
Joined: 01 Feb 2014, 16:59

Re: Need to pull YEAR of S01E01 of a series

Post by DavidRTurner »

Thanks, kim & red - got me where I needed to be!~
User avatar
sighunter
Posts: 22
Joined: 26 Aug 2016, 08:08

Re: Need to pull YEAR of S01E01 of a series

Post by sighunter »

kim wrote: 04 Apr 2020, 22:08 viewtopic.php?f=8&t=6228&p=43413#p43413

Code: Select all

{episodelist.findAll{it.season == 1}.airdate.year.min()}

Code: Select all

{episodelist.find{it.season == 1 && it.episode == 1}.airdate.year}
thanks, this was very helpful. I hate that tvdb changed this, but with this I can work around that
Post Reply