Skip to content

Commit

Permalink
Merge pull request #356 from labcif/main
Browse files Browse the repository at this point in the history
Fix database bug and polyline bug
  • Loading branch information
abrignoni authored Mar 27, 2023
2 parents a173e5a + 67ec04c commit b9f4d83
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 12 deletions.
10 changes: 8 additions & 2 deletions scripts/artifacts/AdidasActivities.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

def get_adidas_activities(files_found, report_folder, seeker, wrap_text):
logfunc("Processing data for Adidas Activities")
files_found = [x for x in files_found if not x.endswith('wal') and not x.endswith('shm')]
files_found = [x for x in files_found if not x.endswith('-journal')]
file_found = str(files_found[0])
db = open_sqlite_db_readonly(file_found)

Expand Down Expand Up @@ -67,7 +67,13 @@ def get_adidas_activities(files_found, report_folder, seeker, wrap_text):
humidity = 'N/A'
poly = row[15]
if poly:
coordinates = polyline.decode(poly)
# logfunc(f"Polyline: {poly}")
try:
coordinates = polyline.decode(poly)
except:
logfunc(f"Polyline: {poly} could not be decoded")
poly = None
break
place_lat = []
place_lon = []
for coordinate in coordinates:
Expand Down
3 changes: 2 additions & 1 deletion scripts/artifacts/AdidasUser.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@


def get_adidas_user(files_found, report_folder, seeker, wrap_text):
logfunc("Processing data for Garmin Sync")
logfunc("Processing data for Adidas User")
files_found = [x for x in files_found if not x.endswith('-journal')]
file_found = str(files_found[0])
db = open_sqlite_db_readonly(file_found)

Expand Down
2 changes: 1 addition & 1 deletion scripts/artifacts/MMWUsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

def get_map_users(files_found, report_folder, seeker, wrap_text):
logfunc("Processing data for Map My Walk Users")
files_found = [x for x in files_found if not x.endswith('wal') and not x.endswith('shm')]
files_found = [x for x in files_found if not x.endswith('-journal') and not x.endswith('_gear') and not x.endswith('_gear-journal')]
file_found = str(files_found[0])
db = open_sqlite_db_readonly(file_found)

Expand Down
4 changes: 2 additions & 2 deletions scripts/artifacts/NikeAMoments.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ def get_nike_activMoments(files_found, report_folder, seeker, wrap_text):
usageentries = len(all_rows)
if usageentries > 0:
logfunc(f"Found {usageentries} Nike Activities")
report = ArtifactHtmlReport('Activity Moments')
report.start_artifact_report(report_folder, 'Activity Moments')
report = ArtifactHtmlReport('Nike - Activity Moments')
report.start_artifact_report(report_folder, 'Nike - Activity Moments')
report.add_script()
data_headers = ('Activity ID', 'Start Time UTC', 'End Time UTC', 'Duration', 'Timeline')
data_list = []
Expand Down
4 changes: 2 additions & 2 deletions scripts/artifacts/NikeActivities.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ def get_nike_activities(files_found, report_folder, seeker, wrap_text):
usageentries = len(all_rows)
if usageentries > 0:
logfunc(f"Found {usageentries} Nike Activities")
report = ArtifactHtmlReport('Activities')
report.start_artifact_report(report_folder, 'Activities')
report = ArtifactHtmlReport('Nike - Activities')
report.start_artifact_report(report_folder, 'Nike - Activities')
report.add_script()
data_headers = ('Activity ID', 'Name', 'Start Time UTC', 'End Time UTC', 'Location', 'Source', 'Version', 'Temperature', 'Weather', 'Duration', 'Calories', 'Max Speed', 'Mean Speed', 'Steps', 'Distance', 'Pace', 'Cadence')
data_list = []
Expand Down
3 changes: 2 additions & 1 deletion scripts/artifacts/NikeNotifications.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@


def get_nike_notifications(files_found, report_folder, seeker, wrap_text):
logfunc("Processing data for Garmin Notifications")
logfunc("Processing data for Nike Notifications")
files_found = [x for x in files_found if not x.endswith('-journal')]
file_found = str(files_found[0])
db = open_sqlite_db_readonly(file_found)

Expand Down
4 changes: 2 additions & 2 deletions scripts/artifacts/NikePolyline.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ def get_nike_polyline(files_found, report_folder, seeker, wrap_text):
usageentries = len(all_rows)
if usageentries > 0:
logfunc(f'Found {usageentries} activity_polyline entries')
report = ArtifactHtmlReport('Activity Route')
report.start_artifact_report(report_folder, 'Activity Route')
report = ArtifactHtmlReport('Nike - Activity Route')
report.start_artifact_report(report_folder, 'Nike - Activity Route')
report.add_script()
data_headers = ('Activity ID', 'Start Time UTC', 'End Time UTC', 'Duration', 'Coordinates File', 'Button')
data_list = []
Expand Down
2 changes: 1 addition & 1 deletion scripts/artifacts/RunkeeperActivities.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

def get_run_activities(files_found, report_folder, seeker, wrap_text):
logfunc("Processing data for Runkeeper Activities")
files_found = [x for x in files_found if not x.endswith('wal') and not x.endswith('shm')]
files_found = [x for x in files_found if not x.endswith('-journal')]
file_found = str(files_found[0])
db = open_sqlite_db_readonly(file_found)

Expand Down

0 comments on commit b9f4d83

Please sign in to comment.