MultiCD naming: {pi} VS {fn.match(/CD\d/)}

All about user-defined episode / movie / file name format expressions
Post Reply
User avatar
rednoah
The Source
Posts: 22899
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

MultiCD naming: {pi} VS {fn.match(/CD\d/)}

Post by rednoah »

1. {pi} binding
FileBot recognizes multi-part movies by matching multiple files to the same movie. Hence if you want to rename multi-part movies you need to pass all files into the same input set. The assumption here is only that parts are in alphabetical order.

2. Parse CD<i> from filename via fn.match()
If your files happen to be already well-named with CD123 then you can easily grab the CDindex from the filename via fn.match() like so:

e.g.

Format: Select all

{ fn.match(/CD\d+/).upper() }
:idea: Please read the FAQ and How to Request Help.
User avatar
Mute
Power User
Posts: 11
Joined: 19 Feb 2014, 17:13

Re: MultiCD naming: {pi} VS {fn.match(/CD\d/)}

Post by Mute »

What if my multi-CD music files are sorted as follows:

Artist\Album\CD01\Track-name.ext
Artist\Album\CD02\Track-name.ext

Is there are way to rename and keep the CD number in the directory structure?
User avatar
rednoah
The Source
Posts: 22899
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: MultiCD naming: {pi} VS {fn.match(/CD\d/)}

Post by rednoah »

Then you just scan the whole path for CD00 patterns ;)

Code: Select all

{file.path.match(/CD\d+/).upper()}
:idea: Please read the FAQ and How to Request Help.
AbedlaPaille
Posts: 107
Joined: 12 Apr 2020, 04:02

Re: MultiCD naming: {pi} VS {fn.match(/CD\d/)}

Post by AbedlaPaille »

What reasons could there be for the {pi} binding to not catch a few of my multi-part movies that are named the same, processed in the same input and matched to the same movie by theMovieDB? It doesn't display CD123, but the binding otherwise works on about half my multi part movies, bit weird. The half it doesn't work on still gets caught by $di too. I'm thinking hard but i don't see what's wrong here.

Edit:

As it turns out of the 6 movies in question 3 were legit duplicates and not parts of a multi part, so props on you software recognition for being smarter than me lol.

I still have Gone with the Wind, Godfather Part II and La sociologie est un sport de combat not recognized as CD parts, despite genuinely being ones.

Gone with the wind and godfather have the two parts at exactly the same filesize, might be the issue? Different lengths though. But La sociologie est un sport de combat as neither the same length nor the same filesize so i'm lost.

By just manually renaming those 3 CDs and using a fn Match i'll go around my issue, but i'm still curious if you have any leads on what might be going on.
User avatar
rednoah
The Source
Posts: 22899
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: MultiCD naming: {pi} VS {fn.match(/CD\d/)}

Post by rednoah »

1.
AbedlaPaille wrote: 07 May 2020, 14:50 What reasons could there be for the {pi} binding to not catch a few of my multi-part movies
There are countless possible reasons. If you provide file paths as text so I can run a few tests and see what the cause might be in your particular case.


:idea: Please read How to Request Help.


2.
AbedlaPaille wrote: 07 May 2020, 14:50 As it turns out of the 6 movies in question 3 were legit duplicates and not parts of a multi part, so props on you software recognition for being smarter than me lol.
When I debug these things, I sometimes come to the same conclusion. :lol:


3.
AbedlaPaille wrote: 07 May 2020, 14:50 Gone with the wind and godfather have the two parts at exactly the same filesize, might be the issue? Different lengths though. But La sociologie est un sport de combat as neither the same length nor the same filesize so i'm lost.
The media characteristics can make a difference. The file size doesn't matter, but multi-part movie files ideally all have the same video codec, audio codec, same resolution, comparable duration, etc.

If it's indeed related to media characteristics, then the MediaInfo Inspector might be able to shed light on this phenomenon:
viewtopic.php?t=4285
:idea: Please read the FAQ and How to Request Help.
AbedlaPaille
Posts: 107
Joined: 12 Apr 2020, 04:02

Re: MultiCD naming: {pi} VS {fn.match(/CD\d/)}

Post by AbedlaPaille »

Code: Select all

The file size doesn't matter, but multi-part movie files ideally all have the same video codec, audio codec, same resolution, comparable duration, etc.
That was it in every occurence. Multi part movies that had some of those differing. Had to go manual on them.
User avatar
rednoah
The Source
Posts: 22899
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: MultiCD naming: {pi} VS {fn.match(/CD\d/)}

Post by rednoah »

Can you provide MediaInfo dumps for a set of multi-part movie files?

Code: Select all

filebot -script fn:mediainfo *.mkv
:idea: Please read the FAQ and How to Request Help.
AbedlaPaille
Posts: 107
Joined: 12 Apr 2020, 04:02

Re: MultiCD naming: {pi} VS {fn.match(/CD\d/)}

Post by AbedlaPaille »

Gone with the Wind (1939) : https://pastebin.com/ZQWcFrwy

The Godfather - Part II (1974) : https://pastebin.com/KvR1u6PX

La sociologie est un sport de combat (2001) : https://pastebin.com/LV5bGk02
User avatar
rednoah
The Source
Posts: 22899
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: MultiCD naming: {pi} VS {fn.match(/CD\d/)}

Post by rednoah »

Yep, that'll do it, that won't be considered multi-part because if you take a single video, and split it into two files, then you can't have different video resolutions for each part:

Code: Select all

FileName                   : Gone with the Wind (1939) CD1 [360p XviD 0.9 Mbps]
Width                         : 480

Code: Select all

FileName                   : Gone with the Wind (1939) CD2 [240p XviD 0.8 Mbps]
Width                         : 448
My first guess would be that this CD1 and this CD2 don't actually belong to the same set, each missing their either part respectively. There's probably an interesting story to that kind of discrepancy, one that we'll never know. :lol:
:idea: Please read the FAQ and How to Request Help.
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

Re: MultiCD naming: {pi} VS {fn.match(/CD\d/)}

Post by kim »

Yes we will... here is a hint ;)

Code: Select all

FileSize                   : 733769728
FileSize/String            : 700 MiB
User avatar
rednoah
The Source
Posts: 22899
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: MultiCD naming: {pi} VS {fn.match(/CD\d/)}

Post by rednoah »

So I guess the original video already came in two files, and then the encoder chose different resolution settings to get the target file size for each one? Instead of adjusting quality settings? Most unusual. I think I'm ok with not supporting Frankenstein multi-part movies. :lol:
:idea: Please read the FAQ and How to Request Help.
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

Re: MultiCD naming: {pi} VS {fn.match(/CD\d/)}

Post by kim »

I'm not an encoder expert, so I don't know why they did it like this, but many did it
when CD's was king, avi files (xvid) at 700MB was the #1 rule (at least the cd1)
AbedlaPaille
Posts: 107
Joined: 12 Apr 2020, 04:02

Re: MultiCD naming: {pi} VS {fn.match(/CD\d/)}

Post by AbedlaPaille »

Yep i'm baffled as well. Completely understand why you wouldn't want to support these shitty encodes with pi.
Post Reply