Movie Naming Scheme - w/ Cut and Case Conversion

All about user-defined episode / movie format expressions
Post Reply
Savvy
Posts: 16
Joined: 07 May 2012, 07:42

Movie Naming Scheme - w/ Cut and Case Conversion

Post by Savvy » 08 May 2013, 19:52

Hi all,

is it possible to have a scheme that renames movies to show name year and cut as set out below?

so far i have this but it doesn't work just as i would like:

Code: Select all

\{n} ({y}){"CD$pi"}{' '+file.path.match(/UNRATED|REMASTERED|EXTENDED|THEATRICAL|UNCUT|DIRECTORS CUT|THEATRICAL EDITION|THEATRICAL CUT/)}\{n} ({y}){"CD$pi"}{' '+file.path.match(/UNRATED|REMASTERED|EXTENDED|THEATRICAL|UNCUT|DIRECTORS CUT|THEATRICAL EDITION|THEATRICAL CUT/)}
what i'm trying to achieve is that the code looks/matches any of the following types and inserts these in square brackets and also corrects the case.
  • UNRATED|
    REMASTERED|
    EXTENDED|
    THEATRICAL|
    UNCUT|
    DIRECTORS CUT|
    THEATRICAL EDITION|
    THEATRICAL CUT
Now the issue is that not all files will contain the word "cut", for example.

"Avatar.2009.720p.DIRECTORS.mp4" should become "Avatar (2009) [Directors Cut].mp4"

....and to throw things right off the track, there's also the possibility of it being remastered = "Avatar (2009) [Directors Cut][Remastered].mp4"

Thanks,
Sav

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

Re: Movie Naming Scheme - w/ Cut and Case Conversion

Post by rednoah » 09 May 2013, 03:22

Correct Case:

Code: Select all

fn.match(/THEATRICAL.CUT/).upperInitial()
Replacement:

Code: Select all

fn.replaceAll(/THEATRICAL/, 'THEATRICAL CUT').match(/THEATRICAL.CUT/)
Multi-Match:

Code: Select all

fn.matchAll(/THEATRICAL.CUT|REMASTERED/).join(', ')
It's all here:
http://www.filebot.net/naming.html ;)
:idea: Please read the FAQ and How to Request Help.

Savvy
Posts: 16
Joined: 07 May 2012, 07:42

Re: Movie Naming Scheme - w/ Cut and Case Conversion

Post by Savvy » 10 May 2013, 18:46

Thank you, I'll crack on... i do like a challenge lol :)

Savvy
Posts: 16
Joined: 07 May 2012, 07:42

Re: Movie Naming Scheme - w/ Cut and Case Conversion

Post by Savvy » 17 May 2013, 10:29

Hi rednoah,

sorry to be a pain but I've spent hours on this and have only got as far as sorting the case:

Code: Select all

\{n} ({y}){"CD$pi"}{' '+file.path.match(/UNRATED|REMASTERED|EXTENDED|THEATRICAL|UNCUT|DIRECTORS CUT|THEATRICAL EDITION|THEATRICAL CUT/)}\{n} ({y}){"CD$pi"}{' '+file.path.match(/UNRATED|REMASTERED|EXTENDED|THEATRICAL|UNCUT|DIRECTORS CUT|THEATRICAL EDITION|THEATRICAL CUT/)}
could you please help with the other bits? i really cant get the square brackets, replace and multimatch to work, any help would be greatly appreciated.

thank you

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

Re: Movie Naming Scheme - w/ Cut and Case Conversion

Post by rednoah » 17 May 2013, 18:36

This should get you most of the way:

Code: Select all

{n} ({y}) {'['+fn.replaceAll(/(?i)directors|theatrical/, '$0 Cut').matchAll(/UNRATED|REMASTERED|EXTENDED|UNCUT|DIRECTORS.CUT|THEATRICAL.CUT/).join('][').upperInitial().lowerTrail()+']'}
:idea: Please read the FAQ and How to Request Help.

Savvy
Posts: 16
Joined: 07 May 2012, 07:42

Re: Movie Naming Scheme - w/ Cut and Case Conversion

Post by Savvy » 20 May 2013, 15:09

i tip my hat to you rednoah, you've brightened up my miserable Monday, thanks again! :)

Post Reply