Embed achievement badges in exercise progress graphs

This commit is contained in:
Peter Stockings
2026-02-06 00:20:12 +11:00
parent 3f3725d277
commit a9f3dd4a38
2 changed files with 14 additions and 1 deletions

8
db.py
View File

@@ -427,6 +427,11 @@ class DataBase():
start_dates = [t['start_date'] for t in topsets]
messages = [f'{t["repetitions"]} x {t["weight"]}kg ({t["estimated_1rm"]}kg E1RM) on {t["start_date"].strftime("%d %b %y")}' for t in topsets]
# Get the latest topset info for badges
latest_topset = topsets[-1]
latest_topset_id = latest_topset['topset_id']
latest_workout_id = latest_topset['workout_id']
exercise_progress = get_exercise_graph_model(
exercise_name,
estimated_1rm,
@@ -440,6 +445,9 @@ class DataBase():
min_date,
max_date,
degree)
exercise_progress['latest_topset_id'] = latest_topset_id
exercise_progress['latest_workout_id'] = latest_workout_id
return exercise_progress