From: David Stainton Date: Mon, 31 Aug 2015 21:38:31 +0000 (+0200) Subject: Add db util function for retrieving all downloaded files X-Git-Url: https://git.rkrishnan.org/?a=commitdiff_plain;h=bbf47cb2781a5402232bc7f509b2b8d44139b831;p=tahoe-lafs%2Ftahoe-lafs.git Add db util function for retrieving all downloaded files --- diff --git a/src/allmydata/backupdb.py b/src/allmydata/backupdb.py index 7ec3881c..3f43eee0 100644 --- a/src/allmydata/backupdb.py +++ b/src/allmydata/backupdb.py @@ -368,6 +368,17 @@ class BackupDB: class MagicFolderDB(BackupDB): VERSION = 3 + def get_all_files(self): + """Retreive a list of all files that have had an entry in magic-folder db + (files that have been downloaded at least once). + """ + self.cursor.execute("SELECT path FROM local_files") + rows = self.cursor.fetchall() + if not rows: + return None + else: + return rows + def get_local_file_version(self, path): """I will tell you the version of a local file tracked by our magic folder db. If no db entry found then I'll return None.