Add Race workout kind with Garmin eventType auto-detection, sync-time running filter, and pill-based review queue filter
Race is the 8th fixed workout kind, seeded with a real (not placeholder) rule since Garmin Connect's eventType.typeKey reports "race" for manually-tagged race activities. Non-running activity types (padel, cycling, strength training, ...) are now dropped at sync time instead of being stored. The Review Queue's type filter is now clickable exclusive pill buttons instead of a dropdown.
This commit is contained in:
@@ -208,6 +208,15 @@ func (s *Service) fetchAndStoreWindow(ctx context.Context, startDate, endDate st
|
||||
return 0, fmt.Errorf("get_activities(%s, %s): %w", startDate, endDate, err)
|
||||
}
|
||||
for _, a := range activities {
|
||||
// Only running activities are of interest here; other sports (padel,
|
||||
// cycling, strength training, ...) also come back from
|
||||
// get_activities() but are dropped rather than stored. len(activities)
|
||||
// below stays the unfiltered count, since it drives the backfill
|
||||
// watermark's "reached start of history" check -- a page containing
|
||||
// only non-running activities must not look like an empty page.
|
||||
if !isRunningActivityType(a.ActivityType.TypeKey) {
|
||||
continue
|
||||
}
|
||||
if _, err := s.db.UpsertActivity(ctx, toActivityRow(a)); err != nil {
|
||||
return 0, fmt.Errorf("store activity %d: %w", a.ActivityID, err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user