[rygel] tracker: Sort query results by "fileLastModified"



commit 874d759b59c65fc9122dba70a59239324fab0099
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Wed Dec 2 01:31:03 2009 +0200

    tracker: Sort query results by "fileLastModified"
    
    Ask tracker to sort query results by "nfo:fileLastModified" since it's
    much faster than sorting by URIs.

 .../tracker/rygel-tracker-search-container.vala    |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/src/plugins/tracker/rygel-tracker-search-container.vala b/src/plugins/tracker/rygel-tracker-search-container.vala
index aab80da..a2c1819 100644
--- a/src/plugins/tracker/rygel-tracker-search-container.vala
+++ b/src/plugins/tracker/rygel-tracker-search-container.vala
@@ -34,6 +34,8 @@ public class Rygel.TrackerSearchContainer : Rygel.MediaContainer {
     private const string RESOURCES_PATH = "/org/freedesktop/Tracker1/Resources";
 
     private const string ITEM_VARIABLE = "?item";
+    private const string MODIFIED_PREDICATE = "nfo:fileLastModified";
+    private const string MODIFIED_VARIABLE = "?modified";
 
     public TrackerQuery query;
     public TrackerItemFactory item_factory;
@@ -64,6 +66,10 @@ public class Rygel.TrackerSearchContainer : Rygel.MediaContainer {
                                                     "a",
                                                     item_factory.category,
                                                     false));
+        our_mandatory.add (new TrackerQueryTriplet (ITEM_VARIABLE,
+                                                    MODIFIED_PREDICATE,
+                                                    MODIFIED_VARIABLE,
+                                                    false));
 
         var optional = new TrackerQueryTriplets ();
         foreach (var key in this.item_factory.get_metadata_keys ()) {
@@ -81,7 +87,7 @@ public class Rygel.TrackerSearchContainer : Rygel.MediaContainer {
                                        our_mandatory,
                                        optional,
                                        filters,
-                                       ITEM_VARIABLE);
+                                       MODIFIED_VARIABLE);
 
         try {
             this.create_proxies ();



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]