After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 694357 - Incorrect behaviour when sorting by Date and TrackNumber
Incorrect behaviour when sorting by Date and TrackNumber
Status: RESOLVED FIXED
Product: rygel
Classification: Applications
Component: MediaExport plugin
0.17.x
Other Linux
: Normal normal
: ---
Assigned To: Jens Georg
rygel-maint
ivi
Depends on:
Blocks:
 
 
Reported: 2013-02-21 13:38 UTC by Mark Ryan
Modified: 2013-07-23 15:18 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
media-export: Fix sorting by date (2.15 KB, patch)
2013-05-13 13:30 UTC, Jens Georg
none Details | Review

Description Mark Ryan 2013-02-21 13:38:46 UTC
This is a little obscure I realise, but I'm experiencing some strange behaviour using the sort facility of the Search command with Media Export.  The items returned using the sort criteria "+dc:date,+upnp:originalTrackNumber" are not sorted correctly.  

If I just sort by date using dLeyna's mediaconsole I get

root.search('Type derivedfrom "item"',0,0,['Date'],"+Date")
Total Items: 31

{
    "Date": "2010"
}

{
    "Date": "2013-02-20T08:28:32Z"
}

{
    "Date": "2013-02-20T08:28:44Z"
}

{
    "Date": "2013-02-20T08:28:56Z"
}

{
    "Date": "2013-02-20T08:29:01Z"
}

{
    "Date": "2013-02-20T08:29:22Z"
}

{
    "Date": "2013-02-20T08:29:34Z"
}

{
    "Date": "2013-02-20T12:24:09Z"
}

{
    "Date": "2013-02-20T12:24:15Z"
}

{
    "Date": "2013-02-20T12:24:20Z"
}

{
    "Date": "2013-02-20T12:24:42Z"
}

{
    "Date": "2013-02-20T12:24:48Z"
}

{
    "Date": "2013-02-20T12:24:54Z"
}

{
    "Date": "2013-02-20T13:04:38Z"
}

{
    "Date": "2013-02-20T13:04:43Z"
}

{
    "Date": "2013-02-20T13:04:50Z"
}

{
    "Date": "2013-02-20T13:05:10Z"
}

{
    "Date": "2013-02-20T13:05:15Z"
}

{
    "Date": "2013-02-20T13:05:22Z"
}

{
    "Date": "2013-02-20T13:05:47Z"
}

{
    "Date": "2013-02-20T13:05:53Z"
}

{
    "Date": "2013-02-20T13:05:59Z"
}

{
    "Date": "2013-02-20T13:07:42Z"
}

{
    "Date": "2013-02-20T13:07:49Z"
}

{
    "Date": "2013-02-20T13:07:55Z"
}

{
    "Date": "2013-02-20T13:09:12Z"
}

{
    "Date": "2013-02-20T13:09:19Z"
}

{
    "Date": "2013-02-20T13:09:25Z"
}

{
    "Date": "2013-02-20T13:12:29Z"
}

{
    "Date": "2013-02-20T13:12:36Z"
}

{
    "Date": "2013-02-20T13:12:42Z"
}


But if I sort by Date and TrackNumber I get

root.search('Type derivedfrom "item"',0,0,['Date'],"+Date,+TrackNumber")
Total Items: 31

{
    "Date": "2010"
}

{
    "Date": "2013-02-20T12:24:09Z"
}

{
    "Date": "2013-02-20T12:24:15Z"
}

{
    "Date": "2013-02-20T12:24:20Z"
}

{
    "Date": "2013-02-20T12:24:42Z"
}

{
    "Date": "2013-02-20T12:24:48Z"
}

{
    "Date": "2013-02-20T12:24:54Z"
}

{
    "Date": "2013-02-20T13:04:38Z"
}

{
    "Date": "2013-02-20T13:04:43Z"
}

{
    "Date": "2013-02-20T13:04:50Z"
}

{
    "Date": "2013-02-20T13:05:10Z"
}

{
    "Date": "2013-02-20T13:05:15Z"
}

{
    "Date": "2013-02-20T13:05:22Z"
}

{
    "Date": "2013-02-20T13:05:47Z"
}

{
    "Date": "2013-02-20T13:05:53Z"
}

{
    "Date": "2013-02-20T13:05:59Z"
}

{
    "Date": "2013-02-20T13:07:42Z"
}

{
    "Date": "2013-02-20T13:07:49Z"
}

{
    "Date": "2013-02-20T13:07:55Z"
}

{
    "Date": "2013-02-20T13:09:12Z"
}

{
    "Date": "2013-02-20T13:09:19Z"
}

{
    "Date": "2013-02-20T13:09:25Z"
}

{
    "Date": "2013-02-20T13:12:29Z"
}

{
    "Date": "2013-02-20T13:12:36Z"
}

{
    "Date": "2013-02-20T13:12:42Z"
}

{
    "Date": "2013-02-20T08:28:32Z"
}

{
    "Date": "2013-02-20T08:28:44Z"
}

{
    "Date": "2013-02-20T08:28:56Z"
}

{
    "Date": "2013-02-20T08:29:01Z"
}

{
    "Date": "2013-02-20T08:29:22Z"
}

{
    "Date": "2013-02-20T08:29:34Z"
}


Since no two dates are the same the results of both searches should be identical.

I also get a similar result with UPnP Inspector.  I can post the resulting DIDL documents if needed.
Comment 1 Mark Ryan 2013-02-21 13:43:40 UTC
A quick update, I encountered the same problem with "+dc:date,dc:title".
Comment 2 Mark Ryan 2013-02-22 08:05:28 UTC
That should of course be "+dc:date,+dc:title".
Comment 3 Jens Georg 2013-02-27 16:58:10 UTC
I suppose this is with MediaExport?
Comment 4 Mark Ryan 2013-03-05 12:46:06 UTC
Yes.  This is with MediaExport.  I didn't test the Tracker plugin I'm afraid.
Comment 5 Jens Georg 2013-03-05 21:11:05 UTC
sorting is done by the back-end, hence the question.
Comment 6 Jens Georg 2013-03-12 12:48:48 UTC
oops, by accident I saw the translation of the sort criteria: 

ORDER BY strftime("%Y", m.date)  ASC ,o.title COLLATE CASEFOLD ASC

This should explain the order issues.
Comment 7 Jens Georg 2013-05-13 13:30:59 UTC
Created attachment 243995 [details] [review]
media-export: Fix sorting by date
Comment 8 Jens Georg 2013-06-03 10:43:14 UTC
This was fixed in 0.18.2 and 0.19.2
Comment 9 Jens Georg 2013-07-23 15:18:53 UTC
Attachment 243995 [details] pushed as 0380882 - media-export: Fix sorting by date