Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrés Ambrois <andresambrois@gmail.com>2010-08-24 05:25:47 (GMT)
committer Andrés Ambrois <andresambrois@gmail.com>2010-08-24 09:13:34 (GMT)
commitc31e42ece09b173882552ef81ac9bf15c85671b5 (patch)
tree24b77ebd9da8292939ca33241bc1b2d23ecf66e9
parent762835adc5631961848bdf13a57dd67473531189 (diff)
Check creation_time on index rebuild.
-rw-r--r--src/carquinyol/datastore.py7
1 files changed, 7 insertions, 0 deletions
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)