[mythtv-users] MythVideo: file name sorting oddity

Brion Swanson brions at usalug.net
Thu Dec 13 11:43:23 UTC 2007

On 12/12/07, Anduin Withers <awithers at anduin.com> wrote:
> This may be a good argument for comparing filenames, when sorting, without
> their extensions. This issue is similar to the brokenness of title
> compares
> in -fixes where what is being compared may not be obvious (in the titles
> case not only is it not obvious but it can be wrong).

Unfortunately, I think the case for sorting by the metadata is stronger
because I know in my case when I do IMDB lookups, the file names are not
necessarily reflective of the full / accurate title.  An example would be a
file called "GITS_:_SAC_Vol_01_Ep_1.avi" but the metadata title is "Ghost in
the Shell: Stand Alone Complex Vol 01 Ep 1" and I would hope / expect the
title to be sorted by metadata, not file name.

The real problem here for me is the sort order.  I do however understand the
problematic nature of the sorting implementation and the difficulty in
finding a single approach that works in all locales and situations.  (I have
read the thread about Myth removing brackets and their contents in filenames
to generate titles.)

Sorting sucks. As for it making sense, sort T. S. Elliot and Trotsky. Did
> you compare r to . or S? The example is contrived but if you look at the
> confused sorting you currently see and pretend you skip the . before the
> extension it makes sense.

Is this a problem that we can push out to the user at all?  I mean, Myth can
take a stab at it's best guess for sorting, but then add to Myth the
configurable option to sort based on different criteria.  In other words,
Myth's default is to sort based on title metadata in the natural ordering
provided by the local or database or whatever.  But if the user chooses,
they can indicate to Myth to sort by file name (case [in]sensitive and / or
matching a pattern for unconsidered characters), or perhaps they wish to
sort by some other metadata criteria (such as genre) and within the genre
they files are sorted as Myth's default (maybe more options are added for
n-level sorts, but probably not).  Thoughts?

> [test in another e-mail where collation and ls don't work]
> I don't Ubuntu, but ls should be honoring your locale setting (ls
> --sort=none should confirm it normally sorts).

I ran this command and did verify that ls does sorting - the locale
environment variable simply had no effect on the order.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mythtv.org/pipermail/mythtv-users/attachments/20071213/7901c896/attachment.htm 

More information about the mythtv-users mailing list