π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Fix: Only cache files with CLIP embeddings in similar images
laurenspriem5c40f8162130
diff --git a/mobile/apps/photos/lib/services/machine_learning/similar_images_service.dart b/mobile/apps/photos/lib/services/machine_learning/similar_images_service.dartindex df2f6abec9..b721d76cc3 100644--- a/mobile/apps/photos/lib/services/machine_learning/similar_images_service.dart+++ b/mobile/apps/photos/lib/services/machine_learning/similar_images_service.dart@@ -57,6 +57,12 @@ class SimilarImagesService {await mlDataDB.checkMigrateFillClipVectorDB();w?.log("checkMigrateFillClipVectorDB");+ // Get all files with CLIP embeddings first to avoid caching unindexed files+ final Map<int, int> clipIndexedFiles =+ await mlDataDB.clipIndexedFileWithVersion();+ final Set<int> clipIndexedFileIDs = clipIndexedFiles.keys.toSet();+ w?.log("getClipIndexedFiles");+// Get all files, and all potential embedding IDs, and create a map of fileID to filefinal allFiles = Set<EnteFile>.from(await SearchService.instance.getAllFilesForSearch(),@@ -64,7 +70,10 @@ class SimilarImagesService {final allFileIdsToFile = <int, EnteFile>{};final fileIDs = <int>[];for (final file in allFiles) {- if (file.uploadedFileID != null && file.isOwner && !file.isVideo) {+ if (file.uploadedFileID != null &&+ file.isOwner &&+ !file.isVideo &&+ clipIndexedFileIDs.contains(file.uploadedFileID!)) {allFileIdsToFile[file.uploadedFileID!] = file;fileIDs.add(file.uploadedFileID!);}