From cf30b410ab8e7eb502ec710b4b1af23e697060f9 Mon Sep 17 00:00:00 2001 From: Lev Aronsky Date: Thu, 27 Nov 2025 15:44:13 +0200 Subject: [PATCH] Ignore `time_active` for swimming activities without splits When no `split_summary` is provided, treat `lap_swimming` activities active throughout the whole activity (thus, use the same calculation for pace as for other activity types). --- backend/app/fit/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/app/fit/utils.py b/backend/app/fit/utils.py index 02514a757..2bc465b93 100644 --- a/backend/app/fit/utils.py +++ b/backend/app/fit/utils.py @@ -1087,7 +1087,7 @@ def append_if_not_none(waypoint_list, time, value, key): def calculate_pace(distance, total_timer_time, activity_type, split_summary): if distance: - if activity_type != "lap_swimming": + if activity_type != "lap_swimming" or not split_summary: return total_timer_time, total_timer_time / distance time_active = 0 for split in split_summary: