fixed command line to better handle detected but unidentified faces in Photos 5

This commit is contained in:
Rhet Turnbull 2019-11-23 19:24:20 -08:00
parent a7d9f72372
commit 7732708cb2

View File

@ -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