[mob] Fetch remote entities before running clustering
This commit is contained in:
parent
7c6001321f
commit
bb3a37adf5
2 changed files with 11 additions and 5 deletions
|
@ -85,6 +85,7 @@ class PersonService {
|
|||
}
|
||||
|
||||
Future<void> storeRemoteFeedback() async {
|
||||
await entityService.syncEntities();
|
||||
final entities = await entityService.getEntities(EntityType.person);
|
||||
entities.sort((a, b) => a.updatedAt.compareTo(b.updatedAt));
|
||||
final Map<String, int> faceIdToClusterID = {};
|
||||
|
|
|
@ -161,11 +161,16 @@ class _FaceDebugSectionWidgetState extends State<FaceDebugSectionWidget> {
|
|||
trailingIcon: Icons.chevron_right_outlined,
|
||||
trailingIconIsMuted: true,
|
||||
onTap: () async {
|
||||
await PersonService.instance.storeRemoteFeedback();
|
||||
await FaceMlService.instance
|
||||
.clusterAllImages(clusterInBuckets: true);
|
||||
Bus.instance.fire(PeopleChangedEvent());
|
||||
showShortToast(context, "Done");
|
||||
try {
|
||||
await PersonService.instance.storeRemoteFeedback();
|
||||
await FaceMlService.instance
|
||||
.clusterAllImages(clusterInBuckets: true);
|
||||
Bus.instance.fire(PeopleChangedEvent());
|
||||
showShortToast(context, "Done");
|
||||
} catch (e, s) {
|
||||
_logger.warning('clustering failed ', e, s);
|
||||
await showGenericErrorDialog(context: context, error: e);
|
||||
}
|
||||
},
|
||||
),
|
||||
sectionOptionSpacing,
|
||||
|
|
Loading…
Add table
Reference in a new issue