From d7b93325d4f70eeab369fa8a3c4cce9f0c4e0081 Mon Sep 17 00:00:00 2001 From: Martin Kagamino Lehoux Date: Thu, 27 Aug 2026 19:03:34 +0200 Subject: Add dual GPX/FIT exporter and backfill for rides Phase 1 writes both .gpx and .fit on Strava import, adds fit_path column, renames storage.gpx_dir to storage.rides_dir, and backfills missing FIT files from existing GPX without breaking CLI progress. FIT files are gitignored. --- web/server_test.go | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'web/server_test.go') diff --git a/web/server_test.go b/web/server_test.go index 7137031..e9444c7 100644 --- a/web/server_test.go +++ b/web/server_test.go @@ -53,6 +53,7 @@ type fakeSyncClient struct { type fakeSyncResult struct { activity strava.Activity data []byte + fitData []byte err error } @@ -60,12 +61,16 @@ func (c fakeSyncClient) List(time.Time, time.Time) ([]strava.Activity, error) { return c.activities, nil } -func (c fakeSyncClient) Get(id int64) (strava.Activity, []byte, error) { +func (c fakeSyncClient) Get(id int64) (strava.Activity, []byte, []byte, error) { result, ok := c.results[id] if !ok { - return strava.Activity{}, nil, fmt.Errorf("missing fake activity %d", id) + return strava.Activity{}, nil, nil, fmt.Errorf("missing fake activity %d", id) } - return result.activity, result.data, result.err + fitData := result.fitData + if fitData == nil && result.data != nil { + fitData = result.data + } + return result.activity, result.data, fitData, result.err } const emptyTrackGPX = `` @@ -684,7 +689,7 @@ func (c countingSyncClient) List(from, to time.Time) ([]strava.Activity, error) return c.inner.List(from, to) } -func (c countingSyncClient) Get(id int64) (strava.Activity, []byte, error) { +func (c countingSyncClient) Get(id int64) (strava.Activity, []byte, []byte, error) { *c.getCalled = true return c.inner.Get(id) } -- cgit v1.3