Question about multi-part episodes

Any questions? Need some help?
Post Reply
Vulkandr
Posts: 4
Joined: 08 May 2024, 19:43

Question about multi-part episodes

Post by Vulkandr »

Sometimes when 2 parter episodes are combined and its not the last episode of a season, plex gets confused until you rearrange the numbers down the line.

so lets say 'Parks and Recreation - 6x01 - London' and 'Parks and Recreation - 6x02 - London' are combined into one file, i then have to name it 'Parks and Recreation - 6x01 - London' and name the next episode, 'Parks and Recreation - 6x02 - The Pawnee-Eagleton Tip Off Classic', instead of its true designation of 'Parks and Recreation - 6x03 - The Pawnee-Eagleton Tip Off Classic', and so on and so forth for the rest of the season by hand. Is there a way to have filebot handle this? Because filebot will want to name it 'Parks and Recreation - 6x03 - The Pawnee-Eagleton Tip Off Classic'' because that's it's airing order, but unfortunately the two parter is combined into 1 file, so I can't name them that way. If I simply leave out episode 2, plex gets confused and attributes the automatic tagging incorrectly to the wrong episodes, off by 1 episode for the whole season. I know inevitably this is a plex issue, but the only solution is renaming the files, so I was hoping filebot had a way to correct this.

I know this is a big jumble of words, so if you need any further information or clarification feel free to ask. thanks to anyone who may offer up a solution.
User avatar
rednoah
The Source
Posts: 23063
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Question about multi-part episodes

Post by rednoah »

:idea: If the SxE numbers in the files you have are incorrect (according to the database) then FileBot will likely mismatches the files / episodes.



:arrow: If you have episode titles in the files, then you can you can use Match by Episode Title.



:arrow: You can always use Manual Matching as a last result.



:idea: Edit Match allows to to select multiple episodes, which then allows your format to generate the correct multi-episode file name:

Code: Select all

Parks and Recreation - S06E01-E02 - London


:idea: Note that TheMovieDB is generally recommended, and in this case specifically it would work much better since the SxE numbers you have match the SxE numbers in the database:

Code: Select all

Parks and Recreation - S06E01 - London
Parks and Recreation - S06E02 - The Pawnee-Eagleton Tip-Off Classic


:arrow: Please read Q: How do I fix misidentified files? and make sure to follow each link for general guidance.
:idea: Please read the FAQ and How to Request Help.
Vulkandr
Posts: 4
Joined: 08 May 2024, 19:43

Re: Question about multi-part episodes

Post by Vulkandr »

Thank you, that was actually very informative, I learned a lot about the presets thanks to this. I'm curious, under the 'Clean name' Preset is there a way to add a parameter to have it ignore certain things? like dashes(-), so that it leaves them in?

Thanks again.
User avatar
rednoah
The Source
Posts: 23063
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Question about multi-part episodes

Post by rednoah »

Vulkandr wrote: 09 May 2024, 19:02 Thank you, that was actually very informative, I learned a lot about the presets thanks to this. I'm curious, under the 'Clean name' Preset is there a way to add a parameter to have it ignore certain things? like dashes(-), so that it leaves them in?
Yes. You can not use clean() and instead have your own custom code remove / replace text patterns as desired.
:idea: Please read the FAQ and How to Request Help.
Vulkandr
Posts: 4
Joined: 08 May 2024, 19:43

Re: Question about multi-part episodes

Post by Vulkandr »

You wouldn't happen to know where I can get a full list of the things "clean" removes?

I figured out that

Code: Select all

{ fn.replaceAll("1080p", "") }
works and will remove 1080p from any titles, but obviously someone before me has done all the homework on all the possible things that need to be removed from titles.

If not, at the very least, I can just replace "1080p" with whatever ending text uploaders put on their files, which helps already, as I won't have to do it file by file individually if I want to keep everything else.
User avatar
rednoah
The Source
Posts: 23063
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Question about multi-part episodes

Post by rednoah »

Vulkandr wrote: 09 May 2024, 20:29 You wouldn't happen to know where I can get a full list of the things "clean" removes?
There is no list. The code will replace / remove characters and text patterns, split off things before / after at specific patterns, etc.


The 720p / 1080p /etc pattern is typically what starts the string of extra information, so using that as a cut-off point might work well for you:

Format: Select all

{ fn.before(/\d{3,4}p/) }
:idea: Please read the FAQ and How to Request Help.
Vulkandr
Posts: 4
Joined: 08 May 2024, 19:43

Re: Question about multi-part episodes

Post by Vulkandr »

Thank you, after much trial and error, I have 4 scripts that I combined into 1 preset for all the parameters I can think of for now. I'm a novice when it comes to javascript, learning as I go.

Here is what I came up with and the result.

Code: Select all

{ fn.replaceAll("\\_", " ").replaceAll("\\.", " ").replaceAll("\\([^()]*\\)|\\[[^\\[\\]]*\\]", "").before(/\d{3,4}p/) }
Buzz_Lightyear_of_Star_Command (2000) - 1x01 - The.Torque.Armada (guthix) [duh] 2160p HDR
Resulting in
Buzz Lightyear of Star Command - 1x01 - The Torque Armada
Came in here asking for a feature and ended up learning how to make the exact version I want myself, thanks.
User avatar
rednoah
The Source
Posts: 23063
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Question about multi-part episodes

Post by rednoah »

Vulkandr wrote: 10 May 2024, 07:52 Came in here asking for a feature and ended up learning how to make the exact version I want myself, thanks.
That is the way. Well done!
:idea: Please read the FAQ and How to Request Help.
Post Reply