From e87ae499eb36f9211a0f5e7194841b99b6db2175 Mon Sep 17 00:00:00 2001 From: ashilkn Date: Thu, 18 Apr 2024 10:59:22 +0530 Subject: [PATCH] [mob] pref: use sqlite_async for getFilesCreatedWithinDurations --- mobile/lib/db/files_db.dart | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/mobile/lib/db/files_db.dart b/mobile/lib/db/files_db.dart index 202faaaad9..0bd3a9cfa9 100644 --- a/mobile/lib/db/files_db.dart +++ b/mobile/lib/db/files_db.dart @@ -757,7 +757,7 @@ class FilesDB { if (durations.isEmpty) { return []; } - final db = await instance.database; + final db = await instance.sqliteAsyncDB; String whereClause = "( "; for (int index = 0; index < durations.length; index++) { whereClause += "($columnCreationTime >= " + @@ -772,11 +772,12 @@ class FilesDB { } } whereClause += ")"; - final results = await db.query( - filesTable, - where: whereClause, - orderBy: '$columnCreationTime ' + order, + final query = + 'SELECT * FROM $filesTable WHERE $whereClause ORDER BY $columnCreationTime $order'; + final results = await db.getAll( + query, ); + final files = convertToFiles(results); return applyDBFilters( files,