π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
[mob][photos] Revert to SearchService just for now
laurenspriemcd9db4d10ffe
diff --git a/mobile/lib/services/machine_learning/face_ml/face_ml_service.dart b/mobile/lib/services/machine_learning/face_ml/face_ml_service.dartindex 62b330d6cf..6fd00f9e02 100644--- a/mobile/lib/services/machine_learning/face_ml/face_ml_service.dart+++ b/mobile/lib/services/machine_learning/face_ml/face_ml_service.dart@@ -30,7 +30,6 @@ import "package:photos/models/file/file.dart";import "package:photos/models/file/file_type.dart";import "package:photos/models/ml/ml_versions.dart";import "package:photos/service_locator.dart";-import "package:photos/services/collections_service.dart";import 'package:photos/services/machine_learning/face_ml/face_clustering/face_clustering_service.dart';import "package:photos/services/machine_learning/face_ml/face_clustering/face_info_for_clustering.dart";import 'package:photos/services/machine_learning/face_ml/face_detection/detection.dart';@@ -44,6 +43,7 @@ import 'package:photos/services/machine_learning/face_ml/face_ml_result.dart';import "package:photos/services/machine_learning/face_ml/person/person_service.dart";import 'package:photos/services/machine_learning/file_ml/file_ml.dart';import 'package:photos/services/machine_learning/file_ml/remote_fileml_service.dart';+import "package:photos/services/search_service.dart";import "package:photos/utils/file_util.dart";import 'package:photos/utils/image_ml_isolate.dart';import "package:photos/utils/image_ml_util.dart";@@ -570,16 +570,18 @@ class FaceMlService {try {isImageIndexRunning = true;_logger.info('starting image indexing');- final w = (kDebugMode ? EnteWatch('FacesGetAllFiles') : null)?..start();- final uploadedFileIDs = await FilesDB.instance- .getOwnedFileIDs(Configuration.instance.getUserID()!);- w?.log('getOwnedFileIDs');- final enteFiles =- await FilesDB.instance.getUploadedFiles(uploadedFileIDs);- w?.log('getUploadedFiles');+ // final w = (kDebugMode ? EnteWatch('FacesGetAllFiles') : null)?..start();+ // final uploadedFileIDs = await FilesDB.instance+ // .getOwnedFileIDs(Configuration.instance.getUserID()!);+ // w?.log('getOwnedFileIDs');+ // final enteFiles =+ // await FilesDB.instance.getUploadedFiles(uploadedFileIDs);+ // w?.log('getUploadedFiles');final Map<int, int> alreadyIndexedFiles =await FaceMLDataDB.instance.getIndexedFileIds();- w?.log('getIndexedFileIds');+ // w?.log('getIndexedFileIds');+ final List<EnteFile> enteFiles =+ await SearchService.instance.getAllFiles();// Make sure the image conversion isolate is spawned// await ImageMlIsolate.instance.ensureSpawned();@@ -591,16 +593,17 @@ class FaceMlService {final List<EnteFile> filesWithLocalID = <EnteFile>[];final List<EnteFile> filesWithoutLocalID = <EnteFile>[];final List<EnteFile> hiddenFiles = <EnteFile>[];- final ignoredCollections =- CollectionsService.instance.getHiddenCollectionIds();+ // final ignoredCollections =+ // CollectionsService.instance.getHiddenCollectionIds();for (final EnteFile enteFile in enteFiles) {if (_skipAnalysisEnteFile(enteFile, alreadyIndexedFiles)) {fileSkippedCount++;continue;}- if (ignoredCollections.contains(enteFile.collectionID)) {- hiddenFiles.add(enteFile);- } else if ((enteFile.localID ?? '').isEmpty) {+ // if (ignoredCollections.contains(enteFile.collectionID)) {+ // hiddenFiles.add(enteFile);+ // } else+ if ((enteFile.localID ?? '').isEmpty) {filesWithoutLocalID.add(enteFile);} else {filesWithLocalID.add(enteFile);@@ -1321,9 +1324,14 @@ class FaceMlService {}static Future<int> getIndexableFilesCount() async {- final indexableFileIDs = await FilesDB.instance- .getOwnedFileIDs(Configuration.instance.getUserID()!);- return indexableFileIDs.length;+ // final indexableFileIDs = await FilesDB.instance+ // .getOwnedFileIDs(Configuration.instance.getUserID()!);+ final allFiles = await SearchService.instance.getAllFiles();+ final indexableFiles = allFiles.where((file) {+ return file.isUploaded && file.isOwner;+ }).toList();++ return indexableFiles.length;}bool _skipAnalysisEnteFile(EnteFile enteFile, Map<int, int> indexedFileIds) {