Deleting a double year

All about user-defined episode / movie format expressions
Post Reply
Bhantu
Posts: 3
Joined: 05 Jun 2019, 06:57

Deleting a double year

Post by Bhantu » 29 Jun 2019, 23:00

Hi,

I'm renaming episode files, using TheTVDB for use in my Plex server.

I don't use the {plex} scheme, because I like to include the year of the show in the title. This is my custom format:

...\TV Shows\{n} ({y})\{episode.special ? 'Specials' : 'Season '+s.pad(2)}\{n} ({y}) - {episode.special ? 'S00E'+special.pad(2) : s00e00} - {t}{subt}

Using this, the first The Blue Planet episode looks like this: The Blue Planet (2001) - S01E01 - Introduction (which is good).

However, the first Life episode looks like this: Life (2009) (2009) - S01E01 - Challenges of Life (which is not good).

Why? Because in TheTVDB some TV shows' names have the year appended (like Life), and others don't.

I'd like to modify my scheme, so the year will still be added, but that if a double year appears (e.g. Life (2009) (2009) - S01E01 - Challenges of Life), the double year will get deleted (e.g. Life (2009) - S01E01 - Challenges of Life).

I couldn't really figure out a solution using https://www.filebot.net/naming.html.

Thanks for reading!

User avatar
rednoah
The Source
Posts: 16820
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Deleting a double year

Post by rednoah » 30 Jun 2019, 04:01

You'll want to use {ny} instead of {n} ({y}) in this case, since that'll implicitly handle the year correctly if it's already part of the series name.
:idea: Please read the FAQ and How to Request Help.

Bhantu
Posts: 3
Joined: 05 Jun 2019, 06:57

Re: Deleting a double year

Post by Bhantu » 30 Jun 2019, 15:40

Thank you, works like a charm!

Post Reply