1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-11-27 20:36:51 +01:00

Garmin: Fix gap fill overwriting real samples

This commit is contained in:
José Rebelo 2024-09-22 20:06:47 +01:00
parent 1745c41da8
commit f6d9a87f95

View File

@ -362,7 +362,8 @@ public class FitImporter {
for (final int ts : activitySamplesPerTimestamp.keySet()) {
if (prevTs > 0 && ts - prevTs > 60) {
// Fill gaps between samples
for (int i = prevTs; i < ts; i += 60) {
LOG.debug("Filling gap between {} and {}", prevTs, ts);
for (int i = prevTs + 60; i < ts; i += 60) {
final GarminActivitySample sample = new GarminActivitySample();
sample.setTimestamp(i);
sample.setRawKind(ts - prevTs > THRESHOLD_NOT_WORN ? ActivityKind.NOT_WORN.getCode() : prevActivityKind);