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 +4 -4
- data/lib/git_fit/sync/codoon.rb +12 -5
- data/lib/git_fit/sync/joyrun.rb +2 -2
- data/lib/git_fit/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 03ca873b9ed2085415130819f206c4a374c481be9c4d4437fce418447e2bbe75
|
|
4
|
+
data.tar.gz: 891b392511c8d64435d62568b47ff51d9420e39503a7c05055892a9e83f40771
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2b063e4faa22be8c5d25b511caa38d5bf39b7b7f1dad21f6299ed66799ea9b09d8a68709ee758c47ac6c85f8ccd57d70cd58ad80118a51d6ab81784f28e6f012
|
|
7
|
+
data.tar.gz: a25c1d3a2fb1d9f25a5bc24c280c02a8e9217ba81d27b876faaefb4576c3576bfa1a33ee56384b82252b3a74cd42360b3e041627253995b69f2511fbc9e8adcd
|
data/lib/git_fit/sync/codoon.rb
CHANGED
|
@@ -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
|
-
|
|
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
|
{
|
data/lib/git_fit/sync/joyrun.rb
CHANGED
|
@@ -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)
|
data/lib/git_fit/version.rb
CHANGED