Page 1 of 1

[HELP] Appending Release Year to Title With a Twist

Posted: 15 Oct 2016, 14:50
by Romtromon
So I'd like to appened the release year to the title of my shows (mostly anime) but the problem is there are some anime titles that already include the year at the end; "Mushishi Zoku Shou (2014)" for example.

I'd like to modify my format to only append the year to the titles that don't already have the year included.

Here's my current format:

Code: Select all

I:/Anime/{primaryTitle.replace(': ',' - ')} {"[$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(': ', ' - ')}
Thanks in advance for any help!!

Re: [HELP] Appending Release Year to Title With a Twist

Posted: 15 Oct 2016, 15:03
by rednoah
Have you tried the {ny} binding yet?

Re: [HELP] Appending Release Year to Title With a Twist

Posted: 17 Oct 2016, 14:46
by Romtromon
rednoah wrote:Have you tried the {ny} binding yet?
That won't work for me since I use the primaryTitle binding and my issue is with the fact that some anime primary titles already include the year so the year would be shown twice.

Re: [HELP] Appending Release Year to Title With a Twist

Posted: 17 Oct 2016, 18:44
by rednoah
If you want to use primaryTitle then you'll need to do that check yourself:

Code: Select all

{primaryTitle =~ y ? primaryTitle : "$primaryTitle ($y)"}