[mob]Improve handling of multiple assignment of same faceID to different clusters
This commit is contained in:
@@ -170,7 +170,13 @@ class PersonService {
|
||||
faceCount += cluster.faces.length;
|
||||
for (var faceId in cluster.faces) {
|
||||
if (faceIdToClusterID.containsKey(faceId)) {
|
||||
throw Exception("Face $faceId is already assigned to a cluster");
|
||||
final otherPersonID = clusterToPersonID[faceIdToClusterID[faceId]!];
|
||||
if (otherPersonID != e.id) {
|
||||
final otherPerson = await getPerson(otherPersonID!);
|
||||
throw Exception(
|
||||
"Face $faceId is already assigned to person $otherPersonID (${otherPerson!.data.name}) and person ${e.id} (${personData.name})",
|
||||
);
|
||||
}
|
||||
}
|
||||
faceIdToClusterID[faceId] = cluster.id;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user