π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Migrate getFilesInCollection from sqflite to sqlite_async
ashilkn785beeb9b3c8
diff --git a/mobile/lib/db/files_db.dart b/mobile/lib/db/files_db.dartindex dd941a9798..4900658f35 100644--- a/mobile/lib/db/files_db.dart+++ b/mobile/lib/db/files_db.dart@@ -670,19 +670,18 @@ class FilesDB {bool? asc,int visibility = visibleVisibility,}) async {- final db = await instance.database;+ final db = await instance.sqliteAsyncDB;final order = (asc ?? false ? 'ASC' : 'DESC');- const String whereClause =- '$columnCollectionID = ? AND $columnCreationTime >= ? AND $columnCreationTime <= ?';- final List<Object> whereArgs = [collectionID, startTime, endTime];-- final results = await db.query(- filesTable,- where: whereClause,- whereArgs: whereArgs,- orderBy:- '$columnCreationTime ' + order + ', $columnModificationTime ' + order,- limit: limit,+ String query =+ 'SELECT * FROM $filesTable WHERE $columnCollectionID = ? AND $columnCreationTime >= ? AND $columnCreationTime <= ? ORDER BY $columnCreationTime $order, $columnModificationTime $order';+ final List<Object> args = [collectionID, startTime, endTime];+ if (limit != null) {+ query += ' LIMIT ?';+ args.add(limit);+ }+ final results = await db.getAll(+ query,+ args,);final files = convertToFiles(results);return FileLoadResult(files, files.length == limit);