Like what patterns are there? I'll focus multi-eps detection on SxExE patterns.
Code: Select all
S01E01 & E02
S01E01-02
1x01-02
...
Code: Select all
Adventure Time 1x01 Slumber Party Panic - Trouble in Lumpy Space

Code: Select all
S01E01 & E02
S01E01-02
1x01-02
...
Code: Select all
Adventure Time 1x01 Slumber Party Panic - Trouble in Lumpy Space
Sounds like a good opportunity for some unit tests.rednoah wrote:Should work for common multi-episode patterns but might break other aspect of episode/file matching that were previously working.
Code: Select all
{n} - S{s.pad(2)}E{es*.pad(2).join('-E')} - {t}
Whilst newer media in my library is named in the following format:Show Name - Season ## - Episode ##-## (for example, Survivor - Season 01 - Episode 01-02)
I'm using the following code, which recognises multi-episode files for only my newer library content and not my older library content:Show Name ##x##-## (for example, Survivor 01x01-02)
Code: Select all
{n.upperInitial()}/{'Season '+s.pad(2)}/{n.upperInitial()} {s.pad(2)}x{es*.pad(2).join('-')} - {t.upperInitial().replacePart(replacement = ', Part $1')}
Code: Select all
{fn.replaceAll(/S(\d+)E(\d+)/, {def m=3; def e=it[2] as int; it[1]+'x'+(e*m-m+1..e*m).join('-')})}