[tracker] libtracker-miner: cater for unbound nfo:belongsToContainer when moving items



commit e5f565fba7bedc2bb6d9a40ef7384684637e57dc
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sat Jun 4 16:57:45 2016 +0200

    libtracker-miner: cater for unbound nfo:belongsToContainer when moving items
    
    Fixes warnings when moving indexing roots around. This query expects this
    property to be bound, resulting in no-op if that's not the case (e.g.
    indexing roots), later reinsertions of nie:url and other properties with
    max cardinality=1 trigger the whole update failure, because those weren't
    properly removed.

 src/libtracker-miner/tracker-miner-fs.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-miner-fs.c b/src/libtracker-miner/tracker-miner-fs.c
index d8529da..6c00a50 100644
--- a/src/libtracker-miner/tracker-miner-fs.c
+++ b/src/libtracker-miner/tracker-miner-fs.c
@@ -1925,10 +1925,10 @@ item_move (TrackerMinerFS *fs,
                                "} WHERE { "
                                "  <%s> nfo:fileName ?f ; "
                                "       nie:url ?u ; "
-                               "       nie:isStoredAs ?s ; "
-                               "       nfo:belongsToContainer ?b"
+                               "       nie:isStoredAs ?s . "
+                               "       OPTIONAL { <%s> nfo:belongsToContainer ?b }"
                                "} ",
-                               source_iri, source_iri);
+                               source_iri, source_iri, source_iri);
 
        display_name = tracker_sparql_escape_string (g_file_info_get_display_name (file_info));
 


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