Page 1 of 1

Multi-Part / Multi-File Episode Support

Posted: 05 Mar 2015, 22:20
by whereswaller
Hi,
Some of the older media in my library comprises single episodes split across multiple files. For example:

Keys To The VIP - Season 01 - Episode 05 (Part 1)
Keys To The VIP - Season 01 - Episode 05 (Part 2)

I would like to convert these files to be named:

Keys To The VIP 01x05 - Mark Sparks Vs. Kyle 'The Diesel' (Part 1/2)
Keys To The VIP 01x05 - Mark Sparks Vs. Kyle 'The Diesel' (Part 2/2)

At present, I am using the following code, which correctly retains the part number information (through fn.match) but does not provide the part count:

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')}{" "+fn.match(/\(Part \d+\)/)}
Example outputs:

Keys To The VIP 01x05 - Mark Sparks Vs. Kyle 'The Diesel' (Part 1)
Keys To The VIP 01x05 - Mark Sparks Vs. Kyle 'The Diesel' (Part 2)

Is there a way to add the part count? I note that the codes pi and pn only work for movies whereas I am dealing with television in this instance.

Many thanks,
James

Re: Multi-Part / Multi-File Episode Support

Posted: 06 Mar 2015, 06:55
by rednoah
As long as you have the same episode multiple time you can do that count yourself by accessing the context/model of the current renaming view:

Code: Select all

{model.episode.count{ it == episode }}
Note that only File<->Episode matches will appear in the {model} binding.

Re: Multi-Part / Multi-File Episode Support

Posted: 06 Mar 2015, 09:58
by whereswaller
Thanks rednoah.

For anyone curious, my final code was:

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')}{" "+fn.match(/\(Part \d+/)+" of "+model.episode.count{ it == episode }+")"}
Example outputs:

Keys To The VIP 01x05 - Mark Sparks Vs. Kyle 'The Diesel' (Part 1 of 2)
Keys To The VIP 01x05 - Mark Sparks Vs. Kyle 'The Diesel' (Part 2 of 2)