Skip to content

armgit / ente

Public Imported from GitHub
0

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

Add API to fetch files without embeddings

vishnukvmd95a2c6613182
diff --git a/lib/db/files_db.dart b/lib/db/files_db.dart
index 262cbf618a..52852e5c12 100644
--- a/lib/db/files_db.dart
+++ b/lib/db/files_db.dart
@@ -1554,6 +1554,17 @@ class FilesDB {
return _convertToEmbeddings(results);
}
+ Future<List<EnteFile>> getFilesWithoutEmbeddings() async {
+ final db = await instance.database;
+ final result = await db.rawQuery('''
+ SELECT $filesTable.*
+ FROM $filesTable
+ LEFT JOIN $embeddingsTable ON $filesTable.$columnGeneratedID = $embeddingsTable.$columnGeneratedID
+ WHERE $embeddingsTable.$columnGeneratedID IS NULL;
+ ''');
+ return convertToFiles(result);
+ }
+
Map<String, dynamic> _getRowForFile(EnteFile file) {
final row = <String, dynamic>{};
if (file.generatedID != null) {