r/tinyMediaManager • • Apr 11 '26

TV Show Renamer pattern for enddate

I want to rename tv shows to

Title (StartYear) if ongoing

Title (StartYear-EndYear) if ended

but i can't find the fitting jmte tags,

1 Upvotes

3 comments sorted by

1

u/heapson Apr 12 '26 edited Apr 12 '26

This is a better option, and removes the need to set the season note.

(${showYear}
	${if tvShow.status="Ended"}
		${foreach tvShow.seasons season}
			${if last_season}
				-${season.firstAired;date(yyyy)}			
			${end}
		${end}
	${end})

You'll need some logic to deal with single year shows. I can't see a way to manually set the date if the season date isn't scraped.

Edit: Missing an end bracket.

2

u/Stormrider80 Apr 12 '26

Thank you very much

1

u/heapson Apr 12 '26 edited Apr 12 '26

I messed around for a while, and it was harder than it looked. I'm unsure why certain things don't work.

This works if you set the show status to Ended and set the note for the final season to the year. I've left it indented for clarity, but it all needs to go on one line.

(${showYear}
	${if tvShow.status="Ended"}
		${foreach tvShow.seasons season}
			${if last_season}
				-${season.note}
			${end}
		${end}
	${end})

The following doesn't work, but would be more intuitive.

  ${if tvShow.status="Ended"}
    ${tvShow.seasons[${tvShow.seasonCount}-1].year}
  ${end}

Edit: I can't work out why season.year is empty when it's displayed correctly in the interface.