fixed command line to better handle detected but unidentified faces in Photos 5
This commit is contained in:
parent
a7d9f72372
commit
7732708cb2
@ -94,6 +94,15 @@ def info(cli_obj):
|
||||
info["albums"] = albums
|
||||
|
||||
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"] = persons
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user