From b41b809b8d48a737e520c01007085af954d0f6b8 Mon Sep 17 00:00:00 2001 From: Aleksey Lim Date: Mon, 06 Sep 2010 08:49:52 +0000 Subject: metadata-only update sets filesize property to 0 #2229 --- diff --git a/src/carquinyol/datastore.py b/src/carquinyol/datastore.py index 839a396..86d5b02 100644 --- a/src/carquinyol/datastore.py +++ b/src/carquinyol/datastore.py @@ -252,11 +252,14 @@ class DataStore(dbus.service.Object): if 'creation_time' not in props: props['creation_time'] = props['timestamp'] - if os.path.exists(file_path): - stat = os.stat(file_path) - props['filesize'] = stat.st_size - else: - props['filesize'] = 0 + if file_path: + # Empty file_path means skipping storage stage, see filestore.py + # TODO would be more useful to update filesize after real file save + if os.path.exists(file_path): + stat = os.stat(file_path) + props['filesize'] = stat.st_size + else: + props['filesize'] = 0 self._metadata_store.store(uid, props) self._index_store.store(uid, props) -- cgit v0.9.1