Expression to deal with multiple episodes in a single file
Posted: 14 Mar 2021, 00:50
After looking through the forum for ways to deal with multiple episodes in a single file I came up with the following expression:
Which seems to do exactly what I want if there is only two episodes in the file, but something like episode one of SGU which has three parts for its first episode it breaks down and does something weird. How can I fix the expression so that I end up with something like this: 01x01-03?
Code: Select all
{episode.regular ? {' '+s.pad(2)+'x'+episodes.collect{[it.episode]*.pad(2).join('x') }.join('-')} : ' 00x'+special.pad(2)}