mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-13 08:08:42 +00:00
bug fix: manual ride time always counts towards weekly summary
Before, if distance and speed were both zero, time_riding was set to zero, and the manual ride time would not be included in the weekly summary. This patch fixes that by overriding time_riding.
This commit is contained in:
@@ -66,6 +66,10 @@ class TimeRiding : public RideMetric {
|
||||
secsMovingOrPedaling += ride->recIntSecs();
|
||||
}
|
||||
}
|
||||
void override(const QMap<QString,QString> &map) {
|
||||
if (map.contains("value"))
|
||||
secsMovingOrPedaling = map.value("value").toDouble();
|
||||
}
|
||||
bool canAggregate() const { return true; }
|
||||
void aggregateWith(const RideMetric &other) {
|
||||
secsMovingOrPedaling += other.value(true);
|
||||
|
||||
@@ -114,6 +114,9 @@ RideFile *ManualFileReader::openRideFile(QFile &file, QStringList &errors) const
|
||||
QMap<QString,QString> bsm;
|
||||
bsm.insert("value", QString("%1").arg(bs));
|
||||
rideFile->metricOverrides.insert("skiba_bike_score", bsm);
|
||||
QMap<QString,QString> trm;
|
||||
trm.insert("value", QString("%1").arg(minutes * 60.0));
|
||||
rideFile->metricOverrides.insert("time_riding", trm);
|
||||
|
||||
rideSec = minutes * 60.0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user