diff options
author | Aleksey Lim <alsroot@member.fsf.org> | 2010-09-06 08:49:52 (GMT) |
---|---|---|
committer | Aleksey Lim <alsroot@member.fsf.org> | 2010-09-06 08:49:52 (GMT) |
commit | b41b809b8d48a737e520c01007085af954d0f6b8 (patch) | |
tree | f3d6f5dca18f7824e642c12e0c9f00df62445423 | |
parent | 9bd6a51f9f14184f014de4cb6f851d4e373202f9 (diff) |
metadata-only update sets filesize property to 0 #2229
-rw-r--r-- | src/carquinyol/datastore.py | 13 |
1 files changed, 8 insertions, 5 deletions
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) |