I'm having an issue with some conditionals and was hoping someone could point out what my error is.
The file I'm using as reference is
Code: Select all
Blood and Black Lace (6 donne per l'assassino) (1964) (Arrow Restoration).mkv
What I want to achieve: Add "Arrow" or "Criterion" to file names if they are present in the original file name.
My code:
Code: Select all
{
if (fn.match(/criterion/)) {
".Criterion"
} else if (fn.match(/arrow/)) {
".Arrow"
} else { ".none"
}
}
In the above, if I change "/criterion/" to say "/arrow/", then ".Criterion" is successfully added to the new name. So, it looks like if the first statement is false, the rest of the code isn't hit - it doesn't even hit the else. What am I doing wrong here?