Page 1 of 1

Need help sorting Doctor Who classic into correct episode numbers

Posted: 10 Apr 2019, 21:42
by digitalirony
So I have all of my Doctor Who files, which have a naming convention like this:
Doctor Who - S01E01 (001) - An Unearthly Child - Parts 1-4:

Code: Select all

  -Doctor Who - S01E01 (001) - An Unearthly Child (1) - An Unearthly Child.avi
  -Doctor Who - S01E01 (001) - An Unearthly Child (2) - The Cave of Skulls.avi
  -Doctor Who - S01E01 (001) - An Unearthly Child (3) - The Forest of Fear.avi
  -Doctor Who - S01E01 (001) - An Unearthly Child (4) - The Firemaker.avi
As you can see all of the files are S01E01. When Doctor Who Classic was released, I guess they thought of each sub story 'arc' as an episode, which was made up of parts.
However on the DB's like TVDB, these are actually labeled like this:

Code: Select all

  -Doctor Who - S01E01 (001) - An Unearthly Child (1) - An Unearthly Child.avi
  -Doctor Who - S01E02 (001) - An Unearthly Child (2) - The Cave of Skulls.avi
  -Doctor Who - S01E03 (001) - An Unearthly Child (3) - The Forest of Fear.avi
  -Doctor Who - S01E04 (001) - An Unearthly Child (4) - The Firemaker.avi
The obvious thing to do, is just change SXXEXX to match. But I am not sure a good way to do this. Everything I try always ends up overwriting S01E01 four times, as filebot thinks all of these are E01(rightly so).

I have 26 seasons like this, with hundreds of episodes, so I realllly don't want to do this manually.

Re: Need help sorting Doctor Who classic into correct episode numbers

Posted: 11 Apr 2019, 05:31
by rednoah
I suppose the file order aligns with the episode order just fine. You can just do manual matching. It'll be minimal effort if files and episodes align right away.

See Getting Started, Page 2:
https://www.filebot.net/getting-started/

Re: Need help sorting Doctor Who classic into correct episode numbers

Posted: 11 Apr 2019, 17:39
by digitalirony
Is there a way to do this via cli? This is a remote machine and I don't have the UI to use.

Re: Need help sorting Doctor Who classic into correct episode numbers

Posted: 11 Apr 2019, 20:21
by kim
If you remove the

Code: Select all

S01E01 (001)
part of the files I think it will work like normal rename/match if files have the episode names

do all the files have the (1)...(4) ?
then you can use this

Code: Select all

{n}
{def newE = fn.match(/(?:\w.+.-.+.-.+\()(\d{1,2})(?:\).-.+.+)/); 
def newTitle = fn.match(/(?:\w.+.-.+.-.+\()(?:\d{1,2})(?:\).-.)(.+)/); 
' - '+'S'+s.pad(2)+'E'+newE.pad(2)+' - '+newTitle}
and then rename/match like normal

same in offline "F2 mode" mode

Code: Select all

{fn.before(/\s-\s/)}
{def newS = fn.match(/(?:\w.+.-.+S)(\d\d)(?:E.+)/); 
def newE = fn.match(/\w.+.-.+.-.+\((\d{1,2})\).-.+.+/); 
def newTitle = fn.match(/(?:\w.+.-.+.-.+\()(?:\d{1,2})(?:\).-.)(.+)/); 
' - '+'S'+newS+'E'+newE.pad(2)+' - '+newTitle}
or
maybe you can use

Code: Select all

{model.sxe}
or

Code: Select all

{model.s00e00}
to compare with
if more then 1 with the same "episode id" then replace the

Code: Select all

{model.e}
with "(1)...(4)" part
BUT what about the title part ?

Re: Need help sorting Doctor Who classic into correct episode numbers

Posted: 11 Apr 2019, 21:34
by digitalirony
I am not sure what to do with the expressions you supplied. Is this something I can pass into a --filter, or this for the UI still?
Yes, all of the files have the (1)..(4), but some 'episodes' are longer or shorter(some have 7 parts, some have 3). Will that matter?

Re: Need help sorting Doctor Who classic into correct episode numbers

Posted: 12 Apr 2019, 01:17
by kim
if the e.g. "(1)" is not equal to the episode e.g. s01e01 or e.g. (4) = s01e04 then this will not work

FileBot CLI Command-line interface usage manual

Code: Select all

https://www.filebot.net/cli.html
e.g.

Code: Select all

filebot -rename "Generation Kill" -non-strict --format "{n}{def newE = fn.match(/(?:\w.+.-.+.-.+\()(\d{1,2})(?:\).-.+.+)/); def newTitle = fn.match(/(?:\w.+.-.+.-.+\()(?:\d{1,2})(?:\).-.)(.+)/); ' - '+'S'+s.pad(2)+'E'+newE.pad(2)+' - '+newTitle}"
(most be a on 1 line)

if not equal numbers, then remove "S01E01 (001)" part is the best?

Re: Need help sorting Doctor Who classic into correct episode numbers

Posted: 12 Apr 2019, 08:47
by rednoah
Yes, -list -rename will do just that, rename files in order of episode listing.