Page 1 of 1

Modifying {collection} output

Posted: 21 Mar 2014, 18:27
by Ackis
Hello everyone, I found an example of some rename rules and I've modified it for my own preferences.

{genre}\{collection.replaceFirst(/^(?i)(The|A|An|Collection|Collection of the|Live-Action)\s(.+)/, /$2/).replaceAll(/Saga Collection/, "Saga").replaceAll(/[`´‘’ʻ""“”]/, "'").replaceAll(/[:|]/, " - ").replaceAll(/[?]/, "!").replaceAll(/[*\s]+/, " ")}\{n.replaceFirst(/^(?i)(The|A|An)\s(.+)/, /$2, $1/)} [{y}]\{n.replaceFirst(/^(?i)(The|A|An)\s(.+)/, /$2, $1/)} [{y}]

Right now it's showing me things such as "Avatar Collection". My goal with the first replaceFirst was to just have it list Avatar. What am I missing?

My ultimate goal is to have the naming schema for movies as:
Genre\(Series)\Movie, The [Year]\Movie, The [Year].ext

The series is optional if it exists.

An aside, is there a way to make the editor for the format larger? I've only been able to expand the window horizontally, I'd like to possibly have word wrapping or something as this string is a bit unwieldy to use. :)

Thanks. :D

Re: Modifying {collection} output

Posted: 22 Mar 2014, 04:06
by rednoah
This will do:

Code: Select all

{collection.replaceAll(/Collection$/).trim()+'/'}
But you'll probably need to extend the replace regex, now it just works for cases like "Avatar Collection".


You can open a Groovy Console with with F5. It's not made for writing format expressions but it'll still give you syntax highlighting.