Modifying {collection} output

Any questions? Need some help?
Post Reply
Ackis
Posts: 1
Joined: 21 Mar 2014, 18:16

Modifying {collection} output

Post 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
User avatar
rednoah
The Source
Posts: 23004
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Modifying {collection} output

Post 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.
:idea: Please read the FAQ and How to Request Help.
Post Reply