Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

[mob][photos] Forgot method

laurenspriem7fd5ffc0e675
diff --git a/mobile/lib/face/db.dart b/mobile/lib/face/db.dart
index 53a3a22e8b..a71fcc8864 100644
--- a/mobile/lib/face/db.dart
+++ b/mobile/lib/face/db.dart
@@ -348,6 +348,20 @@ class FaceMLDataDB {
return result;
}
+ Future<Map<int, Iterable<String>>> getAllClusterIdToFaceIDs() async {
+ final db = await instance.sqliteAsyncDB;
+ final Map<int, List<String>> result = {};
+ final List<Map<String, dynamic>> maps = await db.getAll(
+ 'SELECT $fcClusterID, $fcFaceId FROM $faceClustersTable',
+ );
+ for (final map in maps) {
+ final clusterID = map[fcClusterID] as int;
+ final faceID = map[fcFaceId] as String;
+ result.putIfAbsent(clusterID, () => <String>[]).add(faceID);
+ }
+ return result;
+ }
+
Future<Iterable<String>> getFaceIDsForCluster(int clusterID) async {
final db = await instance.sqliteAsyncDB;
final List<Map<String, dynamic>> maps = await db.getAll(