Multi-Part / Multi-File Episode Support

All your suggestions, requests and ideas for future development
Post Reply
whereswaller
Posts: 23
Joined: 05 Mar 2015, 21:59

Multi-Part / Multi-File Episode Support

Post 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
User avatar
rednoah
The Source
Posts: 22995
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Multi-Part / Multi-File Episode Support

Post 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.
:idea: Please read the FAQ and How to Request Help.
whereswaller
Posts: 23
Joined: 05 Mar 2015, 21:59

Re: Multi-Part / Multi-File Episode Support

Post 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)
Post Reply