git-fit 0.17.6 → 0.17.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5015658feae71e9b2834dcabede734c6fd18ce3eb107574a88849a103b252cd0
4
- data.tar.gz: 7d89ca6992b25f8d6319c1c0fbbe4afb23f32fb1ef8b9b56d8f705655c6924c0
3
+ metadata.gz: 63105e40b78dfc16931efa9ffe2b88e9ac53b576f2ce14857401d818d6375c5a
4
+ data.tar.gz: 792778796644fd2117a9e57b1cb330b2a337ac02010f4297e170639f64b9fa4b
5
5
  SHA512:
6
- metadata.gz: 9cb00b5a74e1acdbd21d654e2d49efc1239f7456d986897da130f528743f168a8646b048f87f4c8888b586b0fcb18c99148aff8ecf0932163730883211ec408e
7
- data.tar.gz: 0c29a0c7771f4207105f391e17b1880ded4ef418c373bcbee7238e44f4658ae09f15d4d691d9eabc5175132e33bb3e36445e5548d281eb6c819907e30ba84d2e
6
+ metadata.gz: e6787fb194f869eb5dd48226b617e2d9757cbfb9ee6cfc657018f9e0f868f3018bb66b3a63718ef9d919836298ce0f3e612504bf77fc033a2286dcaaf7c9dd35
7
+ data.tar.gz: 1ef52c06c6a9ff330e7e22dd0bb89152bcbeeb861b430a04ffa1841e8e0280ff6e859e2b12007090784e0e692be2fa0b6a6488b1eae825ca44130a3de2d87a5b
@@ -86,7 +86,7 @@ module GitFit
86
86
 
87
87
  # ── Raw directory layout (Phase 1, mirrors garmin Phase 1) ──────────
88
88
  # data/raw/xingzhe/{id}/stream.json — stream envelope
89
- # data/raw/xingzhe/{id}/detail.json — full detail response (workout+user+...)
89
+ # data/raw/xingzhe/{id}/detail.json — detail payload — inner data:{workout,user,slopes,segments,pois,laps}
90
90
  # data/raw/xingzhe/{id}/{id}.gpx — GPX export (when available)
91
91
  # data/raw/xingzhe/{id}/{id}.fit — FIT export (when is_fit)
92
92
  def raw_path(platform_id)
@@ -307,7 +307,7 @@ module GitFit
307
307
  if fetched_full
308
308
  full_detail = fetched_full
309
309
  detail_workout = fetched_workout
310
- # Persist full detail response (code/data/msg) as detail.json
310
+ # Persist detail payload (data:{workout,user,slopes,segments,pois,laps}) as detail.json
311
311
  write_raw_file(full_detail, 'detail.json', aid)
312
312
  # Prefer workout from full_detail for attrs that benefit from richer data
313
313
  if detail_workout
@@ -409,7 +409,7 @@ module GitFit
409
409
  end
410
410
 
411
411
  def fetch_activity_detail(id)
412
- resp = http_request(:get, "#{DETAIL_PATH}#{id}/")
412
+ resp = authed_get("#{DETAIL_PATH}#{id}/")
413
413
  return nil unless resp.code.to_i == 200
414
414
 
415
415
  data = JSON.parse(resp.body)
@@ -418,15 +418,16 @@ module GitFit
418
418
 
419
419
  # Full detail with segments/slopes/pois/laps — returns [full_json, workout_hash]
420
420
  def fetch_full_detail(id)
421
- resp = http_request(:get, "#{DETAIL_PATH}#{id}/",
421
+ resp = authed_get("#{DETAIL_PATH}#{id}/",
422
422
  params: { segments: 'true', slopes: 'true', pois: 'true', laps: 'true' })
423
423
  return [nil, nil] unless resp.code.to_i == 200
424
424
 
425
425
  data = JSON.parse(resp.body)
426
426
  return [nil, nil] unless data['code'] == 200 || data.dig('data', 'workout')
427
427
 
428
- workout = data.dig('data', 'workout')
429
- [data, workout]
428
+ inner = data['data']
429
+ workout = inner&.dig('workout')
430
+ [inner, workout]
430
431
  rescue JSON::ParserError
431
432
  [nil, nil]
432
433
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GitFit
4
- VERSION = '0.17.6'
4
+ VERSION = '0.17.8'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git-fit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.17.6
4
+ version: 0.17.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lax