Rename episodes with overall episode number

Any questions? Need some help?
Post Reply
johnoliver
Posts: 3
Joined: 13 Feb 2017, 19:07

Rename episodes with overall episode number

Post by johnoliver »

I recently downloaded ten seasons of a series, the episodes were numbered according to their overall number in the series and not by season #/ episode #. The folder looks like this:

Code: Select all

001 - AD - Pilot.mp4
002 - AD - Threat Levels.mp4
003 - AD - Stan Knows Best.mp4
004 - AD - Francine's Flashback.mp4
005 - AD - Roger Codger.mp4
006 - AD - Homeland Insecurity.mp4
007 - AD - Deacon Stan, Jesus Man.mp4
008 - AD - Bollocks to Stan.mp4
009 - AD - A Smith in the Hand.mp4
010 - AD - All About Steve.mp4
011 - AD - Con Heir.mp4
012 - AD - Stan of Arabia, Part 1.mp4
013 - AD - Stan of Arabia, Part 2.mp4
014 - AD - Stannie Get Your Gun.mp4
015 - AD - Star Trek.mp4
016 - AD - Not Particularly Desperate Housewife.mp4
017 - AD - Rough Trade.mp4
018 - AD - Finances with Wolves.mp4
019 - AD - It's Good to Be Queen.mp4
020 - AD - Roger and Me.mp4
...
I use filebot to rename my media but I can't figure out how to get Filebot to get it right. How do I make filebot rename based on overall episode number instead of episode # / season # ?
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Rename episodes with overall episode number

Post by rednoah »

If the order of files matches the order of episodes, then you don't even need FileBot to do any fancy matching since files and episodes will align naturally.

Option 1: "Episodes First" instead of "Files First"

1. Start FileBot
2. Fetch Data ➔ Select TheTVDB ➔ Enter Series Name
3. Drop files into Original Files area


Option 2: Use Episode panel and send episode data to Rename panel

Image
@see https://www.youtube.com/watch?v=btNSv7AnMMw
:idea: Please read the FAQ and How to Request Help.
johnoliver
Posts: 3
Joined: 13 Feb 2017, 19:07

Re: Rename episodes with overall episode number

Post by johnoliver »

Thanks for that. I guess I should've mentioned that I'm using linux. Output of filebot -script fn:sysinfo

Code: Select all

FileBot 4.7.7 (r4678)
JNA Native: 4.0.1
MediaInfo: 0.7.88
7-Zip-JBinding: 9.20
Chromaprint: 1.1.0
Extended Attributes: OK
Unicode Filesystem: OK
Script Bundle: 2017-02-10 (r480)
Groovy: 2.4.7
JRE: Java(TM) SE Runtime Environment 1.8.0_121
JVM: 64-bit Java HotSpot(TM) 64-Bit Server VM
CPU/MEM: 8 Core / 6 GB Max Memory / 21 MB Used Memory
OS: Linux (amd64)
Package: DEB
Data: /home/johnoliver/.filebot
uname: Linux Ubuntu-1604-xenial-64-minimal 4.4.0-62-generic #83-Ubuntu SMP Wed Jan 18 14:10:15 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
Done ヾ(@⌒ー⌒@)ノ
This is the command I'm using, it's not giving me the correct episode numbers:

Code: Select all

filebot -script fn:amc --def seriesFormat="{n}/Season {s.pad(2)}/{n} - {s00e00} - {t}" --output "/MY/TV/FOLDER" --action copy --db "TheTVDB" -non-strict . --q "American Dad"
There are 181 episodes in the folder and it doesn't recognise or rename any of them properly.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Rename episodes with overall episode number

Post by rednoah »

1.
What show are we dealing with? Please include the TheTVDB link.


2.
Have absolute episode numbers been entered on TheTVDB? Matching Absolute to SxE may not be possible if Absolute episode numbers have not been entered yet.


3.
Console output is ALWAYS helpful.


4.
This thread might give you some ideas: viewtopic.php?f=3&t=2769


5.
--db "TheTVDB" --q "American Dad" are -rename options that are thoroughly ignored if you're using the amc script.
: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:

Re: Rename episodes with overall episode number

Post by rednoah »

So "AD" refers to "American Dad" then? I can't know that kinda shit. :lol:

1.
Check TheTVDB: http://thetvdb.com/?tab=seasonall&id=73141&lid=7

e.g.

Code: Select all

filebot -list --q "American Dad" --format "{absolute} => {episode}" --filter "absolute"

Code: Select all

1 => American Dad! - 1x01 - Pilot
2 => American Dad! - 1x02 - Threat Levels
97 => American Dad! - 7x01 - 100 A.D. (1)
98 => American Dad! - 7x02 - Son of Stan (2)
99 => American Dad! - 7x03 - Best Little Horror House in Langley Falls
100 => American Dad! - 7x04 - Stan's Food Restaurant
101 => American Dad! - 7x05 - White Rice
:idea: The first ~100 episodes are missing the absolute episode number field.
:idea: It's now your job to enter the missing information.


2.
Since you have the episode names, you could use those.

e.g.

Code: Select all

$ ls
001 - AD - Pilot.mp4			100 - AD - Stan's Food Restaurant.mp4
020 - AD - Roger and Me.mp4
Strip misleading information:

Code: Select all

$ filebot -rename --db xattr -non-strict . --format "{fn.after(/ - AD - /)}"
Rename files using [Extended Attributes]
[MOVE] Rename [001 - AD - Pilot.mp4] to [Pilot.mp4]
[MOVE] Rename [020 - AD - Roger and Me.mp4] to [Roger and Me.mp4]
[MOVE] Rename [100 - AD - Stan's Food Restaurant.mp4] to [Stan's Food Restaurant.mp4]
Try again, now with episode title being the only identifying information left in the filename:

Code: Select all

$ filebot -rename . --db TheTVDB -non-strict --q "American Dad" --filter "n =~ /American.Dad/"
[MOVE] Rename [Pilot.mp4] to [American Dad! - 1x01 - Pilot.mp4]
[MOVE] Rename [Roger and Me.mp4] to [American Dad! - 2x13 - Roger 'n Me.mp4]
[MOVE] Rename [Stan's Food Restaurant.mp4] to [American Dad! - 7x04 - Stan's Food Restaurant.mp4]
:idea: You probably wanna use --action TEST beforehand for every call.
: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:

Re: Rename episodes with overall episode number

Post by rednoah »

Code: Select all

filebot -list --q "American Dad" --format "{plex.name}.mp4" | for FILE in *.mp4; do read LINE; mv -v "$FILE" "$LINE"; done

Code: Select all

01.mp4 -> American Dad! - S01E01 - Pilot.mp4
02.mp4 -> American Dad! - S01E02 - Threat Levels.mp4
...
@see http://unix.stackexchange.com/questions ... -text-file
:idea: Please read the FAQ and How to Request Help.
johnoliver
Posts: 3
Joined: 13 Feb 2017, 19:07

Re: Rename episodes with overall episode number

Post by johnoliver »

This worked. Thanks! You're a legend!
Post Reply