From 96258086a079d54f0e1349aca41878d93102b822 Mon Sep 17 00:00:00 2001 From: Victor Shyba Date: Sun, 26 Mar 2017 18:59:37 -0300 Subject: [feature] add listing to local blob db --- client/src/leap/soledad/client/_blobs.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'client/src') diff --git a/client/src/leap/soledad/client/_blobs.py b/client/src/leap/soledad/client/_blobs.py index f9f1515b..e781421e 100644 --- a/client/src/leap/soledad/client/_blobs.py +++ b/client/src/leap/soledad/client/_blobs.py @@ -163,6 +163,9 @@ class BlobManager(object): data = yield self._client.get(uri) defer.returnValue((yield data.json())) + def local_list(self): + return self.local.list() + @defer.inlineCallbacks def put(self, doc, size): fd = doc.blob_fd @@ -289,6 +292,13 @@ class SQLiteBlobBackend(object): if result: defer.returnValue(BytesIO(str(result[0][0]))) + @defer.inlineCallbacks + def list(self): + query = 'select blob_id from blobs' + result = yield self.dbpool.runQuery(query) + if result: + defer.returnValue([b_id[0] for b_id in result]) + def _init_blob_table(conn): maybe_create = ( -- cgit v1.2.3