Adding clean titles into missing filenames

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

Adding clean titles into missing filenames

Post by mouzzampk2014 »

Hiya,

All my files are

Code: Select all

{fn}
and they all pretty good but sometime these files missed the

Code: Select all

{t}
So what I am looking for is to completely add the clean title into filename if its missing but keep all the remaining information as it is. I know this might be a special case and I would really appreciate if I get some help on this.

Code: Select all

.S01E01.Its.Time.to.Get.Out.of.Town.1080p.AMZN.WEB-DL.DDP5.1.H.264-NTb.mkv
.S01E01.Episode.1.1080p.BluRay.x264-SHORTBREHD.mkv
.S01E01.The.Beast.Forever.1080p.BluRay.REMUX.AVC.DTS-HD.MA.5.1-EPSiLON.mkv
I was thinking to remove the title from filename but then that would look horrible :)

I can use cron to run the task every night.

Thank you so much
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Adding clean titles into missing filenames

Post by rednoah »

For the sake of simplicity, you'll probably want to generate the left-hand side of the file name, via the format engine, and the copy along the right-hand side.


e.g.

Code: Select all

{n}.{s00e00}.{t}.{fn.after(/S\d+E\d+/)}

:idea: The {fn.after(/S\d+E\d+/)} part assumes that the current filename is using S01E01 number patterns and doesn't already include the title, and matches whatever comes after.
:idea: Please read the FAQ and How to Request Help.
mouzzampk2014
Posts: 35
Joined: 07 Jan 2019, 00:49

Re: Adding clean titles into missing filenames

Post by mouzzampk2014 »

I know you always going to sort it out.

Only issue I noticed is that as you mentioned, as long as there aren't any titles already in the filename than it should be okay. But is there anyway I can prevent it please.

Code: Select all

Breaking.Bad.S01E01.Pilot..Pilot.1080p.DTS-HD.MA.5.1.AVC.REMUX-FraMeSToR
Basically all my files have S00E00 and 1080p or 2160p. So anything comes after S00E00 and before 1080p or 2160p can replace with {t}.

Thank you
mouzzampk2014
Posts: 35
Joined: 07 Jan 2019, 00:49

Re: Adding clean titles into missing filenames

Post by mouzzampk2014 »

I also following different post but just cannot figure it out :(
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Adding clean titles into missing filenames

Post by rednoah »

The 1080p / 2160p pattern would be relatively easy to find and match:

Code: Select all

{n}.{s00e00}.{t}.{vf}.{fn.after(/1080p|2160p/)}
:idea: Please read the FAQ and How to Request Help.
mouzzampk2014
Posts: 35
Joined: 07 Jan 2019, 00:49

Re: Adding clean titles into missing filenames

Post by mouzzampk2014 »

rednoah wrote: 26 Mar 2021, 02:23 The 1080p / 2160p pattern would be relatively easy to find and match:

Code: Select all

{n}.{s00e00}.{t}.{vf}.{fn.after(/1080p|2160p/)}
Ooops this didn't work. Apologise I mean it worked but its adding extra .
Dynasties (2018).S01E01.Chimpanzee.2160p..TrueHD.Atmos.7.1.HEVC.HYBRID.REMUX-FraMeSToR
mouzzampk2014
Posts: 35
Joined: 07 Jan 2019, 00:49

Re: Adding clean titles into missing filenames

Post by mouzzampk2014 »

Hi, so its working perfectly fine

Code: Select all

{n.replaceAll(/[`´‘’“”""]/, "'").replaceAll(/[*^|]/, "-").replaceAll(/[;]/, ", ").replaceAll(/[?]/, "!").replaceAll(/ /, " ").replaceAll(/[*\s]+/, " ").colon(' - ')}/
Season {s.pad(2)}/
{n.space('.').replaceAll(/\.-\./,'.').replace('(', '').replace(')', '')}.
{s00e00}.
{t.space('.').replace('&', 'and').removeAll(/[!?.]+$/)}.
{vf}.{fn.after(/1080p|2160p/)}
But its adding extra dot after 1080p or 2160p. Like this

Code: Select all

Dynasties.2018.S01E01.Chimpanzee.2160p..TrueHD.Atmos.7.1.HEVC.HYBRID.REMUX-FraMeSToR
I tried to use this but didn't work

Code: Select all

.replace('2160p..', '2160p.')
Thank you
mouzzampk2014
Posts: 35
Joined: 07 Jan 2019, 00:49

Re: Adding clean titles into missing filenames

Post by mouzzampk2014 »

I got it but I am not sure if its right but working

Code: Select all

{vf}{fn.after(/1080p|2160p/)}
So I removed the dot between

Code: Select all

{vf}{fn}
Post Reply