fixed command line to better handle detected but unidentified faces in Photos 5
This commit is contained in:
@@ -94,6 +94,15 @@ def info(cli_obj):
|
|||||||
info["albums"] = albums
|
info["albums"] = albums
|
||||||
|
|
||||||
persons = pdb.persons_as_dict()
|
persons = pdb.persons_as_dict()
|
||||||
|
# handle empty person names (added by Photos 5.0+ when face detected but not identified)
|
||||||
|
noperson = "UNKNOWN"
|
||||||
|
if "" in persons:
|
||||||
|
if noperson in persons:
|
||||||
|
persons[noperson].append(persons[""])
|
||||||
|
else:
|
||||||
|
persons[noperson] = persons[""]
|
||||||
|
persons.pop("", None)
|
||||||
|
|
||||||
info["persons_count"] = len(persons)
|
info["persons_count"] = len(persons)
|
||||||
info["persons"] = persons
|
info["persons"] = persons
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user