From 1b599d880e994ac9380c0447eeb0749c311a8cf5 Mon Sep 17 00:00:00 2001
Message-Id: <1b599d880e994ac9380c0447eeb0749c311a8cf5.1278225682.git.andresambrois@gmail.com>
In-Reply-To: <cover.1278225681.git.andresambrois@gmail.com>
References: <cover.1278225681.git.andresambrois@gmail.com>
From: =?UTF-8?q?Andr=C3=A9s=20Ambrois?= <andresambrois@gmail.com>
Date: Fri, 2 Jul 2010 03:40:51 -0300
Subject: [PATCH v2 5/7] Check ctime on index rebuild
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit


Signed-off-by: Andrés Ambrois <andresambrois@gmail.com>
---
 src/carquinyol/datastore.py |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/carquinyol/datastore.py b/src/carquinyol/datastore.py
index 73e2d74..82d5700 100644
--- a/src/carquinyol/datastore.py
+++ b/src/carquinyol/datastore.py
@@ -129,6 +129,10 @@ class DataStore(dbus.service.Object):
                         if os.path.exists(path):
                             props['filesize'] = os.stat(path).st_size
                             update_metadata = True
+                    if 'ctime' not in props:
+                        props['ctime'] = time.strftime(CTIME_FORMAT,
+                            time.localtime(int(props['timestamp'])))
+                        update_metadata = True
                     if update_metadata:
                         self._metadata_store.store(uid, props)
                     self._index_store.store(uid, props)
-- 
1.7.0.4

