Skip to content

Commit

Permalink
Skip workouts without an id
Browse files Browse the repository at this point in the history
  • Loading branch information
n8henrie committed Mar 13, 2021
1 parent 71e36e1 commit 27b3d54
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions healthkit_to_sqlite/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ def convert_xml_to_sqlite(fp, db, progress_callback=None, zipfile=None):
db["activity_summary"].insert_all(activity_summaries)
activity_summaries = []
elif tag == "Workout":
if "id" not in el:
if "HKExternalUUID" in el:
el["id"] = el["HKExternalUUID"]
else:
print("No id found for record, skipping:")
print(dict(el.items()))
continue
workout_to_db(el, db, zipfile)
elif tag == "Record":
record = dict(el.attrib)
Expand Down

0 comments on commit 27b3d54

Please sign in to comment.