Page 1 of 1

Double-Episode Support

Posted: 17 Mar 2012, 01:36
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. ;)

Re: Double-Episode Support

Posted: 17 Mar 2012, 02:54
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!!!

Re: Double-Episode Support

Posted: 17 Mar 2012, 19:22
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.

Re: Double-Episode Support

Posted: 05 Apr 2012, 14:48
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.

Re: Double-Episode Support

Posted: 16 Jan 2013, 16:07
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

Re: Double-Episode Support

Posted: 16 Jan 2013, 16:40
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.

Re: Double-Episode Support

Posted: 16 Jan 2013, 16:46
by theimmortal
Okay, this may be a stupid question, but how do I update to r1407 on Ubuntu?

Re: Double-Episode Support

Posted: 16 Jan 2013, 16:48
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.

Re: Double-Episode Support

Posted: 16 Jan 2013, 17:52
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?

Re: Double-Episode Support

Posted: 16 Jan 2013, 18:13
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

Re: Double-Episode Support

Posted: 16 Jan 2013, 18:59
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.

Re: Double-Episode Support

Posted: 16 Jan 2013, 22:47
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.

Re: Double-Episode Support

Posted: 05 Mar 2015, 22:11
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

Re: Double-Episode Support

Posted: 06 Mar 2015, 07:04
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.

Re: Double-Episode Support

Posted: 08 Dec 2015, 18:06
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.

Re: Double-Episode Support

Posted: 08 Dec 2015, 18:21
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

Re: Double-Episode Support

Posted: 08 Dec 2015, 18:51
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.

Re: Double-Episode Support

Posted: 08 Dec 2015, 18:57
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.

Re: Double-Episode Support

Posted: 08 Dec 2015, 19:06
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.

Re: Double-Episode Support

Posted: 08 Dec 2015, 19:14
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.

Re: Double-Episode Support

Posted: 29 Apr 2016, 14:10
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?

Re: Double-Episode Support

Posted: 06 Jun 2017, 21:36
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

Re: Double-Episode Support

Posted: 07 Jun 2017, 05:46
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.

Match Multi-Episodes by Episode Title

Posted: 28 Jul 2017, 04:46
by rednoah
Format Hacks: Match Multi-Episodes by Episode Title:
viewtopic.php?f=5&t=5240