mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-13 16:18:42 +00:00
Strava : Correct commit for indoor lap.
Keep last lap seconds
This commit is contained in:
@@ -835,16 +835,17 @@ Strava::prepareResponse(QByteArray* data)
|
||||
if (!each["laps"].isNull()) {
|
||||
QJsonArray laps = each["laps"].toArray();
|
||||
|
||||
int last_lap = 0;
|
||||
double last_lap = 0.0;
|
||||
foreach (QJsonValue value, laps) {
|
||||
QJsonObject lap = value.toObject();
|
||||
|
||||
int lap_start = lap["start_index"].toInt();
|
||||
if (lap_start == 0)
|
||||
lap_start = last_lap;
|
||||
int lap_start = lap["start_index"].toInt();
|
||||
|
||||
double start = ride->getPoint(lap_start, RideFile::secs).toDouble();
|
||||
if (last_lap == 0)
|
||||
last_lap = start;
|
||||
double end = start + lap["elapsed_time"].toDouble();
|
||||
|
||||
last_lap = end;
|
||||
|
||||
ride->addInterval(RideFileInterval::USER, start, end, lap["name"].toString());
|
||||
|
||||
Reference in New Issue
Block a user