add the release year of the latest episode at the tv show folder name

Support for Windows users
Post Reply
boe
Posts: 35
Joined: 12 Jun 2016, 15:59

add the release year of the latest episode at the tv show folder name

Post by boe »

Hello,

I would like help renaming just the folders for TV episodes.
My exiting folder & files look like this:

Code: Select all

G:\TVCurrent\Archer\Season 1\Archer (2009) - S01E01 - Mole Hunt 720p.mkv
G:\TVCurrent\Archer\Season 1\Archer (2009) - S01E02 - Training Day 720p.mkv
etc.
G:\TVCurrent\Archer\Season 2\Archer (2009) - S02E01 - Swiss Miss 720p.mkv
etc.
Filebot has done a really good job of renaming my files.

I'd like to include the first airdate in the top topfolder of a series. I'm curious if it could change the folders from above to:

Code: Select all

G:\TVCurrent\Archer (2009)\Season 1\Archer (2009) - S01E01 - Mole Hunt 720p.mkv
G:\TVCurrent\Archer (2009)\Season 1\Archer (2009) - S01E02 - Training Day 720p.mkv
etc.
G:\TVCurrent\Archer (2009)\Season 2\Archer (2009) - S02E01 - Swiss Miss 720p.mkv
etc.
Or even better if it could include the season airdate (at that point i'd take the date out of the filename)

Code: Select all

G:\TVCurrent\Archer (2009)\Season 1 (2009)\Archer- S01E01 - Mole Hunt 720p.mkv
G:\TVCurrent\Archer (2009)\Season 1 (2009)\Archer - S01E02 - Training Day 720p.mkv
etc.
G:\TVCurrent\Archer (2009)\Season 2 (2010)\Archer - S02E01 - Swiss Miss 720p.mkv
etc.
User avatar
rednoah
The Source
Posts: 22990
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Please help with renaming folder for TV episodes

Post by rednoah »

1.
Forget the notion of renaming folders. What you really want is reorganize files (move, rename, etc it's all the same) into a specific path scheme (i.e. you always deal with files, you never deal with folders, because folder don't exist without files).

2.
You decide what path scheme you want:

Code: Select all

G:\TVCurrent\Archer (2009)\Season 1\Archer (2009) - S01E01 - Mole Hunt 720p.mkv
3.
You express your path scheme as FileBot Format:

Code: Select all

G:/TV Shows/{ny}/Season {s}/{ny} - {s00e00} - {t} {vf}
4.
You process all your files. Notice that "renaming files" is the same as "renaming folders" and that FileBot will get it done in a single operation.


BONUS: Season Year

Simple Solution:

Code: Select all

G:/TV Shows/{ny}/Season {s} ({d.year})/{n} - {s00e00} - {t} {vf}
Complex Solution (once you realize that an episode aired in 2016 can belong to a season started in 2015):

Code: Select all

G:/TV Shows/{ny}/Season {s} ({episodelist.findAll{it.season == s}.airdate.year.min()})/{n} - {s00e00} - {t} {vf}
@see viewtopic.php?f=5&t=165
:idea: Please read the FAQ and How to Request Help.
boe
Posts: 35
Joined: 12 Jun 2016, 15:59

Re: Please help with renaming folder for TV episodes

Post by boe »

WOw - thanks for the detailed solution! I'll give it a try.
boe
Posts: 35
Joined: 12 Jun 2016, 15:59

Re: Please help with renaming folder for TV episodes

Post by boe »

Worked like a charm! Thanks again!
GeorgeAl
Posts: 19
Joined: 17 Apr 2020, 17:43

Re: Please help with renaming folder for TV episodes

Post by GeorgeAl »

Can you add the release year of the latest episode at the tv show folder name?

e.g. G:\TVCurrent\Archer (2009)\Season 2\Archer (2009) - S02E01 - Swiss Miss to G:\TVCurrent\Archer (2009-2020)\Season 2\Archer (2009) - S02E01 - Swiss Miss
User avatar
rednoah
The Source
Posts: 22990
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Please help with renaming folder for TV episodes

Post by rednoah »

Yes, conceptually, same as the above, except with max() instead of min().


e.g. latest episode airdate year:

Code: Select all

{episodelist.airdate.year.max()}
e.g. episode airdate min-max values:

Code: Select all

{episodelist.airdate.year.bounds().join('-')}

:idea: Keep in mind that the destination folder structure now varies depending on when you process a given file. This may not be what you want.
:idea: Please read the FAQ and How to Request Help.
Post Reply