Page 1 of 1

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

Posted: 01 May 2017, 11:17
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!!

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

Posted: 01 May 2017, 12:11
by rednoah
e.g.

Code: Select all

"$primaryTitle ($y)".replace(': ',' - ')

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

Posted: 01 May 2017, 12:44
by Romtromon
Thank you very much!! That did the trick!