[HELP] Appending Release Year to Title With Another Twist (Part 2)

All about user-defined episode / movie / file name format expressions
Post Reply
Romtromon
Posts: 25
Joined: 16 Sep 2016, 09:51

[HELP] Appending Release Year to Title With Another Twist (Part 2)

Post by Romtromon »

So a while ago I made a topic here: viewtopic.php?f=5&t=4230
asking for a way of appending the Release Year to the title since I use the primaryTitle binding and I was given the solution but sadly it didn't work out and I was away from organising my collection for a while. But now I'm back and I want to rectify the issue but I need a little help.

Here's my current format (The one which is not working):

Code: Select all

I:/Anime/{primaryTitle =~ y ? primaryTitle : "$primaryTitle.replace(': ',' - ') ($y)"} {"[$group]"} ({model.collect{ [it.source, it.vc, it.ac] }.transpose()*.minus(null)*.unique()*.join('-').join(' ')})/{primaryTitle.replaceAll(/(?<=\w)[\w\s]/, '').replace(': ', '-')} {any{absolute}{'S'+special}.pad(2)} - {t.replace(': ', ' - ')}
The problem lies in this section:

Code: Select all

{primaryTitle =~ y ? primaryTitle : "$primaryTitle.replace(': ',' - ') ($y)"} {"[$group]"}
I was told to use:

Code: Select all

{primaryTitle =~ y ? primaryTitle : "$primaryTitle ($y)"}
but I needed to replace the colons with dashes so I needed the .replace(': ',' - ') part. However it seems that due to my lack of knowledge on Groovy expressions I've implemented it incorrectly and would really appreciate some help on getting it corrected.

Thanks in advance for any help!!
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [HELP] Appending Release Year to Title With Another Twist (Part 2)

Post by rednoah »

e.g.

Code: Select all

"$primaryTitle ($y)".replace(': ',' - ')
:idea: Please read the FAQ and How to Request Help.
Romtromon
Posts: 25
Joined: 16 Sep 2016, 09:51

Re: [HELP] Appending Release Year to Title With Another Twist (Part 2)

Post by Romtromon »

Thank you very much!! That did the trick!
Post Reply