Skip to content

armgit / ente

Public Imported from GitHub
0

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

[mob][photos] Use hidden cached files for count

laurenspriem09b2732d7608
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.dart
index 9eee02c30b..66668fccfe 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
@@ -1333,7 +1333,7 @@ class FaceMlService {
final int alreadyIndexedCount = await FaceMLDataDB.instance
.getIndexedFileCount(minimumMlVersion: faceMlVersion);
- final int totalIndexableCount = (await getIndexableFileIDs()).length;
+ final int totalIndexableCount = await getIndexableFilesCount();
final ratio = alreadyIndexedCount / totalIndexableCount;
w?.log('getIndexedDoneRatio');
@@ -1341,9 +1341,11 @@ class FaceMlService {
return ratio;
}
- static Future<List<int>> getIndexableFileIDs() async {
- return FilesDB.instance
- .getOwnedFileIDs(Configuration.instance.getUserID()!);
+ static Future<int> getIndexableFilesCount() async {
+ final List<EnteFile> enteFiles = await SearchService.instance.getAllFiles();
+ final List<EnteFile> hiddenFiles =
+ await SearchService.instance.getHiddenFiles();
+ return enteFiles.length + hiddenFiles.length;
}
bool _skipAnalysisEnteFile(EnteFile enteFile, Map<int, int> indexedFileIds) {
diff --git a/mobile/lib/ui/settings/machine_learning_settings_page.dart b/mobile/lib/ui/settings/machine_learning_settings_page.dart
index 75b83d4f12..b74b33fe56 100644
--- a/mobile/lib/ui/settings/machine_learning_settings_page.dart
+++ b/mobile/lib/ui/settings/machine_learning_settings_page.dart
@@ -434,7 +434,7 @@ class FaceRecognitionStatusWidgetState
Future<(int, int, int, double)> getIndexStatus() async {
final indexedFiles = await FaceMLDataDB.instance
.getIndexedFileCount(minimumMlVersion: faceMlVersion);
- final indexableFiles = (await FaceMlService.getIndexableFileIDs()).length;
+ final indexableFiles = await FaceMlService.getIndexableFilesCount();
final showIndexedFiles = min(indexedFiles, indexableFiles);
final pendingFiles = max(indexableFiles - indexedFiles, 0);
final foundFaces = await FaceMLDataDB.instance.getTotalFaceCount();