Ensure merge_exif_keywords are str not int

This commit is contained in:
Rhet Turnbull
2021-01-08 06:23:17 -08:00
parent 193f26bec8
commit 123ebb2cb7

View File

@@ -776,7 +776,12 @@ def export2(
photo = [p for p in bursts if p.uuid.startswith(self.uuid)] photo = [p for p in bursts if p.uuid.startswith(self.uuid)]
photo = photo[0] if photo else None photo = photo[0] if photo else None
if not photo: if not photo:
all_results.error.append((str(dest), f"PhotoKitFetchFailed exception exporting photo {self.uuid}: {e}")) all_results.error.append(
(
str(dest),
f"PhotoKitFetchFailed exception exporting photo {self.uuid}: {e}",
)
)
if photo: if photo:
try: try:
exported = photo.export( exported = photo.export(
@@ -1539,6 +1544,7 @@ def _get_exif_keywords(self):
kw = exifdict[field] kw = exifdict[field]
if kw and type(kw) != list: if kw and type(kw) != list:
kw = [kw] kw = [kw]
kw = [str(k) for k in kw]
keywords.extend(kw) keywords.extend(kw)
except KeyError: except KeyError:
pass pass
@@ -1555,6 +1561,7 @@ def _get_exif_persons(self):
p = exifdict["XMP:PersonInImage"] p = exifdict["XMP:PersonInImage"]
if p and type(p) != list: if p and type(p) != list:
p = [p] p = [p]
p = [str(p_) for p_ in p]
persons.extend(p) persons.extend(p)
except KeyError: except KeyError:
pass pass