Skip to content

Commit

Permalink
ISSUE-163: Fix bug introduced in v0.3.7 where average heart rate of 0…
Browse files Browse the repository at this point in the history
… was considered NULL
  • Loading branch information
robiningelbrecht committed Jan 15, 2025
1 parent 1e414c6 commit 3c6bfc2
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,9 @@ private function hydrate(array $result): ActivityDetails
maxPower: ((int) $result['maxWatts']) ?: null,
averageSpeed: KmPerHour::from($result['averageSpeed'] * 3.6),
maxSpeed: KmPerHour::from($result['maxSpeed'] * 3.6),
averageHeartRate: !empty($result['averageHeartRate']) ? (int) round($result['averageHeartRate']) : null,
maxHeartRate: !empty($result['maxHeartRate']) ? (int) round($result['maxHeartRate']) : null,
averageCadence: !empty($result['averageCadence']) ? (int) round($result['averageCadence']) : null,
averageHeartRate: isset($result['averageHeartRate']) ? (int) round($result['averageHeartRate']) : null,
maxHeartRate: isset($result['maxHeartRate']) ? (int) round($result['maxHeartRate']) : null,
averageCadence: isset($result['averageCadence']) ? (int) round($result['averageCadence']) : null,
movingTimeInSeconds: $result['movingTimeInSeconds'] ?: 0,
kudoCount: $result['kudoCount'] ?: 0,
totalImageCount: $result['totalPhotoCount'] ?: 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@

final readonly class BuildHtmlVersionCommandHandler implements CommandHandler
{
private const string APP_VERSION = 'v0.3.8';
private const string APP_VERSION = 'v0.3.9';

public function __construct(
private ActivityDetailsRepository $activityRepository,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,8 @@
</a>
</div>
<div class="flex justify-center gap-x-1 text-xs text-center text-gray-500">
<span>v0.3.8</span>
<span class="hidden" data-latest-version data-current-version="v0.3.8">
<span>v0.3.9</span>
<span class="hidden" data-latest-version data-current-version="v0.3.9">
(latest: <a class="underline" href="https://github.com/robiningelbrecht/strava-statistics/releases/tag/%5BLATEST_VERSION%5D">[LATEST_VERSION]</a>)
</span>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,8 @@
</a>
</div>
<div class="flex justify-center gap-x-1 text-xs text-center text-gray-500">
<span>v0.3.8</span>
<span class="hidden" data-latest-version data-current-version="v0.3.8">
<span>v0.3.9</span>
<span class="hidden" data-latest-version data-current-version="v0.3.9">
(latest: <a class="underline" href="https://github.com/robiningelbrecht/strava-statistics/releases/tag/%5BLATEST_VERSION%5D">[LATEST_VERSION]</a>)
</span>
</div>
Expand Down
Binary file modified tests/strava.db
Binary file not shown.

0 comments on commit 3c6bfc2

Please sign in to comment.