Custom format for TV shows

All about user-defined episode / movie / file name format expressions
Post Reply
DJ1
Posts: 3
Joined: 01 Aug 2017, 12:16

Custom format for TV shows

Post by DJ1 »

Hi just just got file bot need to know the reg expressions stuff...
Something pretty basic as far as I know...
I'm looking to have

Game.On.S01.E01 - Whatever.The.Title.Is.mp4

So basically replacing spaces with "." except after the E** and insertion of " - " after the E**

Cheers.
User avatar
rednoah
The Source
Posts: 22991
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: TV shows

Post by rednoah »

Something simple like this should get you close:

Code: Select all

{n.space('.')}.{s00e00}.{t.space('.')}
:idea: Please read the FAQ and How to Request Help.
DJ1
Posts: 3
Joined: 01 Aug 2017, 12:16

Re: Custom format for TV shows

Post by DJ1 »

hmmm ok I had a chance to play with it a bit....
so

Code: Select all

{n.space('.')}.{'s'+s.pad(2)}e{e.pad(2)} - {t.space('.')}
= Game.On.s01e05 - Matthew,.a.Suitable.Case.for.Treatment

and

Code: Select all

{n.space('.')}.{s00e00} - {t.space('.')}
= Game.On.S01E05 - Matthew,.a.Suitable.Case.for.Treatment


Do you know if theres a way of NOT inserting `.` if `,` exists??

i cant see it if there is a way...


cheers.
User avatar
rednoah
The Source
Posts: 22991
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Custom format for TV shows

Post by rednoah »

DJ1 wrote: 07 Aug 2017, 18:40 Do you know if there's a way of NOT inserting `.` if `,` exists??
For example?

e.g. here's one way to interpret this:

Code: Select all

n.contains(',') ? n : n.space('.')
@see viewtopic.php?f=5&t=4191
:idea: Please read the FAQ and How to Request Help.
DJ1
Posts: 3
Joined: 01 Aug 2017, 12:16

Re: Custom format for TV shows

Post by DJ1 »

Cheers I'll have a look...
Also the renaming I narrowed it down too (with works pretty well ☺️) an example is what I posred above...
I just put the regex there also to be helpful of others

Cheers.
Post Reply