π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Small improvements to file info face editor
laurenspriem83bf37c8bb96
diff --git a/mobile/lib/services/machine_learning/face_ml/feedback/cluster_feedback.dart b/mobile/lib/services/machine_learning/face_ml/feedback/cluster_feedback.dartindex d7bc9b6f95..791d419bb9 100644--- a/mobile/lib/services/machine_learning/face_ml/feedback/cluster_feedback.dart+++ b/mobile/lib/services/machine_learning/face_ml/feedback/cluster_feedback.dart@@ -201,27 +201,27 @@ class ClusterFeedbackService<T> {Future<String> removeFaceFromPerson(String faceID,- PersonEntity p,+ PersonEntity person,) async {_logger.info('removeFaceFromPerson called');try {- final newCluster = newClusterID();- final newFaceIdToClusterID = {faceID: newCluster};+ final updatedClusterID = newClusterID();+ final newFaceIdToClusterID = {faceID: updatedClusterID};await mlDataDB.forceUpdateClusterIds(newFaceIdToClusterID);// Make sure the deleted faces don't get suggested in the future- final notClusterIdToPersonId = {newCluster: p.remoteID};+ final notClusterIdToPersonId = {updatedClusterID: person.remoteID};await mlDataDB.bulkCaptureNotPersonFeedback(notClusterIdToPersonId);// Update remote so new sync does not undo this changeawait PersonService.instance- .removeFacesFromPerson(person: p, faceIDs: {faceID});+ .removeFacesFromPerson(person: person, faceIDs: {faceID});Bus.instance.fire(PeopleChangedEvent(type: PeopleEventType.removedFaceFromCluster),);_logger.info('removeFaceFromPerson done');- return newCluster;+ return updatedClusterID;} catch (e, s) {_logger.severe("Error in removeFaceFromPerson", e, s);rethrow;@@ -288,22 +288,22 @@ class ClusterFeedbackService<T> {Future<String> removeFaceFromCluster({required String faceID,- required String clusterID,+ String? clusterID,}) async {_logger.info('removeFaceFromCluster called');try {- final newCluster = newClusterID();- final newFaceIdToClusterID = {faceID: newCluster};+ final updatedClusterID = newClusterID();+ final newFaceIdToClusterID = {faceID: updatedClusterID};await mlDataDB.forceUpdateClusterIds(newFaceIdToClusterID);Bus.instance.fire(PeopleChangedEvent(type: PeopleEventType.removedFaceFromCluster,- source: clusterID,+ source: clusterID ?? "",),);_logger.info('removeFaceFromCluster done, with $newFaceIdToClusterID');- return newCluster;+ return updatedClusterID;} catch (e, s) {_logger.severe("Error in removeFaceFromCluster", e, s);rethrow;diff --git a/mobile/lib/ui/viewer/file_details/file_info_face_widget.dart b/mobile/lib/ui/viewer/file_details/file_info_face_widget.dartindex f96fc47325..1fe7864b13 100644--- a/mobile/lib/ui/viewer/file_details/file_info_face_widget.dart+++ b/mobile/lib/ui/viewer/file_details/file_info_face_widget.dart@@ -212,18 +212,11 @@ class _FileInfoFaceWidgetState extends State<FileInfoFaceWidget> {Future<void> _onPlusIconTap() async {try {- String? newClusterIDValue;- if (widget.clusterID != null) {- newClusterIDValue =- await ClusterFeedbackService.instance.removeFaceFromCluster(- faceID: widget.face.faceID,- clusterID: widget.clusterID!,- );- }- newClusterIDValue ??= newClusterID();- final mlDataDB = MLDataDB.instance;- await mlDataDB- .updateFaceIdToClusterId({widget.face.faceID: newClusterIDValue});+ final newClusterIDValue =+ await ClusterFeedbackService.instance.removeFaceFromCluster(+ faceID: widget.face.faceID,+ clusterID: widget.clusterID,+ );await Navigator.of(context).push(MaterialPageRoute(builder: (context) => SaveOrEditPerson(newClusterIDValue),@@ -240,7 +233,7 @@ class _FileInfoFaceWidgetState extends State<FileInfoFaceWidget> {final result = await showChoiceActionSheet(context,title: S.of(context).removePersonLabel,- body: "Are you sure you want to remove this person from this photo?",+ body: "Are you sure you want to remove this face from this person?",firstButtonLabel: S.of(context).remove,firstButtonType: ButtonType.critical,secondButtonLabel: S.of(context).cancel,