Private
Public Access
1
0

fixed repeatUntilStepsCmplt

This commit is contained in:
2025-04-14 20:55:45 +02:00
parent 8175e8f954
commit ec4822be39
3 changed files with 15 additions and 0 deletions

View File

@@ -1067,6 +1067,14 @@ def get_workouts_session(r, ps):
return ws
def strcapitalize(s):
if s is None:
return None
if isinstance(s, str):
return s[0].upper() + s[1:]
return s
def correct_intensity(workout):
# reads the steps and if the intensity is an integer, converts it to a string
steps = workout['steps']
@@ -1074,6 +1082,9 @@ def correct_intensity(workout):
if 'intensity' in step:
if isinstance(step['intensity'], int):
step['intensity'] = intensitymap[step['intensity']]
step['durationType'] = strcapitalize(step['durationType'])
step['targetType'] = strcapitalize(step['targetType'])
step['intensity'] = strcapitalize(step['intensity'])
return workout