Add (1) (2) part numbers to the episode title

All about user-defined episode / movie / file name format expressions
Post Reply
User avatar
rednoah
The Source
Posts: 23043
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Add (1) (2) part numbers to the episode title

Post by rednoah »

The {plex} format automatically removes (1) (2) (1/2) part numbers from the end of the episode title. If you want to keep the (1) (2) part numbers then you can either inject them into {plex} or just use {t} in your own custom format.


e.g. Stargate SG-1 - S01E01 - Children of the Gods (1)

Format: Select all

{n} - {s00e00} - {t}

e.g. Stargate SG-1 - S01E01 - Children of the Gods (1)

Format: Select all

{ plex.id % { " (" + t.match(/[(]([0-9]+)[)]/) + ")" } }

e.g. Stargate SG-1 - S01E01 - Children of the Gods, Part 1

Format: Select all

{ plex.id % { ", Part " + t.match(/[(]([0-9]+)[)]/) } }
:idea: Please read the FAQ and How to Request Help.
warover
Posts: 18
Joined: 26 Mar 2013, 13:52

Re: Add (1) (2) part numbers to the episode title

Post by warover »

How do I apply the replacePart filter so the episode filename looks like this
TV.Show.Title.S00E00.Episode.Title.Part.1.WEBRip.x264-GROUP.mkv
The t.replacepart('Part.$1') doesn't work and repeats the filenames twice
User avatar
rednoah
The Source
Posts: 23043
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Add (1) (2) part numbers to the episode title

Post by rednoah »

:?: Which specific series / episode are you working with?



:idea: Note that t refers to the episode title according to the database and not the file name:

Console Output: Select all

$ filebot -list --db TheTVDB --q "Stargate SG-1"
Stargate SG-1 - 1x01 - Children of the Gods (1)
Stargate SG-1 - 1x02 - Children of the Gods (2)
...
$ filebot -list --db TheTVDB --q "Stargate SG-1" --format '{ ~plex % { ", Part " + t.match(/[(]([0-9]+)[)]/) } }'
Stargate SG-1/Season 01/Stargate SG-1 - S01E01 - Children of the Gods, Part 1
Stargate SG-1/Season 01/Stargate SG-1 - S01E02 - Children of the Gods, Part 2
...


:idea: This topic is primarily about the {plex} format but your question is notably unrelated to that. You probably meant to ask a generic "how do I do this" custom format question. Here's a snippet to get you started:

Console Output: Select all

$ filebot -list --db TheTVDB --q "Stargate SG-1" --format '{ n.space(/./) }.{ s00e00 }.{ t.replacePart(/.Part.$1/).space(/./) }'
Stargate.SG-1.S01E01.Children.of.the.Gods.Part.1
Stargate.SG-1.S01E02.Children.of.the.Gods.Part.2
...
:idea: Please read the FAQ and How to Request Help.
Post Reply