[rygel] tracker: Non-native files are nfo:RemoteDataObject



commit 67b932233a9e5419db9600bdb09841a01474ee40
Author: Jens Georg <mail jensge org>
Date:   Wed May 11 09:31:35 2011 +0200

    tracker: Non-native files are nfo:RemoteDataObject
    
    This also reflects in the place_holder state. Placeholder items are now
    those that are nie:DataObjects but not nfo:FileDataObjects or
    nfo:RemoteDataObjects.

 .../tracker/rygel-tracker-insertion-query.vala     |    9 ++++++++-
 .../tracker/rygel-tracker-key-chain-map.vala       |    4 +++-
 2 files changed, 11 insertions(+), 2 deletions(-)
---
diff --git a/src/plugins/tracker/rygel-tracker-insertion-query.vala b/src/plugins/tracker/rygel-tracker-insertion-query.vala
index 511e1ef..c59191b 100644
--- a/src/plugins/tracker/rygel-tracker-insertion-query.vala
+++ b/src/plugins/tracker/rygel-tracker-insertion-query.vala
@@ -40,9 +40,16 @@ public class Rygel.Tracker.InsertionQuery : Query {
     public string id;
 
     public InsertionQuery (MediaItem item, string category) {
+        var type = "nie:DataObject";
+        var file = File.new_for_uri (item.uris[0]);
+
+        if (!file.is_native ()) {
+            type = "nfo:RemoteDataObject";
+        }
+
         var triplets = new QueryTriplets ();
         triplets.add (new QueryTriplet (QUERY_ID, "a", category));
-        triplets.add (new QueryTriplet (QUERY_ID, "a", "nie:DataObject"));
+        triplets.add (new QueryTriplet (QUERY_ID, "a", type));
         triplets.add (new QueryTriplet (QUERY_ID, "nmm:uPnPShared", "true"));
         triplets.add (new QueryTriplet (QUERY_ID, "tracker:available", "true"));
         triplets.add (new QueryTriplet (QUERY_ID,
diff --git a/src/plugins/tracker/rygel-tracker-key-chain-map.vala b/src/plugins/tracker/rygel-tracker-key-chain-map.vala
index 8eaf3e2..308153e 100644
--- a/src/plugins/tracker/rygel-tracker-key-chain-map.vala
+++ b/src/plugins/tracker/rygel-tracker-key-chain-map.vala
@@ -45,7 +45,9 @@ public class Rygel.Tracker.KeyChainMap : Object {
         // Item
         add_key_chain ("res", "nie:url");
         add_function ("place_holder",
-                      "(NOT EXISTS { %s a nfo:FileDataObject })");
+                      "tracker:coalesce((SELECT false WHERE { { %s a ?o } " +
+                      "FILTER (?o IN (nfo:FileDataObject, " +
+                      "nfo:RemoteDataObject)) }), true)");
         add_key_chain ("fileName", "nfo:fileName");
         add_key_chain ("dc:title", "nie:title");
         add_key_chain ("dlnaProfile", "nmm:dlnaProfile");



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