Show exercise count in stats
This commit is contained in:
5
utils.py
5
utils.py
@@ -124,11 +124,14 @@ def get_stats_from_topsets(topsets):
|
|||||||
for t in topsets if t['WorkoutId'] is not None]))
|
for t in topsets if t['WorkoutId'] is not None]))
|
||||||
people_count = len(set([t['PersonId']
|
people_count = len(set([t['PersonId']
|
||||||
for t in topsets if t['PersonId'] is not None]))
|
for t in topsets if t['PersonId'] is not None]))
|
||||||
|
exercise_count = len(set([t['ExerciseId']
|
||||||
|
for t in topsets if t['ExerciseId'] is not None]))
|
||||||
workout_start_dates = [t['StartDate']
|
workout_start_dates = [t['StartDate']
|
||||||
for t in topsets if t['StartDate'] is not None]
|
for t in topsets if t['StartDate'] is not None]
|
||||||
|
|
||||||
stats = [{"Text": "Total Workouts", "Value": workout_count},
|
stats = [{"Text": "Total Workouts", "Value": workout_count},
|
||||||
{"Text": "Total Sets", "Value": len(topsets)}]
|
{"Text": "Total Sets", "Value": len(topsets)},
|
||||||
|
{"Text": "Total Exercises", "Value": exercise_count}]
|
||||||
if people_count > 1:
|
if people_count > 1:
|
||||||
stats.append({"Text": "People tracked", "Value": people_count})
|
stats.append({"Text": "People tracked", "Value": people_count})
|
||||||
if workout_count > 0:
|
if workout_count > 0:
|
||||||
|
|||||||
Reference in New Issue
Block a user