Page 1 of 1

Rename the show name based on existing folder name

Posted: 14 Jun 2021, 18:34
by mouzzampk2014
Hi, I'm looking to rename the show name in filename i.e. The.Blacklist.2015.S01E01.1080p.AMZN.WEB-DL.DDP5.1.H.264-NTG to The.Blacklist.S01E01.1080p.AMZN.WEB-DL.DDP5.1.H.264-NTG. So basically don't rename anything after or including .S0.

My folder name is /The Blacklist/Season 01/The.Blacklist.2015.S01E01.1080p.AMZN.WEB-DL.DDP5.1.H.264-NTG

This is just one example I want to do it with all the files without touching the parent folder structure i.e. folder naming.

I'm using ubuntu and filebot from terminal or windows 10. But not sure how to do in plain mode.

Thank you

Re: Rename the show name based on existing folder name

Posted: 14 Jun 2021, 19:10
by rednoah
TL;DR you wanna remove the year from the file name?


e.g. Plain File Format such as this should get you started:

Code: Select all

fn.removeAll(/[.]\d{4}/}

Re: Rename the show name based on existing folder name

Posted: 14 Jun 2021, 19:35
by mouzzampk2014
Hi @rednoah basically I wanna use the folder name for show in the filename so it could be a year in the folder or not.

So in simple I have few filenames without year but folder has a year or some files has

Code: Select all

Orange.Is.The.New.Black
where folder name is

Code: Select all

Orange is the New Black (2010)
. So I wanna add the year in filename

Re: Rename the show name based on existing folder name

Posted: 15 Jun 2021, 02:33
by rednoah
1.
{folder.name} will give you the name of the folder. Since you have season folders, you will have to go up one folder level {folder.dir.name} to get the name you want.


2.
Match the section of the file name you want to keep might be tricky, but something like this should get you started:
viewtopic.php?t=12643

Re: Rename the show name based on existing folder name

Posted: 15 Jun 2021, 19:56
by mouzzampk2014
Thanks rednoah much apppreciated. I think I will go with database match. Little less stress :)