Sorting by index (format: az) not yielding expected result

Any questions? Need some help?
Post Reply
xhAJHUYe6uc
Posts: 20
Joined: 15 Oct 2019, 08:17

Sorting by index (format: az) not yielding expected result

Post by xhAJHUYe6uc »

Hi!
I'm having some difficulty getting movies sorted by first letter index (format: az). I'm expecting "a, an, the" etc to be excluded, however, I'm getting results like this:

Code: Select all

U/Fallen Champ: The Untold Story of Mike Tyson (1993)
meaning, it is sorted as "U" (expecting F). I have a lot of results like this. The title is matching themoviedb title.

There are also occurrences of this type: "a sort of title" where it gets index by "T", rather than "S" (I made up this example, but they are of this kind).

Is this intended behaviour?
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Sorting by index (format: az) not yielding expected result

Post by rednoah »

The expected value for {az} would be F, and indeed, it is:

Code: Select all

$ filebot -rename *.mp4 --db TheMovieDB -non-strict --format "{az}/{ny}" --action TEST --log INFO
[TEST] from [Fallen.Champ.mp4] to [F/Fallen Champ The Untold Story of Mike Tyson (1993).mp4]

:?: What is your format / test case? How did you confirm the the value of {az} is indeed not F?
:idea: Please read the FAQ and How to Request Help.
xhAJHUYe6uc
Posts: 20
Joined: 15 Oct 2019, 08:17

Re: Sorting by index (format: az) not yielding expected result

Post by xhAJHUYe6uc »

Hmm, that is weird, how come I got different result. I am using strict mode, that might be the reason?
xhAJHUYe6uc
Posts: 20
Joined: 15 Oct 2019, 08:17

Re: Sorting by index (format: az) not yielding expected result

Post by xhAJHUYe6uc »

My format:

Code: Select all

 "Movies/{az}/{plex.tail}{' - '+tags} - {source} - {vf}" 
edit: Only way movies get into my movies folder is by filebot. I "confirmed" it by finding it in the wrong folder.
Last edited by xhAJHUYe6uc on 11 Jan 2020, 22:28, edited 1 time in total.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Sorting by index (format: az) not yielding expected result

Post by rednoah »

Please use real examples that really illustrated the issue. ;)

Otherwise, I can only tell you that it should work, and that it does work, for everything that I can think of:

Code: Select all

$ filebot -rename *.mp4 --db TheMovieDB -non-strict --format "{az}/{ny}" --action TEST --log INFO
[TEST] from [The.Jungle.Book.mp4] to [J/The Jungle Book (2016).mp4]

:idea: Using strict mode could not be the reason, as this is a format mystery, rather than a matching mystery.
:idea: Please read the FAQ and How to Request Help.
xhAJHUYe6uc
Posts: 20
Joined: 15 Oct 2019, 08:17

Re: Sorting by index (format: az) not yielding expected result

Post by xhAJHUYe6uc »

The first example is real result :)
Anyway, I am going through quite many entries now so I can see if I find more examples.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Sorting by index (format: az) not yielding expected result

Post by rednoah »

Here's what I'm getting using the example above:

Code: Select all

filebot -rename *.mp4 --db TheMovieDB -non-strict --format "Movies/{az}/{plex.tail}{' - '+tags} - {source} - {vf}" --action TEST --log INFO
[TEST] from [Fallen Champ The Untold Story of Mike Tyson (1993).mp4] to [Movies/F/Fallen Champ - The Untold Story of Mike Tyson (1993)/Fallen Champ - The Untold Story of Mike Tyson (1993) - -.mp4]
:idea: Without : because my OS doesn't allow : in file paths. This doesn't matter.
:idea: No media info because I'm testing with 0 byte files. This doesn't matter.
:idea: Please read the FAQ and How to Request Help.
xhAJHUYe6uc
Posts: 20
Joined: 15 Oct 2019, 08:17

Re: Sorting by index (format: az) not yielding expected result

Post by xhAJHUYe6uc »

Got to the bottom of it now. It's an error with release and repack, so both "the untold story" and "fallen champ - the untold..." got through the pipeline and therefore the naming was wrong on one of them. So I guess filebot did it correct yet again.

Sry for the false alarm!
xhAJHUYe6uc
Posts: 20
Joined: 15 Oct 2019, 08:17

Re: Sorting by index (format: az) not yielding expected result

Post by xhAJHUYe6uc »

For the other example I mentioned:

Code: Select all

[TEST] from [Rips/paul.blart.mall.cop.2009.bluray.1080p.mkv] to [Movies/M/Paul Blart - Mall Cop (2009)/Paul Blart - Mall Cop (2009) - BluRay - 1080p.mkv]
This might be a matter of interpretation. I would expect P? Anyway, nothing critical. If there is a way to get it to P, great, if not, no worries.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Sorting by index (format: az) not yielding expected result

Post by rednoah »

I see. This mystery I can explain. {az} is primarily based on {collection}, while {n} is used as a fallback in cases where there is no {collection}.

e.g.

Code: Select all

{az}/{collection}/{ny}

Code: Select all

M/Mall Cop Collection/Paul Blart: Mall Cop (2009)
M/Mall Cop Collection/Paul Blart: Mall Cop 2 (2015)
:idea: Please read the FAQ and How to Request Help.
xhAJHUYe6uc
Posts: 20
Joined: 15 Oct 2019, 08:17

Re: Sorting by index (format: az) not yielding expected result

Post by xhAJHUYe6uc »

I still have some weird occurrences such as:

The Robe (1953)

Code: Select all

filebot -rename *.mkv --db --TheMovieDB --format "{az}/{ny}" --action TEST --log INFO
[TEST] from [The.Robe.1953.BluRay.1080p.DTS-HD.MA.5.1.AVC.REMUX-GROUP.mkv] to [D/The Robe (1953).mkv]
The Night Stalker (1972)

Code: Select all

filebot -rename *.mkv --db --TheMovieDB --format "{az}/{ny}" --action TEST --log INFO
[TEST] from [The.Night.Stalker.1972.BluRay.1080p.DTS-HD.MA.2.0.AVC.REMUX-GROUP.mkv] to [K/The Night Stalker (1972).mkv]
The Jewel of the Nile (1985)

Code: Select all

filebot -rename *.mkv --db --TheMovieDB --format "{az}/{ny}" --action TEST --log INFO
[TEST] from [The.Jewel.of.the.Nile.1985.BluRay.1080p.DTS-HD.MA.5.1.AVC.REMUX-GROUP.mkv] to [R/The Jewel of the Nile (1985).mkv]
Tazza: The Hidden Card (2014)

Code: Select all

filebot -rename *.mkv --db --TheMovieDB --format "{az}/{ny}" --action TEST --log INFO
[TEST] from [Tazza.The.Hidden.Card.2014.BluRay.1080p.DTS-HD.MA.5.1.AVC.REMUX-GROUP.mkv] to [W/Tazza The Hidden Card (2014).mkv]
..?
rednoah wrote: This mystery I can explain. {az} is primarily based on {collection}, while {n} is used as a fallback in cases where there is no {collection}.
Seems so. For example, "A Good Day to Die Hard" gets mapped to D.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Sorting by index (format: az) not yielding expected result

Post by rednoah »

What does {collection} say for each of those movies?
:idea: Please read the FAQ and How to Request Help.
xhAJHUYe6uc
Posts: 20
Joined: 15 Oct 2019, 08:17

Re: Sorting by index (format: az) not yielding expected result

Post by xhAJHUYe6uc »

Code: Select all

[TEST] from [Tazza.The.Hidden.Card.2014.BluRay.1080p.DTS-HD.MA.5.1.AVC.REMUX-FraMeSToR.mkv] to [The War of Flower Collection/Tazza The Hidden Card (2014).mkv]
[TEST] from [The.Jewel.of.the.Nile.1985.BluRay.1080p.DTS-HD.MA.5.1.AVC.REMUX-GROUP.mkv] to [Romancing the Stone Collection/The Jewel of the Nile (1985).mkv]
[TEST] from [The.Night.Stalker.1972.BluRay.1080p.DTS-HD.MA.2.0.AVC.REMUX-GROUP.mkv] to [The Kolchak Collection/The Night Stalker (1972).mkv]
[TEST] from [The.Robe.1953.BluRay.1080p.DTS-HD.MA.5.1.AVC.REMUX-GROUP.mkv] to [Demetrius Collection/The Robe (1953).mkv]
So its indeed from collection, however, I would argue that {az} should not use collection at all (use "a, an, the" etc as escape), and maybe keep current format as {caz} or something.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Sorting by index (format: az) not yielding expected result

Post by rednoah »

Well, I'd argue that people generally like all their Die Hard, Terminator, Avatar, etc movies to end up in the same section. I guess the "old movies belong to strange collections" issue is an odd but acceptable side-effect.

That being said, you can do whatever you want, e.g. just pick the first character from {n} yourself:

Code: Select all

{n[0]}
sortName() will give us the bit after the The and A, so you're likely going to be happy with this:

Code: Select all

{n.sortName()[0]}
:idea: Please read the FAQ and How to Request Help.
xhAJHUYe6uc
Posts: 20
Joined: 15 Oct 2019, 08:17

Re: Sorting by index (format: az) not yielding expected result

Post by xhAJHUYe6uc »

True, its a trade off. Could be a tiny note on the format page about it to avoid the odd surprise :)

Code: Select all

{n.sortName()[0]}
Many thanks!
Post Reply