Page 1 of 1

Need to pull YEAR of S01E01 of a series

Posted: 04 Apr 2020, 20:05
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.

Re: Need to pull YEAR of S01E01 of a series

Posted: 04 Apr 2020, 22:08
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}

Re: Need to pull YEAR of S01E01 of a series

Posted: 05 Apr 2020, 06:53
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}

Re: Need to pull YEAR of S01E01 of a series

Posted: 12 Apr 2020, 14:48
by DavidRTurner
Thanks, kim & red - got me where I needed to be!~

Re: Need to pull YEAR of S01E01 of a series

Posted: 27 Apr 2020, 10:53
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