Page 1 of 1
Adding clean titles into missing filenames
Posted: 25 Mar 2021, 09:09
by mouzzampk2014
Hiya,
All my files are
and they all pretty good but sometime these files missed the
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
Re: Adding clean titles into missing filenames
Posted: 25 Mar 2021, 12:25
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+/)}

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.
Re: Adding clean titles into missing filenames
Posted: 25 Mar 2021, 14:52
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
Re: Adding clean titles into missing filenames
Posted: 25 Mar 2021, 21:38
by mouzzampk2014
I also following different post but just cannot figure it out

Re: Adding clean titles into missing filenames
Posted: 26 Mar 2021, 02:23
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/)}
Re: Adding clean titles into missing filenames
Posted: 26 Mar 2021, 02:55
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
Re: Adding clean titles into missing filenames
Posted: 26 Mar 2021, 04:49
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
Thank you
Re: Adding clean titles into missing filenames
Posted: 26 Mar 2021, 04:55
by mouzzampk2014
I got it but I am not sure if its right but working
So I removed the dot between