diff options
-rw-r--r-- | src/carquinyol/datastore.py | 7 |
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) |