#22 Sorting issue

closed-wont-fix
nobody
None
5
2010-03-19
2009-11-21
Stedy
No

There seams to be a error when sorting strings in minidlna. If you have some directory's named whit the first letter upper-case and others whit lower-case.Then directorys is listed from A to Z, thereafter a to z. I guess this is wrong.
I guess upper-case and lowe-case should be treated similar when sorting text?

eksample if you make directorys as follow:
Alpha1,alpha2,Bravo1,bravo2,Charli1,charli2,Delta,Zulu

minidlna will sort them like this:
Alpha,Bravo1,Charli1,Delta,Zulu,alpha2,bravo2,charli2

This sorting issue apply for directory browsing and artist name for sure, I haven't tested the other sort options, but i guess the same issue apply for al sort options in Minidlna.

Discussion

  • Stedy
    Stedy
    2010-03-18

    Is there any progress on this one?

     
  • Justin Maggard
    Justin Maggard
    2010-03-19

    Actually, it should already be like that. Are you sure your client isn't sorting the items improperly itself? Do you have minidlna debug output showing non-collated sorting output?

     
  • Stedy
    Stedy
    2010-03-19

    sorting test

     
    Attachments
  • Stedy
    Stedy
    2010-03-19

    I have upploaded my debug output, database and a screen-shoot from "Upnp inspector". The problem shows up on Sony Bravia W4500 and Upnp Inspector.
    line 581 to 586 in debug3 looks suspicious to me.
    Hope this could help.

     
  • Justin Maggard
    Justin Maggard
    2010-03-19

    According to your log, the client is not sending SortCriteria. If SortCriteria was set to dc:title, then it would sort how you expect.

     
  • Stedy
    Stedy
    2010-03-19

    ok..
    But is't there a sorting from the server at all? Why is minidlna responding whit:
    container><container id="64$2" parentID="64" restricted="1" childCount="0"><dc:title>Charli1</dc:title..
    container><container id="64$4" parentID="64" restricted="1" childCount="0"><dc:title>Delta</dc:title
    container><container id="64$1" parentID="64" restricted="1" childCount="0"><dc:title>bravo2
    container><container id="64$3" parentID="64" restricted="1" childCount="0"><dc:title>charli2

    I guess container id is database position. and 64$2,64$4,64$1,64$3 is in another order than the data is stored in minidlna database.. If the data had been presented as 64$1, 64$2, 64$3, 64$4 then the order would have been ok on my clients.?. I am total wrong here?

     
  • Justin Maggard
    Justin Maggard
    2010-03-19

    The results aren't sorted in any specific way. You can see from the database query that no sort order has been set. Without a sort order request from the client, we just let sqlite return the results in the order that is most efficient for sqlite. We can add a default sort order if the client doesn't ask for sorted results, but this can really hurt browsing performance on slow processors. Maybe if it's x86, we can use a default collated, alphabetical sort order. But we wouldn't want to do that on embedded processors.

     
  • Stedy
    Stedy
    2010-03-19

    • status: open --> closed-wont-fix
     
  • Stedy
    Stedy
    2010-03-19

    Ok :) i buy that explanation. So we close this bug and mark it Wont Fix.