I'm trying to combine several code snippets into one, but what I want to do, is not passing a boolean check.
Basically:
IF the source filename contains a S00E00(letter), then skip the formatting process altogether (i.e. keep the S00E00(letter) as it is - I've added a letter for my own reasons & want to skip this file).
ELSE
do the formatting for S00E00 and TITLE* - (the 'xxxx' is simply there to show if the boolean check works or not... and so far, I've not been able to display it).
This is what I THINK it should be, but it's not passing the first Elvis operator:
Code: Select all
{(fn.match(/(?i)(\bS\d{2}E\d{2}[a-zA-Z])\b/)) ? (fn.match(/(?i)(\bS\d{2}E\d{2}[a-zA-Z])\b/)) : 'xxxx'+
{(allOf{s00e00}{'S'+season.pad(2)+'E'+special.pad(3)}.join(' - '))}
{if(s00e00.contains('-')) {(FORMAT(t)).replaceAll(/[(]([0-9]+)[)]/, {group, match -> ' (Part'+match.pad(1)+')' }).take(80)} else
{(FORMAT(localize.english.title)).replaceAll(/[(]([0-9]+)[)]/, {group, match -> ' (Part'+match.pad(1)+')' }).take(80)}
}
}
But if it's a regular episode, it does not do the 2nd part of the Elvis check; it just exits the function.
*since 4.7, I've had to separate (t) from (localize.english.title), but up to now, that's worked fine - no issue with using both.
The FORMAT code (elsewhere in my format) works fine, and each line snippet here works on its own.
It's just when combining them into one IF/THEN section that it fails.
I figure I'm not using the match function correctly, but I can't find anything online to help me with it - I've tried various alternatives (contains, find...) but can't find anything that seems to work.
Thanks for any direction on this one...
**P.S. I've somehow managed to kill what code I had to pad the Specials episodes to 3 digits - not sure if I've missed something here from previous code. Any thoughts?