[HELP] Appending Release Year to Title With a Twist

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 a Twist

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

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

Post by rednoah »

Have you tried the {ny} binding yet?
: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 a Twist

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

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

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