From 32389738ffcd61f7987306886edb311bab70dcbf Mon Sep 17 00:00:00 2001 From: Peter Stockings Date: Sat, 19 Nov 2022 20:36:29 +1100 Subject: [PATCH] Show list of workouts in descending order --- utils.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/utils.py b/utils.py index 01b2943..108b46f 100644 --- a/utils.py +++ b/utils.py @@ -4,12 +4,12 @@ import json def get_workouts(topsets): # Get all unique workout_ids (No duplicates) - workout_ids = set([t['WorkoutId'] - for t in topsets if t['WorkoutId'] is not None]) + workout_ids = list(set([t['WorkoutId'] + for t in topsets if t['WorkoutId'] is not None])) # Group topsets into workouts workouts = [] - for workout_id in workout_ids: + for workout_id in reversed(workout_ids): topsets_in_workout = [ t for t in topsets if t['WorkoutId'] == workout_id] workouts.append({