From 7475a1fe38fca3ee4491bc272a59693805136f1e Mon Sep 17 00:00:00 2001 From: Andrés Ambrois Date: Tue, 24 Aug 2010 05:25:47 +0000 Subject: Check creation_time on index rebuild. --- diff --git a/src/carquinyol/datastore.py b/src/carquinyol/datastore.py index fb999b2..ac3d42d 100644 --- a/src/carquinyol/datastore.py +++ b/src/carquinyol/datastore.py @@ -128,6 +128,13 @@ class DataStore(dbus.service.Object): if os.path.exists(path): props['filesize'] = os.stat(path).st_size update_metadata = True + if 'creation_time' not in props: + if 'ctime' in props: + props['creation_time'] = time.mktime(time.strptime( + props['ctime'], migration.DATE_FORMAT)) + else: + props['creation_time'] = props['timestamp'] + update_metadata = True if update_metadata: self._metadata_store.store(uid, props) self._index_store.store(uid, props) -- cgit v0.9.1