Page 1 of 1

Movie Naming Scheme - w/ Cut and Case Conversion

Posted: 08 May 2013, 19:52
by Savvy
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

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

Posted: 09 May 2013, 03:22
by rednoah
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 ;)

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

Posted: 10 May 2013, 18:46
by Savvy
Thank you, I'll crack on... i do like a challenge lol :)

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

Posted: 17 May 2013, 10:29
by Savvy
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

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

Posted: 17 May 2013, 18:36
by rednoah
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()+']'}

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

Posted: 20 May 2013, 15:09
by Savvy
i tip my hat to you rednoah, you've brightened up my miserable Monday, thanks again! :)