Skip to content

armgit / ente

Public Imported from GitHub
0

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

[mob][photos] Loosen startup ML hydration gating

laurenspriem8346b8660fe8
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 62e2bd1e10..bfcdd493b1 100644
--- a/mobile/apps/photos/lib/services/machine_learning/ml_service.dart
+++ b/mobile/apps/photos/lib/services/machine_learning/ml_service.dart
@@ -27,7 +27,6 @@ import "package:photos/services/machine_learning/ml_indexing_isolate.dart";
import "package:photos/services/machine_learning/ml_result.dart";
import "package:photos/services/machine_learning/semantic_search/semantic_search_service.dart";
import "package:photos/services/search_service.dart";
-import "package:photos/services/sync/sync_service.dart";
import "package:photos/services/video_preview_service.dart";
import "package:photos/utils/ml_util.dart";
import "package:photos/utils/network_util.dart";
@@ -192,23 +191,6 @@ class MLService {
if (!hasGrantedMLConsent || isOfflineMode) {
return;
}
- final bool syncSuccessful;
- try {
- syncSuccessful = await SyncService.instance.sync();
- } catch (e, s) {
- _logger.warning(
- "Skipping startup-owned remote ML hydration because startup sync failed",
- e,
- s,
- );
- return;
- }
- if (!syncSuccessful) {
- _logger.info(
- "Skipping startup-owned remote ML hydration because startup sync did not complete",
- );
- return;
- }
try {
await fileDataService.syncFDStatus();
} catch (e, s) {
diff --git a/mobile/apps/photos/lib/utils/ml_util.dart b/mobile/apps/photos/lib/utils/ml_util.dart
index dc177db281..53550d47df 100644
--- a/mobile/apps/photos/lib/utils/ml_util.dart
+++ b/mobile/apps/photos/lib/utils/ml_util.dart
@@ -249,7 +249,9 @@ Future<List<FileMLInstruction>> getFilesForMlIndexing() async {
filesOwnedByOthers.add(instruction);
}
}
- _lastFetchTimeForOthersIndexed = time;
+ if (filesOwnedByOthers.isNotEmpty) {
+ _lastFetchTimeForOthersIndexed = time;
+ }
_logger.info(
'Checking index for ${filesOwnedByOthers.length} owned by others',
);