git-fit 0.24.1 → 0.24.2

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: 91c3d0ac4cecce476fb6ca55ac9d42b2f0cf5159d52f51df9551aa511ce20108
4
- data.tar.gz: b8ea24629e8e92424084edfe441588ad478fdc3388f8763d299c88ddc9a73e2d
3
+ metadata.gz: 03ca873b9ed2085415130819f206c4a374c481be9c4d4437fce418447e2bbe75
4
+ data.tar.gz: 891b392511c8d64435d62568b47ff51d9420e39503a7c05055892a9e83f40771
5
5
  SHA512:
6
- metadata.gz: a86c69332d9dc3474a2f8984e900f8f84be6cce1b6a9f3262a103d9e153407935575e4f32a697906f3947d0e86f947e075abd3961014bab525b0e267bdc2b466
7
- data.tar.gz: c84de3d8dc16989789e2b69c477b5f9500f51e048ac51f4cd4cbe19aefc5944669ed96c3ef192f6ff4bfbd80a31168b33da043472aabd71449150812252bcd24
6
+ metadata.gz: 2b063e4faa22be8c5d25b511caa38d5bf39b7b7f1dad21f6299ed66799ea9b09d8a68709ee758c47ac6c85f8ccd57d70cd58ad80118a51d6ab81784f28e6f012
7
+ data.tar.gz: a25c1d3a2fb1d9f25a5bc24c280c02a8e9217ba81d27b876faaefb4576c3576bfa1a33ee56384b82252b3a74cd42360b3e041627253995b69f2511fbc9e8adcd
@@ -98,7 +98,7 @@ module GitFit
98
98
  data = parse_json(resp)
99
99
  return false unless resp.code.to_i == 200 && data.is_a?(Hash) && data['data'].is_a?(Hash)
100
100
 
101
- write_source_archive(data, pending[:id])
101
+ write_source_archive(data['data'], pending[:id])
102
102
  upsert_from_detail(pending[:id], data['data'])
103
103
  end
104
104
 
@@ -154,7 +154,7 @@ module GitFit
154
154
 
155
155
  def load_raw_activity(id)
156
156
  data = JSON.parse(File.read(raw_path(id)))
157
- detail = data['data']
157
+ detail = data['data'] || data
158
158
  return false unless detail.is_a?(Hash)
159
159
 
160
160
  upsert_from_detail(id, detail)
@@ -165,7 +165,7 @@ module GitFit
165
165
  return false unless attrs
166
166
 
167
167
  points = attrs.delete(:standard_points)
168
- write_std(points, log_id)
168
+ write_std(points, log_id) unless points.empty?
169
169
  upsert_activity(attrs)
170
170
  attrs
171
171
  end
@@ -177,7 +177,6 @@ module GitFit
177
177
  return nil unless start_time && moving_time.positive?
178
178
 
179
179
  points = standard_points(detail['points'])
180
- return nil if points.empty?
181
180
 
182
181
  hr_values = heart_rate_values(detail['heart_rate'])
183
182
  cadence_values = cadence_values(detail)
@@ -210,7 +209,15 @@ module GitFit
210
209
  end
211
210
 
212
211
  def point_attributes(points)
213
- return { summary_polyline: nil } if points.empty?
212
+ if points.empty?
213
+ return {
214
+ summary_polyline: nil,
215
+ elevation_gain: nil,
216
+ elevation_loss: nil,
217
+ elevation_min: nil,
218
+ elevation_max: nil,
219
+ }
220
+ end
214
221
 
215
222
  alts = points.filter_map { |point| numeric(point[:altitude]) }
216
223
  {
@@ -107,7 +107,7 @@ module GitFit
107
107
  raise SyncError, sid_error_message unless sid_valid?(resp, data)
108
108
  return false unless data.is_a?(Hash) && data['runrecord'].is_a?(Hash)
109
109
 
110
- write_source_archive(data, pending[:id])
110
+ write_source_archive(data['runrecord'], pending[:id])
111
111
  upsert_from_detail(data['runrecord'])
112
112
  end
113
113
 
@@ -160,7 +160,7 @@ module GitFit
160
160
 
161
161
  def load_raw_activity(id)
162
162
  data = JSON.parse(File.read(raw_path(id)))
163
- record = data['runrecord']
163
+ record = data['runrecord'] || data
164
164
  return false unless record.is_a?(Hash)
165
165
 
166
166
  upsert_from_detail(record)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GitFit
4
- VERSION = '0.24.1'
4
+ VERSION = '0.24.2'
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.24.1
4
+ version: 0.24.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lax