[tracker] libtracker-miner: Always query urn for add/update, metadata may already be in store



commit 38c41a01450ad5eba03d9453ca7643bf088b5cd3
Author: Martin Kampas <martin kampas+gnomebugs ubedi net>
Date:   Tue Mar 12 17:49:49 2013 +0000

    libtracker-miner: Always query urn for add/update, metadata may already be in store
    
    Part 1 of 2 for this bug:
    https://bugzilla.gnome.org/show_bug.cgi?id=643388

 src/libtracker-miner/tracker-miner-fs.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-miner-fs.c b/src/libtracker-miner/tracker-miner-fs.c
index e5fec2e..821da78 100644
--- a/src/libtracker-miner/tracker-miner-fs.c
+++ b/src/libtracker-miner/tracker-miner-fs.c
@@ -1292,10 +1292,11 @@ item_add_or_update (TrackerMinerFS *fs,
        sparql = tracker_sparql_builder_new_update ();
        g_object_ref (file);
 
-       if (!is_new) {
-               urn = tracker_file_notifier_get_file_iri (fs->priv->file_notifier,
-                                                         file);
-       }
+       /* Always query. No matter we are notified the file was just
+        * created, its meta data might already be in the store
+        * (possibly inserted by other application) - in such a case
+        * we have to UPDATE, not INSERT. */
+       urn = tracker_file_notifier_get_file_iri (fs->priv->file_notifier, file);
 
        if (!tracker_indexing_tree_file_is_root (fs->priv->indexing_tree, file)) {
                parent = g_file_get_parent (file);


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