[tracker] libtracker-miner: Fix mtime check



commit 79547a7dd38a66f46df8e006d5a426cbb6aa8054
Author: Jürg Billeter <j bitron ch>
Date:   Mon Apr 11 17:08:04 2011 +0200

    libtracker-miner: Fix mtime check
    
    Due to a bug in the query used for mtime checking, all files were
    considered updated and hence reextracted.
    
    Fixes NB#241302.

 src/libtracker-miner/tracker-miner-fs.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-miner-fs.c b/src/libtracker-miner/tracker-miner-fs.c
index 73b41e5..d223e5b 100644
--- a/src/libtracker-miner/tracker-miner-fs.c
+++ b/src/libtracker-miner/tracker-miner-fs.c
@@ -2977,11 +2977,12 @@ ensure_mtime_cache (TrackerMinerFS *fs,
 
 		g_debug ("Generating mtime cache for URI '%s'", uri);
 
-		query = g_strdup_printf ("SELECT ?url IF(tracker:damaged(?u), '0001-01-01T00:00:00Z', ?last) { "
+		query = g_strdup_printf ("SELECT ?url IF(bound(?damaged) && ?damaged, '0001-01-01T00:00:00Z', STR(?last)) { "
 		                         "?u nfo:belongsToContainer ?p ; "
 		                         "   nie:url ?url ; "
 		                         "   nfo:fileLastModified ?last . "
-		                         "?p nie:url \"%s\" }", uri);
+		                         "?p nie:url \"%s\" . "
+		                         "OPTIONAL { ?u tracker:damaged ?damaged }}", uri);
 
 		g_free (uri);
 	}



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