From 4d474c03e1b4b8c1a0e457ddd038cf5047f89d34 Mon Sep 17 00:00:00 2001 From: dbera Date: Tue, 12 Dec 2006 00:04:53 +0000 Subject: [PATCH] Dont reindex already indexed files. Yet another bug uncovered by the DateTime fixes. --- beagled/BuildIndex.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/beagled/BuildIndex.cs b/beagled/BuildIndex.cs index 154c7ba4..ee3e6518 100644 --- a/beagled/BuildIndex.cs +++ b/beagled/BuildIndex.cs @@ -451,7 +451,13 @@ namespace Beagle.Daemon static Indexable FileToIndexable (FileInfo file) { - if (!file.Exists || Ignore (file) || fa_store.IsUpToDate (file.FullName)) + if (!file.Exists || Ignore (file)) + return null; + + // Check if file information is uptodate in the attributes store + FileAttributes attr = fa_store.Read (file.FullName); + // FIXME:.Net-2.0 DateTime - compare attr.LastWriteTime, no need to ToUTC() + if (attr != null && file.LastWriteTimeUtc <= attr.LastWriteTime.ToUniversalTime ()) return null; // Create the indexable and add the standard properties we @@ -479,7 +485,9 @@ namespace Beagle.Daemon // If the directory exists in the fa store, then it is already indexed if (attr != null) { - if (arg_delete && dir.LastWriteTimeUtc > attr.LastWriteTime) + // FIXME:.Net-2.0 DateTime - compare attr.LastWriteTime, no need to ToUTC() + // Temporary protection against incorrect LastWriteTimeUtc + if (arg_delete && dir.LastWriteTimeUtc > attr.LastWriteTime.ToUniversalTime ()) modified_directories.Enqueue (dir); return null; } -- 2.11.4.GIT