forked from upstream-mirrors/OpenTracks
Aggregate statistics are now computed in the database.
This commit is contained in:
@@ -19,6 +19,8 @@ public record Distance(double distance_m) {
|
||||
return Distance.of((double) distance_m);
|
||||
}
|
||||
}
|
||||
|
||||
@Deprecated //TODO Remove
|
||||
public static Distance of(String distance_m) {
|
||||
return of(Float.parseFloat(distance_m));
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ public record Speed(double speed_mps) {
|
||||
return new Speed(speed_mps);
|
||||
}
|
||||
|
||||
@Deprecated //TODO Remove
|
||||
public static Speed of(String speed_mps) {
|
||||
return of(Float.parseFloat(speed_mps));
|
||||
}
|
||||
|
||||
@@ -35,9 +35,6 @@ public record Statistics(
|
||||
}
|
||||
|
||||
public Speed getAverageSpeed() {
|
||||
if (totalTime.isZero()) {
|
||||
return Speed.ZERO;
|
||||
}
|
||||
return Speed.of(totalDistance, totalTime);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user