## Description

## Tests
This commit is contained in:
Laurens Priem 2024-12-20 11:54:55 +01:00 committed by GitHub
commit 8c20f5f660
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 16 additions and 10 deletions

View File

@ -1515,7 +1515,7 @@ class MessageLookup extends MessageLookupByLibrary {
"searchDatesEmptySection": MessageLookupByLibrary.simpleMessage(
"Search by a date, month or year"),
"searchDiscoverEmptySection": MessageLookupByLibrary.simpleMessage(
"Images will be shown here once processing is complete"),
"Images will be shown here once processing and syncing is complete"),
"searchFaceEmptySection": MessageLookupByLibrary.simpleMessage(
"People will be shown here once indexing is done"),
"searchFileTypesAndNamesEmptySection":
@ -1534,7 +1534,7 @@ class MessageLookup extends MessageLookupByLibrary {
"searchPeopleEmptySection": MessageLookupByLibrary.simpleMessage(
"Invite people, and you\'ll see all photos shared by them here"),
"searchPersonsEmptySection": MessageLookupByLibrary.simpleMessage(
"People will be shown here once processing is complete"),
"People will be shown here once processing and syncing is complete"),
"searchResultCount": m62,
"searchSectionsLengthMismatch": m63,
"security": MessageLookupByLibrary.simpleMessage("Security"),

View File

@ -10027,20 +10027,20 @@ class S {
);
}
/// `Images will be shown here once processing is complete`
/// `Images will be shown here once processing and syncing is complete`
String get searchDiscoverEmptySection {
return Intl.message(
'Images will be shown here once processing is complete',
'Images will be shown here once processing and syncing is complete',
name: 'searchDiscoverEmptySection',
desc: '',
args: [],
);
}
/// `People will be shown here once processing is complete`
/// `People will be shown here once processing and syncing is complete`
String get searchPersonsEmptySection {
return Intl.message(
'People will be shown here once processing is complete',
'People will be shown here once processing and syncing is complete',
name: 'searchPersonsEmptySection',
desc: '',
args: [],

View File

@ -1382,8 +1382,8 @@
"onlyThem": "Only them",
"checkingModels": "Checking models...",
"enableMachineLearningBanner": "Enable machine learning for magic search and face recognition",
"searchDiscoverEmptySection": "Images will be shown here once processing is complete",
"searchPersonsEmptySection": "People will be shown here once processing is complete",
"searchDiscoverEmptySection": "Images will be shown here once processing and syncing is complete",
"searchPersonsEmptySection": "People will be shown here once processing and syncing is complete",
"viewersSuccessfullyAdded": "{count, plural, =0 {Added 0 viewer} =1 {Added 1 viewer} other {Added {count} viewers}}",
"@viewersSuccessfullyAdded": {
"placeholders": {
@ -1576,4 +1576,4 @@
"legacyInvite": "{email} has invited you to be a trusted contact",
"authToManageLegacy": "Please authenticate to manage your trusted contacts",
"useDifferentPlayerInfo": "Having trouble playing this video? Long press here to try a different player."
}
}

View File

@ -545,7 +545,7 @@ class ClusterFeedbackService {
final smallestPersonClusterSize = personClusters
.map((clusterID) => allClusterIdsToCountMap[clusterID] ?? 0)
.reduce((value, element) => min(value, element));
final checkSizes = [100, 20, kMinimumClusterSizeSearchResult, 10, 5, 1];
final checkSizes = [20, kMinimumClusterSizeSearchResult, 10, 5, 1];
Map<String, Vector> clusterAvgBigClusters = <String, Vector>{};
final List<(String, double)> suggestionsMean = [];
for (final minimumSize in checkSizes.toSet()) {

View File

@ -92,6 +92,12 @@ class _PeoplePageState extends State<PeoplePage> {
log("loadPersonFiles");
final result = await SearchService.instance
.getClusterFilesForPersonID(widget.person.remoteID);
if (result.isEmpty) {
_logger.severe(
"No files found for person with id ${widget.person.remoteID}, can't load files",
);
return [];
}
smallestClusterSize = result.values.fold<int>(result.values.first.length,
(previousValue, element) {
return element.length < previousValue ? element.length : previousValue;