[mob] Use async sqlite for getting faceID from cluster

This commit is contained in:
laurenspriem 2024-04-18 16:00:47 +05:30
parent be1b4b359c
commit 74247c4563

View file

@ -335,12 +335,11 @@ class FaceMLDataDB {
}
Future<Iterable<String>> getFaceIDsForCluster(int clusterID) async {
final db = await instance.database;
final List<Map<String, dynamic>> maps = await db.query(
faceClustersTable,
columns: [fcFaceId],
where: '$fcClusterID = ?',
whereArgs: [clusterID],
final db = await instance.sqliteAsyncDB;
final List<Map<String, dynamic>> maps = await db.getAll(
'SELECT $fcFaceId FROM $faceClustersTable '
'WHERE $faceClustersTable.$fcClusterID = ?',
[clusterID],
);
return maps.map((e) => e[fcFaceId] as String).toSet();
}