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 Aleksey Lim <alsroot@member.fsf.org>2010-08-24 16:01:47 (GMT)
commit7475a1fe38fca3ee4491bc272a59693805136f1e (patch)
tree24b77ebd9da8292939ca33241bc1b2d23ecf66e9
parentfaa9974381f5ad70307e6c394d096b56134391e7 (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)