[mob][photos] Use separate isIgnored getter instead of isHidden
This commit is contained in:
@@ -56,6 +56,9 @@ class PersonData {
|
||||
|
||||
bool hasAvatar() => avatarFaceId != null;
|
||||
|
||||
bool get isIgnored =>
|
||||
(name.isEmpty || name == '(hidden)' || name == '(ignored)');
|
||||
|
||||
PersonData({
|
||||
required this.name,
|
||||
this.assigned,
|
||||
|
||||
@@ -294,8 +294,7 @@ class ClusterFeedbackService {
|
||||
}
|
||||
|
||||
Future<void> ignoreCluster(int clusterID) async {
|
||||
await PersonService.instance
|
||||
.addPerson('(ignored)', clusterID, isHidden: true);
|
||||
await PersonService.instance.addPerson('', clusterID);
|
||||
Bus.instance.fire(PeopleChangedEvent());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -787,7 +787,7 @@ class SearchService {
|
||||
continue;
|
||||
}
|
||||
final PersonEntity p = personIdToPerson[personID]!;
|
||||
if (p.data.isHidden) continue;
|
||||
if (p.data.isIgnored) continue;
|
||||
facesResult.add(
|
||||
GenericSearchResult(
|
||||
ResultType.faces,
|
||||
|
||||
@@ -202,7 +202,9 @@ class _FaceWidgetState extends State<FaceWidget> {
|
||||
const SizedBox(height: 8),
|
||||
if (widget.person != null)
|
||||
Text(
|
||||
widget.person!.data.name.trim(),
|
||||
widget.person!.data.isIgnored
|
||||
? '(ignored)'
|
||||
: widget.person!.data.name.trim(),
|
||||
style: Theme.of(context).textTheme.bodySmall,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
maxLines: 1,
|
||||
|
||||
@@ -123,9 +123,9 @@ class _FacesItemWidgetState extends State<FacesItemWidget> {
|
||||
// Make sure hidden faces are last
|
||||
faces.sort((Face a, Face b) {
|
||||
final aIsHidden =
|
||||
persons[faceIdToPersonID[a.faceID]]?.data.isHidden ?? false;
|
||||
persons[faceIdToPersonID[a.faceID]]?.data.isIgnored ?? false;
|
||||
final bIsHidden =
|
||||
persons[faceIdToPersonID[b.faceID]]?.data.isHidden ?? false;
|
||||
persons[faceIdToPersonID[b.faceID]]?.data.isIgnored ?? false;
|
||||
if (aIsHidden && !bIsHidden) {
|
||||
return 1;
|
||||
} else if (!aIsHidden && bIsHidden) {
|
||||
|
||||
@@ -294,7 +294,7 @@ class _PersonActionSheetState extends State<PersonActionSheet> {
|
||||
}) async {
|
||||
final persons = await PersonService.instance.getPersons();
|
||||
if (excludeHidden) {
|
||||
persons.removeWhere((person) => person.data.isHidden);
|
||||
persons.removeWhere((person) => person.data.isIgnored);
|
||||
}
|
||||
return persons;
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ class PeopleAppBar extends StatefulWidget {
|
||||
final SelectedFiles selectedFiles;
|
||||
final PersonEntity person;
|
||||
|
||||
bool get isHidden => person.data.isHidden;
|
||||
bool get isIgnored => person.data.isIgnored;
|
||||
|
||||
const PeopleAppBar(
|
||||
this.type,
|
||||
@@ -143,7 +143,7 @@ class _AppBarWidgetState extends State<PeopleAppBar> {
|
||||
|
||||
final List<PopupMenuItem<PeoplPopupAction>> items = [];
|
||||
|
||||
if (!widget.isHidden) {
|
||||
if (!widget.isIgnored) {
|
||||
items.addAll(
|
||||
[
|
||||
PopupMenuItem(
|
||||
|
||||
Reference in New Issue
Block a user