Skip to content

armgit / ente

Public Imported from GitHub
0

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

Guard error-path fallback writes by instruction flags

Amrithesh Kakkoth Ente3da17e617b13
diff --git a/mobile/apps/photos/lib/services/machine_learning/ml_service.dart b/mobile/apps/photos/lib/services/machine_learning/ml_service.dart
index 44e9f43608..4c0aef42f7 100644
--- a/mobile/apps/photos/lib/services/machine_learning/ml_service.dart
+++ b/mobile/apps/photos/lib/services/machine_learning/ml_service.dart
@@ -709,16 +709,20 @@ class MLService {
e,
s,
);
- await mlDataDB.bulkInsertFaces(
- [Face.empty(instruction.fileKey, error: true)],
- );
- if (instruction.isOffline) {
- await mlDataDB.putClip([ClipEmbedding.empty(instruction.fileKey)]);
- } else {
- await SemanticSearchService.instance.storeEmptyClipImageResult(
- instruction.file,
+ if (instruction.shouldRunFaces) {
+ await mlDataDB.bulkInsertFaces(
+ [Face.empty(instruction.fileKey, error: true)],
);
}
+ if (instruction.shouldRunClip) {
+ if (instruction.isOffline) {
+ await mlDataDB.putClip([ClipEmbedding.empty(instruction.fileKey)]);
+ } else {
+ await SemanticSearchService.instance.storeEmptyClipImageResult(
+ instruction.file,
+ );
+ }
+ }
if (instruction.shouldRunPets) {
await mlDataDB.deletePetDataForFiles([instruction.fileKey]);
await mlDataDB.bulkInsertPetFaces(