I have one MKV that contains two episodes from season 4 of 12 Monkeys; "The Beginning" Part 1 and Part 2.
When I rename it, it becomes "The Beginning Part 1 & The Beginning Part 2", while I'd like it to become just "The Beginning".
The weird thing is that it already works for some episodes; I have another MKV that contains two episodes from season 6 of 30 Rock, "Hey, Baby, What's Wrong" Part 1 and Part 2, which will rename just fine, becoming "Hey, Baby, What's Wrong", instead of the monstrosity above.
I feel like I remember reading something about this on the forum but I couldn't find anything when I searched for it
This is my code, sorry for its ugliness :
Code: Select all
{info.status == 'Ended' ? {['D:', 'F:'].collect{(it+'/'+{n.replaceFirst(/^(?i)(The|A|An)\s(.+)/, /$2/).replaceAll(/[`´‘’ʻ""“”]/, "'").replaceAll(/[:><|]/, " - ").replaceAll(/[?]/, "").replaceAll(/[\s]+/, " ").replace('*','.').replace('/','-')+' ('+{y}+')'}) as File }.sort{ a, b -> a.exists() <=> b.exists() ?: a.diskSpace <=> b.diskSpace }.last()} : 'E:/'+n.replaceTrailingBrackets().replaceFirst(/^(?i)(The|A|An)\s(.+)/, /$2/).replaceAll(/[`´‘’ʻ""“”]/, "'").replaceAll(/[:><|]/, " - ").replaceAll(/[?]/, "").replaceAll(/[\s]+/, " ").replace('*','.').replace('/','-')}/{sc == 1 && ('Mini-Series' in genres || info.status == 'Ended') ? '' : "/Season ${s.pad(2)}"}{episode.special ? 'Season 00' : ''}/{episode.special ? 'S00E'+special : {sc == 1 && ('Mini-Series' in genres || info.status == 'Ended') ? "E${e.pad(2)}" : {S00E00}}} - {t.replaceTrailingBrackets().replacePart(', Part $1').replaceAll(/[`´‘’ʻ""“”]/, "'").replaceAll(/[:><|]/, " - ").replaceAll(/[?]/, "").replaceAll(/[\s]+/, " ").replace('*','.').replace('/','-')}{" [$vf $vc"}{any{$source}{" $source]"}{"]"}} {"[$group]"}{'.'+lang.ISO3}