Skip to content

armgit / ente

Public Imported from GitHub
0

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

[mob][photos] Show when clustering is running

laurenspriemf6bdeef33d80
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 aac040e488..87a707995c 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
@@ -91,7 +91,10 @@ class FaceMlService {
bool isInitialized = false;
late String client;
+ bool get showClusteringIsHappening => _showClusteringIsHappening;
+
bool debugIndexingDisabled = false;
+ bool _showClusteringIsHappening = false;
bool _mlControllerStatus = false;
bool _isIndexingOrClusteringRunning = false;
bool _shouldPauseIndexingAndClustering = false;
@@ -572,6 +575,8 @@ class FaceMlService {
await PersonService.instance.fetchRemoteClusterFeedback();
try {
+ _showClusteringIsHappening = true;
+
// Get a sense of the total number of faces in the database
final int totalFaces =
await FaceMLDataDB.instance.getTotalFaceCount(minFaceScore: minFaceScore);
@@ -711,6 +716,7 @@ class FaceMlService {
} catch (e, s) {
_logger.severe("`clusterAllImages` failed", e, s);
} finally {
+ _showClusteringIsHappening = false;
_isIndexingOrClusteringRunning = false;
_shouldPauseIndexingAndClustering = false;
}
diff --git a/mobile/lib/ui/settings/machine_learning_settings_page.dart b/mobile/lib/ui/settings/machine_learning_settings_page.dart
index c39d3e6ee9..38685b4ff5 100644
--- a/mobile/lib/ui/settings/machine_learning_settings_page.dart
+++ b/mobile/lib/ui/settings/machine_learning_settings_page.dart
@@ -513,14 +513,18 @@ class FaceRecognitionStatusWidgetState extends State<FaceRecognitionStatusWidget
title: S.of(context).clusteringProgress,
),
trailingWidget: Text(
- "${clusteringPercentage.toStringAsFixed(0)}%",
+ FaceMlService.instance.showClusteringIsHappening
+ ? "currently running"
+ : "${clusteringPercentage.toStringAsFixed(0)}%",
style: Theme.of(context).textTheme.bodySmall,
),
singleBorderRadius: 8,
alignCaptionedTextToLeft: true,
isGestureDetectorDisabled: true,
key: ValueKey(
- "clustering_progress_" + clusteringPercentage.toStringAsFixed(0),
+ FaceMlService.instance.showClusteringIsHappening
+ ? "currently running"
+ : "clustering_progress_" + clusteringPercentage.toStringAsFixed(0),
),
),
],