Rename the show name based on existing folder name

Any questions? Need some help?
Post Reply
mouzzampk2014
Posts: 35
Joined: 07 Jan 2019, 00:49

Rename the show name based on existing folder name

Post 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
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Rename the show name based on existing folder name

Post 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}/}
:idea: Please read the FAQ and How to Request Help.
mouzzampk2014
Posts: 35
Joined: 07 Jan 2019, 00:49

Re: Rename the show name based on existing folder name

Post 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
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Rename the show name based on existing folder name

Post 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
:idea: Please read the FAQ and How to Request Help.
mouzzampk2014
Posts: 35
Joined: 07 Jan 2019, 00:49

Re: Rename the show name based on existing folder name

Post by mouzzampk2014 »

Thanks rednoah much apppreciated. I think I will go with database match. Little less stress :)
Post Reply