preserve filename after SxxExx

All about user-defined episode / movie / file name format expressions
Post Reply
muggi
Posts: 2
Joined: 20 Feb 2022, 13:59

preserve filename after SxxExx

Post by muggi »

HI,
hope someone have af solution for this scenario:
so far I created a command for when I want to rename som tv shows,
where I want to add Year onto the show folder and create season folder.
In the Season folder I want to add to the filenames:
year in the showname
and after the SxxExx i want to add episode title .
After that i added different rls info like VC, Source, rlsgroup and ect.

an example is:

Code: Select all

/{n.replace(':', ' - ')}{n =~ y ? '' : " ($y)"} {tags}/{'/Season '+s00}/{n.space('.')}.({y}).{'S'+s.pad(2)}E{e.pad(2)}.{t.replace(' ','.').replace':','-'}.{vf}{ if (vc == 'x265' || vc == 'HEVC') ' HEVC' else if (vc == 'AVC' || vc == 'x264') ' x264' else '' }.{source}.{vc}.{ac}.{af}.{VideoCodec}{-group}
Image

But as i also wat to keep eventually a Language tag like NORDIC, I thought maybe it would be easier to add a code to:

Code: Select all

[code]/{n.replace(':', ' - ')}{n =~ y ? '' : " ($y)"} {tags}/{'/Season '+s00}/{n.space('.')}.({y}).{'S'+s.pad(2)}E{e.pad(2)}.{t.replace(' ','.').replace':','-'}
that would preserve everything from episode number in the original filename:
so this file:
Star.Wars.Visions.S01E01.NORDiC.ENG.1080p.WEB-DL.H.264-RAPiDCOWS

would become:
Star.Wars.Visions.(2021).S01E01.The.Duel.NORDiC.ENG.1080p.WEB-DL.H.264-RAPiDCOWS.

other way to describe it, is to:
add Year after showtitle
add Episodetitle after Episode number, and keeping everything else

sorry for the long post for a solution that may be straight way
User avatar
rednoah
The Source
Posts: 23946
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: preserve filename after SxxExx

Post by rednoah »

You can use String.after() to copy & paste some pattern from the original file name onto the destination file path:

Code: Select all

{ fn.after(/S[0-9]+E[0-9]+/) }
:idea: Please read the FAQ and How to Request Help.
muggi
Posts: 2
Joined: 20 Feb 2022, 13:59

Re: preserve filename after SxxExx

Post by muggi »

Thank you sir, that was spot on. Just what I was looking for ;-)
Post Reply