[mythtv-users] MythVideo: file name sorting oddity

Ryan Pisani mythtv at frouse3.homelinux.com
Wed Dec 12 20:43:00 UTC 2007


>>  Sorry if this is a duplicate, I didn't see the original message post
>> correctly to the list.
>>
>> If this has been asked and answered before I apologize - I went through
>> the last year's archives and didn't see any relevant threads.
>>
>> Just to start, I'm using Mythbuntu 7.10 which means I'm not entirely
>> sure what version of MythTV and all the plugins are being used, but if
>> need be I can find that out for you.
>>
>> What I've noticed is that MythVideo organizes files in a very strange
>> manner, namely lexicographically incorrect (I believe).  Shorter file
>> names come after longer file names and higher numbers come before lower
>> ones.  Conversely, the alphabetic ordering is correct (a-z, not z-a) so
>> it suggests that the order is not merely reversed.
>>
>> This problem plays out particularly with series (trilogies for example)
>> such as having:
>>
>> Spider-Man.avi
>> Spider-Man_2.avi
>> Spider-Man_3.avi
>>
>> These would show up in a directory listing as I've written, but in
>> MythVideo they show up as:
>>
>> Spider-Man 3
>> Spider-Man 2
>> Spider-Man
>>
>> Which is completely un-intuitive to me.  Could someone explain this
>> behavior and preferably how to fix it?
>>
>> Thank you,
>> Brion
>
> I too have noticed this oddity, but have never put much stock into.
> However, I believe this has to do with the default sorting methods of
> mysql.
>
>
> mysql> select title from videometadata where filename like "%Back To The
> Future%";
> +-----------------------------+
> | title                       |
> +-----------------------------+
> | Back to the Future Part II  |
> | Back to the Future Part III |
> | Back to the Future          |
> +-----------------------------+
> 3 rows in set (0.01 sec)
>
> I'm not sure why this is, as it definitely goes against the rules we've
> all learned in sorting/alphabetizing. I'm not sure if this can be
> configured somewhere, but it might be worth a look.

Just to add to this. It looks like an order by title does the trick in
terms of getting the sort correct.

mysql> select title from videometadata where filename like "%Back To The
Future%" order by title;
+-----------------------------+
| title                       |
+-----------------------------+
| Back to the Future          |
| Back to the Future Part II  |
| Back to the Future Part III |
+-----------------------------+
3 rows in set (0.01 sec)

Either way it may be that the data is default ordered when queried by the
mythtvideo plugin.



> Ryan
>
>> _______________________________________________
>> mythtv-users mailing list
>> mythtv-users at mythtv.org
>> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users
>>
>
> _______________________________________________
> mythtv-users mailing list
> mythtv-users at mythtv.org
> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users
>



More information about the mythtv-users mailing list