Skip to content

armgit / ente

Public Imported from GitHub
0

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

[mob] Pull shared indexes

Neeraj Gupta645023a76d6a
diff --git a/mobile/lib/services/machine_learning/face_ml/person/person_service.dart b/mobile/lib/services/machine_learning/face_ml/person/person_service.dart
index 2386312df9..1dcac8b025 100644
--- a/mobile/lib/services/machine_learning/face_ml/person/person_service.dart
+++ b/mobile/lib/services/machine_learning/face_ml/person/person_service.dart
@@ -426,11 +426,16 @@ class PersonService {
}
Future<void> updatePerson(PersonEntity updatePerson) async {
- await entityService.addOrUpdate(
- EntityType.cgroup,
- updatePerson.data.toJson(),
- id: updatePerson.remoteID,
- );
- updatePerson.data.logStats();
+ try {
+ await entityService.addOrUpdate(
+ EntityType.cgroup,
+ updatePerson.data.toJson(),
+ id: updatePerson.remoteID,
+ );
+ updatePerson.data.logStats();
+ } catch (e, s) {
+ logger.severe("Failed to update person", e, s);
+ rethrow;
+ }
}
}
diff --git a/mobile/lib/utils/ml_util.dart b/mobile/lib/utils/ml_util.dart
index 788ae313c2..89848ecf1c 100644
--- a/mobile/lib/utils/ml_util.dart
+++ b/mobile/lib/utils/ml_util.dart
@@ -100,7 +100,7 @@ Future<List<FileMLInstruction>> getFilesForMlIndexing() async {
final List<FileMLInstruction> filesWithoutLocalID = [];
final List<FileMLInstruction> hiddenFilesToIndex = [];
for (final EnteFile enteFile in enteFiles) {
- if (_skipAnalysisEnteFile(enteFile)) {
+ if (_skipAnalysisEnteFile(enteFile, allowFetch: false)) {
continue;
}
if (queuedFiledIDs.contains(enteFile.uploadedFileID)) {
@@ -158,7 +158,7 @@ Future<List<FileMLInstruction>> getFilesForMlIndexing() async {
);
_logger.info(
- "Getting list of files to index for ML took ${DateTime.now().difference(time).inMilliseconds} ms",
+ "Getting list of ${sortedBylocalID.length} files to index for ML took ${DateTime.now().difference(time).inMilliseconds} ms",
);
if (!localSettings.isMLLocalIndexingEnabled) {
return splitResult.matched;
@@ -359,9 +359,9 @@ Future<String> getImagePathForML(EnteFile enteFile) async {
return imagePath;
}
-bool _skipAnalysisEnteFile(EnteFile enteFile) {
+bool _skipAnalysisEnteFile(EnteFile enteFile, {bool allowFetch = false}) {
// Skip if the file is not uploaded or not owned by the user
- if (!enteFile.isUploaded || enteFile.isOwner == false) {
+ if (!enteFile.isUploaded || (enteFile.isOwner == false && !allowFetch)) {
return true;
}
// I don't know how motionPhotos and livePhotos work, so I'm also just skipping them for now