Easier way to prep double episode file for Filebot?

Support for Windows users
Post Reply
redangellion
Posts: 5
Joined: 23 Dec 2019, 20:04

Easier way to prep double episode file for Filebot?

Post by redangellion »

I use Plex, and I have some shows that are two episodes per file. I'm trying to rename them to get them to show up properly in Plex.

For example, I have Camp Lazlo, and the files right now are just named:

s1e1

s2e2

and so on. But each file contains two episodes. So the s1e1 is actually season 1 episodes 1 and 2.

Now, to get them to show up properly in Plex, I can rename the files like this:

s01e01-e02

Then run them through Filebot, which will clean them up and add the actual episode names and such. Then reanalyze in Plex and it lists the two separate episodes. (Of course, it plays the file from the beginning whether you select the first or second episode on a file, but whatever, at least it's listed properly).

My question is, is there some easier way to do the intial renaming (from s1e1 --> s01e01-e02)? Of course, if I just run the files through Filebot as is, it just sets renames them from "s1e1" to "Camp Lazlo - S01E01." Which is nice, but it's ignoring the double episode thing.

I'm a super noob to Filebot so if anyone knows something I don't regarding this, I'd appreciate it.
User avatar
rednoah
The Source
Posts: 22994
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Easier way to prep double episode file for Filebot?

Post by rednoah »

The latest beta has some nice quality-of-live improvements for this particular use case:
viewtopic.php?t=1609

Image
Image
:idea: Please read the FAQ and How to Request Help.
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

Re: Easier way to prep double episode file for Filebot?

Post by kim »

You may want to look here:
viewtopic.php?f=8&t=11072
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

Re: Easier way to prep double episode file for Filebot?

Post by kim »

only 2 episodes in 1 then use e.g. (the '.take(2)' part)

Code: Select all

{n}{def fileSet = episodelist.findAll{ airdate == it.airdate }.take(2); ' - S' + s.pad(2) + 'E' + fileSet.episode.min().pad(2) + '-E' + fileSet.episode.max().pad(2) + ' - ' + fileSet.title.join(' & ') }
output:
Camp Lazlo - S01E01-E02 - Gone Fishin' (sort of) & Beans are from Mars
User avatar
rednoah
The Source
Posts: 22994
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Easier way to prep double episode file for Filebot?

Post by rednoah »

If you have a large number of files, and can't be bothered to fix things one by one, then you can be smart with a 2-step approach, akin to what @kim is suggesting.


1. A pre-rename step that artificially adds additional identifying information to the file name:

Code: Select all

{episodelist.dropWhile{ it != episode }.take(2)}
Image

2. A final rename step as usual:
Image
:idea: Please read the FAQ and How to Request Help.
redangellion
Posts: 5
Joined: 23 Dec 2019, 20:04

Re: Easier way to prep double episode file for Filebot?

Post by redangellion »

rednoah wrote: 23 Dec 2019, 20:50 The latest beta has some nice quality-of-live improvements for this particular use case:
viewtopic.php?t=1609

Image
Image
I got the portable version of the beta (I have the Windows store version of Filebot so can't upgrade it) and I don't see that context menu anywhere? When I right click I just see the exact same context menu as I usually see (no Edit Match or Edit Name). Am I missing something?
redangellion
Posts: 5
Joined: 23 Dec 2019, 20:04

Re: Easier way to prep double episode file for Filebot?

Post by redangellion »

rednoah wrote: 23 Dec 2019, 22:16 If you have a large number of files, and can't be bothered to fix things one by one, then you can be smart with a 2-step approach, akin to what @kim is suggesting.


1. A pre-rename step that artificially adds additional identifying information to the file name:

Code: Select all

{episodelist.dropWhile{ it != episode }.take(2)}
Image

2. A final rename step as usual:
Image
Thank you for the response! As I said, I'm a complet Filebot noob. Where exactly do I enter that string of code to make this work? Do I put it as a new format in the Edit Format window?

Edit: Yup, I figured out how to use the code! For this code to work I need to manually rename the files to odd numbers first, right? For example:

My files currently are named:

s1e1
s1e2
s1e3
etc.

To use this code I need to manually rename the files like this:

s1e1
s1e2 becomes s1e3
s1e3 becomes s1e5

before running the code, right? If I just leave as is and run the code, Filebot wants to assign duplicate names to pairs of episode numbers. That's a pretty simple manual rename. comparetively, so I'm not complaining.
redangellion
Posts: 5
Joined: 23 Dec 2019, 20:04

Re: Easier way to prep double episode file for Filebot?

Post by redangellion »

Okay, I've been messing around with this for the last couple hours and finally got everything to work pretty well. I have another question, though:

Now that I have all the multi-episode files named correctly for a given show, Plex lists each "episode" individually and with accurate titles. Of course, playing episode 2 or 3 of a three part file starts the file from the beginning. I was fully expecting that.

My question is, is there a way to have Plex give multi-episode files a single, combined listing, but the title of that listing include all the titles of all the episodes in that file? That is, instead of "Gone Fishin' (sort of)" and "Beans are from Mars" being part of the same file but having separate listings in Plex, have them share a single listing ("episode 1') but have it shown as "Gone Fishin' (sort of) & Beans are from Mars." Is that possible? From what I've seen before I started messing with Filebot, it would list episode 1 as "Gone Fishin' (sort of)" and list episode 2 (incorrectly) as "Beans are from Mars." I like the multi-episode files having a single entry but I don't like the inaccurate titling.
User avatar
rednoah
The Source
Posts: 22994
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Easier way to prep double episode file for Filebot?

Post by rednoah »

redangellion wrote: 24 Dec 2019, 07:21 My question is, is there a way to have Plex give multi-episode files a single, combined listing, but the title of that listing include all the titles of all the episodes in that file? That is, instead of "Gone Fishin' (sort of)" and "Beans are from Mars" being part of the same file but having separate listings in Plex, have them share a single listing ("episode 1') but have it shown as "Gone Fishin' (sort of) & Beans are from Mars." Is that possible? From what I've seen before I started messing with Filebot, it would list episode 1 as "Gone Fishin' (sort of)" and list episode 2 (incorrectly) as "Beans are from Mars." I like the multi-episode files having a single entry but I don't like the inaccurate titling.
That seems like a question for the Plex folks:
https://forums.plex.tv/

AFAIK, you're probably out of luck with this one. But you'll want to confirm with an actual Plex expert. ;)
:idea: Please read the FAQ and How to Request Help.
User avatar
rednoah
The Source
Posts: 22994
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Easier way to prep double episode file for Filebot?

Post by rednoah »

@kim So out of curiosity, I was playing with -list -rename --mapper --filter to see if I could make this work in a single step, and it's actually doable, thought definitely not pretty. :lol:

Code: Select all

$ filebot -rename -list -rename *.mkv -non-strict --db TheTVDB --q "Camp Lazlo" --action TEST --mapper "episodelist.dropWhile{ it != episode }.take(2) as net.filebot.web.MultiEpisode" --filter "e % 2 == 1"
Apply filter [e % 2 == 1] on [130] items
Include [Camp Lazlo - 1x01 - Gone Fishin' (sort of)]
Include [Camp Lazlo - 1x03 - Snake Eyes]
...
Apply mapper [episodelist.dropWhile{ it != episode }.take(2) as net.filebot.web.MultiEpisode] on [65] items
Map [Camp Lazlo - 1x01 - Gone Fishin' (sort of)] to [Camp Lazlo - 1x01 & 1x02 - Gone Fishin' & Beans are from Mars]
Map [Camp Lazlo - 1x03 - Snake Eyes] to [Camp Lazlo - 1x03 & 1x04 - Snake Eyes & Racing Slicks]
...
[TEST] from [Camp Lazlo - 1x01.mp4] to [Camp Lazlo - 1x01 & 1x02 - Gone Fishin' & Beans are from Mars.mp4]
[TEST] from [Camp Lazlo - 1x03.mp4] to [Camp Lazlo - 1x03 & 1x04 - Snake Eyes & Racing Slicks.mp4]
...


EDIT:

FileBot r7743 add improves support for reverse mapping, though it's certainly on the advanced side and will probably stay undocumented:

Code: Select all

filebot -rename \
	. \
	-non-strict \
	--db TheTVDB \
	--mapper "episode.map(episodelist.findAll{ airdate == it.airdate }).reverse()" \
	--action TEST \
	--log INFO

Code: Select all

[TEST] from [Daniel Tigers Neighborhood.2019-01-08T00.00.00Z.Daniels Obstacle Course; Daniel Plays in a Gentle Way.mp4] to [Daniel Tiger's Neighborhood - 4x11 & 4x12 - Daniel's Obstacle Course & Daniel Plays in a Gentle Way.mp4]
:idea: Please read the FAQ and How to Request Help.
Post Reply