Not getting it ... what do i need

Support for Windows users
Post Reply
dsig
Posts: 1
Joined: 28 Oct 2021, 03:09

Not getting it ... what do i need

Post by dsig »

I have some 35K tv episodes all with the following format ..
001 - Castle - S01E01 - 2009 - Pilot.avi
where the first 001 is the episode number in the series .. the rest is self explaintory.

So what do i need to convert this to a format that Plex will like? Something like {n} - {S}{E} - {y} - {t} ?
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Not getting it ... what do i need

Post by rednoah »

Presumably, you mean to use custom pattern replacement to rename your files directly without matching them to an online database?


:arrow: Plain File Mode allows you to do that, but will require some custom coding:
viewtopic.php?t=2072

e.g. strip the leading "000 - " bit but keep the rest of the file name as is:

Code: Select all

{fn.after(/\d+\W+/)}

:!: The built-in bindings {n} - {s}{e} - {y} - {t} are only defined in Episode Mode were each file is associated with an online Episode object, which is distinct and different from Plain File Mode.
:idea: Please read the FAQ and How to Request Help.
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

Re: Not getting it ... what do i need

Post by kim »

use Plain File Mode as rednoah said but use this format:

Code: Select all

{fn.replaceAll(/(?:\d+\s-\s)(\w+\s-\sS\d+E\d+\s-\s)(?:\d+\s-\s)(\w+)/, '$1$2')}
or

Code: Select all

{fn.replaceAll(/(?:\d+\s-\s)(\w+)(?:\s-\s)(S\d+E\d+)(?:\s-\s)(?:\d+\s-\s)(\w+$)/, '$1 - $2 - $3')}
output:
Castle - S01E01 - Pilot
OR

Code: Select all

{fn.replaceAll(/(?:\d+\s-\s)(\w+)(?:\s-\s)([Ss]\d+[Ee]\d+)(?:\s-\s)(\d+)(?:\s-\s)(\w+$)/, '$1 ($3) - $2 - $4')}
output:
Castle (2009) - S01E01 - Pilot
Post Reply