Skip to content

armgit / ente

Public Imported from GitHub
0

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

Clarify hidden vs ignored flag

laurensprieme1d3e2dac4b3
diff --git a/mobile/apps/photos/lib/models/ml/face/person.dart b/mobile/apps/photos/lib/models/ml/face/person.dart
index f373c89303..d2390a0bb6 100644
--- a/mobile/apps/photos/lib/models/ml/face/person.dart
+++ b/mobile/apps/photos/lib/models/ml/face/person.dart
@@ -48,7 +48,11 @@ class ClusterInfo {
class PersonData {
final String name;
+
+ /// Used to mark a person to not show in the people section.
+ /// WARNING: When checking whether to show a person, use [isIgnored] instead, as it also checks legacy hidden names.
final bool isHidden;
+
String? avatarFaceID;
List<ClusterInfo> assigned = List<ClusterInfo>.empty();
List<String> rejectedFaceIDs = List<String>.empty();
@@ -63,8 +67,10 @@ class PersonData {
bool hasAvatar() => avatarFaceID != null;
+ /// Returns true if the person should be ignored in the UI.
+ /// This included the regular [isHidden] check, but also a check for legacy names
bool get isIgnored =>
- (name.isEmpty || name == '(hidden)' || name == '(ignored)');
+ (isHidden || name.isEmpty || name == '(hidden)' || name == '(ignored)');
PersonData({
required this.name,
diff --git a/mobile/apps/photos/lib/services/smart_memories_service.dart b/mobile/apps/photos/lib/services/smart_memories_service.dart
index 1da43ff1fd..ce20f14cd2 100644
--- a/mobile/apps/photos/lib/services/smart_memories_service.dart
+++ b/mobile/apps/photos/lib/services/smart_memories_service.dart
@@ -418,7 +418,7 @@ class SmartMemoriesService {
}
}
final List<String> orderedImportantPersonsID = persons
- .where((person) => !person.data.isHidden && !person.data.isIgnored)
+ .where((person) => !person.data.isIgnored)
.map((p) => p.remoteID)
.toList();
orderedImportantPersonsID.shuffle(Random());
diff --git a/mobile/apps/photos/lib/ui/viewer/people/person_selection_action_widgets.dart b/mobile/apps/photos/lib/ui/viewer/people/person_selection_action_widgets.dart
index e22a7696cb..be9e8db787 100644
--- a/mobile/apps/photos/lib/ui/viewer/people/person_selection_action_widgets.dart
+++ b/mobile/apps/photos/lib/ui/viewer/people/person_selection_action_widgets.dart
@@ -45,7 +45,7 @@ class _LinkContactToPersonSelectionPageState
final List<PersonEntity> result = [];
for (final person in persons) {
if ((person.data.email != null && person.data.email!.isNotEmpty) ||
- (person.data.isHidden || person.data.isIgnored)) {
+ (person.data.isIgnored)) {
continue;
}
result.add(person);
@@ -217,7 +217,7 @@ class _ReassignMeSelectionPageState extends State<ReassignMeSelectionPage> {
final List<PersonEntity> result = [];
for (final person in persons) {
if ((person.data.email != null && person.data.email!.isNotEmpty) ||
- (person.data.isHidden || person.data.isIgnored)) {
+ (person.data.isIgnored)) {
continue;
}
result.add(person);