Double-Episode Support

All your suggestions, requests and ideas for future development
Post Reply
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Double-Episode Support

Post by rednoah »

I'm finally coming around to see how we can handle multi-episode files. Since I have none I need people to post me filenames that I can use as template when implementing this.

Like what patterns are there? I'll focus multi-eps detection on SxExE patterns.

Code: Select all

S01E01 & E02
S01E01-02
1x01-02
...
Apparently in some cases a double episode is defined by two titles, not sure if I can support this:

Code: Select all

Adventure Time 1x01 Slumber Party Panic - Trouble in Lumpy Space
Just send me lots of filenames that I can test with and stay tuned. ;)
:idea: Please read the FAQ and How to Request Help.
smichalik
Posts: 1
Joined: 17 Mar 2012, 02:27

Re: Double-Episode Support

Post by smichalik »

rednoah,

Here is a link to Plex where it discusses its method for "Multiple Episodes in One File": http://wiki.plexapp.com/index.php/PlexN ... ming_Guide (scroll down to "Multiple Episodes in One File")

Here would be some two part examples:

Adventure Time.s01e01-02.*
Adventure Time_[s01]_[e01-02]_.*
Adventure Time.1x01.1x02.*

It could also be taken a step further for 3 or 4 part episodes such as this:

Adventure Time.s01e01-02-03-04.*
Adventure Time_[s01]_[e01-02-03-04]_*
Adventure Time.1x01.1x02.1x03.1x04.*

I grabbed these examples from this page: http://wiki.xbmc.org/?title=TV_Shows_(Video_Library

Here is a list of some series that may implement multiple episodes in one file:

Doug
SpongeBob
Rocko's Modern Life
Angry Beavers
Hey Arnold!
Rugrats
Aaahh!!! Real Monsters
Ren and Stimpy
Invader Zim
Regular Show
Dexter's Lab

If I think of any more then I will be sure to post them

If there is any testing or help I can offer I would be more than happy to do so.

Thank you very much!!!
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Double-Episode Support

Post by rednoah »

Added some initial support for this. The latest revision from here:
http://sourceforge.net/projects/filebot ... ebot/HEAD/

Should work for common multi-episode patterns but might break other aspect of episode/file matching that were previously working.
:idea: Please read the FAQ and How to Request Help.
knowncolor
Posts: 4
Joined: 04 Apr 2012, 20:21

Re: Double-Episode Support

Post by knowncolor »

rednoah wrote:Should work for common multi-episode patterns but might break other aspect of episode/file matching that were previously working.
Sounds like a good opportunity for some unit tests.
theimmortal
Posts: 14
Joined: 13 Jan 2013, 16:57

Re: Double-Episode Support

Post by theimmortal »

I am having difficulty getting this to work with the utorrent script. Is there something extra I have to do to get it to detect double-episodes?

Here is an example:

Original file: Warehouse 13 S03E11-E12 720p HDTV x264-IMMERSE.mkv
Filebot Output: Warehouse 13 - S03E11 - Emily Lake.mkv
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Double-Episode Support

Post by rednoah »

Looks like this S01E01-E02 pattern doesn't get matched. Had a look and updated the regex a little bit. Fixed with r1407.
:idea: Please read the FAQ and How to Request Help.
theimmortal
Posts: 14
Joined: 13 Jan 2013, 16:57

Re: Double-Episode Support

Post by theimmortal »

Okay, this may be a stupid question, but how do I update to r1407 on Ubuntu?
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Double-Episode Support

Post by rednoah »

Download the latest core jar from here:
https://sourceforge.net/projects/filebo ... ebot/HEAD/

Replace the filebot.jar in the current install folder.
:idea: Please read the FAQ and How to Request Help.
theimmortal
Posts: 14
Joined: 13 Jan 2013, 16:57

Re: Double-Episode Support

Post by theimmortal »

Got it! Now it detects the double episode. One more quick question. How do I modify the format so the output is S00E00-E00 instead of S00E00E00?
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Double-Episode Support

Post by rednoah »

This format will work:

Code: Select all

{n} - S{s.pad(2)}E{es*.pad(2).join('-E')} - {t}
{es} ... list of episode numbers
:idea: Please read the FAQ and How to Request Help.
theimmortal
Posts: 14
Joined: 13 Jan 2013, 16:57

Re: Double-Episode Support

Post by theimmortal »

How do I incorporate that into my current renaming system?

'''{n}/{episode.special ? "Special" : "Season "+s}/{n} - {episode.special ? "S00E"+special.pad(2) : s00e00} - {t}'''

I have tried a couple different ways but keep coming up with errors.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Double-Episode Support

Post by rednoah »

If you look into how Groovy code works you'll figure it out. I'll change {s00e00} to this style for next release. Looks better with dash.
:idea: Please read the FAQ and How to Request Help.
whereswaller
Posts: 23
Joined: 05 Mar 2015, 21:59

Re: Double-Episode Support

Post by whereswaller »

Hi,
The support multiple episode support is only working for some filename types for me.

A significant portion of older media in my library is named in the following format:
Show Name - Season ## - Episode ##-## (for example, Survivor - Season 01 - Episode 01-02)
Whilst newer media in my library is named in the following format:
Show Name ##x##-## (for example, Survivor 01x01-02)
I'm using the following code, which recognises multi-episode files for only my newer library content and not my older library content:

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')}
Example intput - older media: Lost - Season 06 - Episode 01-02
Example output - older media: Lost 06x01 - LA X, Part 1
Example input - newer media: Lost 06x01-02
Example output - newer media: Lost 06x01-02 - LA X

Can you help fix the code so that the older media in my library is converted to the same format as the newer media in my library?

Many thanks,
James
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Double-Episode Support

Post by rednoah »

Double-Episode support is only working for multi-episode naming that follows the standard. Naming like Lost - Season 06 - Episode 01-02 won't work.

You'll have to pre-process the files first to fix the naming before you can process them through FileBot normally.

Though FileBot can help with that: viewtopic.php?f=3&t=2072

Just transform "Season 06 - Episode 01-02" patterns into "S06E01-02" patterns via the generic renaming feature first before processing the files normally.
:idea: Please read the FAQ and How to Request Help.
Slashin8r
Posts: 3
Joined: 08 Dec 2015, 17:46

Re: Double-Episode Support

Post by Slashin8r »

Is it possible to add a new preference option for allowing an easy conversion from multi-episode files named as single episodes to the correct multi-episode name?

The preference option would need to determine how many episodes are in each file, so by default it would be set to 1. For double episodes, set the preference to 2 episodes per file and then filebot should multiply the file's episode number by 2 and include 1 (preference setting minus 1) previous episode, then match. A show of all triple episodes. Set preference to 3. S01E04 would be multiplied by 3 and include the previous 2 = S01E10-E11-E12.

This option would only work for groups of files in which all the files contain the same number of episodes and are named in sequence, but that covers the majority of multi-episode files.

I currently use S{s.pad(2)}E{(e*2-1).pad(2)}-E{(e*2).pad(2)} to rename double files and then need to set it back to my normal format to match. This preference would alleviate the double renaming process.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Double-Episode Support

Post by rednoah »

1.
Use "Batch Rename any type of files" feature:

Code: Select all

{fn.replaceAll(/S(\d+)E(\d+)/, {def m=3; def e=it[2] as int; it[1]+'x'+(e*m-m+1..e*m).join('-')})}
e.g. S01E04 => 01x10-11-12

@see viewtopic.php?f=3&t=2072


2.
You can set up a Generic File Presets if you need this kinda stuff more often.

@see viewtopic.php?f=3&t=3228
:idea: Please read the FAQ and How to Request Help.
Slashin8r
Posts: 3
Joined: 08 Dec 2015, 17:46

Re: Double-Episode Support

Post by Slashin8r »

I'm not having problems with any particular file, but cartoons/anime in general. The renaming format works perfectly once the files are set for multi-episode renaming.

I don't think I am able to use the list/presets for this since there isn't any particular filter I could run to guarantee it will only rename multi-episode files. Not sure how I could tell the difference between a single-episode file and a double-episode file of similar length and size.


Right now my process is as stands:

1. Rename with Format: {(primaryTitle ?: n).replace(': ', ' - ').replace(':', ';').replaceAll(/[?]/, '')} - S{s.pad(2)}E{(e*2-1).pad(2)}-E{(e*2).pad(2)}

2. Match with Format: {(primaryTitle ?: n).replace(': ', ' - ').replace(':', ';').replaceAll(/[?]/, '')}/{episode.special ? 'Specials' : 'Season '+s.pad(2)}/{(primaryTitle ?: n).replace(': ', ' - ').replace(':', ';').replaceAll(/[?]/, '')} - {s00e00} - {t.replace(': ', ' - ').replace(':', ';').replaceAll(/[?]/, '')}

I'm ok with my current process, just thought it would be nice to do the same thing in 1 step instead of 2.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Double-Episode Support

Post by rednoah »

If the numbers don't make sense yet, it's not a good idea to match them against a specific database. Instead you should use file-based renaming first to fix the names. I've updated my previous post to show you how that might look like.
:idea: Please read the FAQ and How to Request Help.
Slashin8r
Posts: 3
Joined: 08 Dec 2015, 17:46

Re: Double-Episode Support

Post by Slashin8r »

Sounds good. I like your format way better than mine as it works for all numbers of episodes in a file with the simple change of m variable. I will use this instead of mine.

Thanks for your quick responses.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Double-Episode Support

Post by rednoah »

If you have this issue a lot, then you can make Presets like "Fix Multi-Episodes (M=2)" and "Fix Multi-Episodes (M=3)" and apply it with a single click whenever needed.
:idea: Please read the FAQ and How to Request Help.
Brooklyn11218
Posts: 12
Joined: 23 Jun 2015, 05:09

Re: Double-Episode Support

Post by Brooklyn11218 »

I'm having some issues with double episodes passed 100. I've been renaming a cartoon series and it's been going fine until I reach 3 digits for the episode number. At that point it only returns the first episode. For example if the file were S01E99-E100 it would only return the info for E99. I've tried the & and 1x formats too with no luck. Any ideas?
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

Re: Double-Episode Support

Post by kim »

cant get season span multi episode to work e.g. (no support ?)

Star.Trek.The.Next.Generation.S03E26-S04E01.The.Best.of.Both.Worlds.(Part.1.and.2)
Star.Trek.The.Next.Generation.3x26-4x01
= Star.Trek.The.Next.Generation.3x26

http://www.thetvdb.com/?tab=episode&ser ... 6581&lid=7
http://www.thetvdb.com/?tab=episode&ser ... 6582&lid=7
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Double-Episode Support

Post by rednoah »

FileBot does not support cross-season multi-episode auto-detection, so you won't be able to process this particular file the way you want.
:idea: Please read the FAQ and How to Request Help.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Match Multi-Episodes by Episode Title

Post by rednoah »

Format Hacks: Match Multi-Episodes by Episode Title:
viewtopic.php?f=5&t=5240
:idea: Please read the FAQ and How to Request Help.
Post Reply