Skip to content

Commit 2d7b35b

Browse files
authored
Adds new $playtimeTwoWeeksReadable value for Games
$playtimeTwoWeeks now holds the raw minutes, $playtimeTwoWeeksReadable holds the human readable value like `2 hours 34 minutes`
1 parent e67a4f7 commit 2d7b35b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Syntax/SteamApi/Containers/Game.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ class Game extends BaseContainer
1010

1111
public $playtimeTwoWeeks;
1212

13+
public $playtimeTwoWeeksReadable;
14+
1315
public $playtimeForever;
1416

1517
public $playtimeForeverReadable;
@@ -26,7 +28,8 @@ public function __construct($app)
2628
{
2729
$this->appId = $app->appid;
2830
$this->name = $this->checkIssetField($app, 'name');
29-
$this->playtimeTwoWeeks = isset($app->playtime_2weeks) ? $this->convertFromMinutes($app->playtime_2weeks) : '0 minutes';
31+
$this->playtimeTwoWeeks = $this->checkIssetField($app, 'playtime_2weeks', 0);
32+
$this->playtimeTwoWeeksReadable = $this->convertFromMinutes($this->playtimeTwoWeeks);
3033
$this->playtimeForever = $this->checkIssetField($app, 'playtime_forever', 0);
3134
$this->playtimeForeverReadable = $this->convertFromMinutes($this->playtimeForever);
3235
$this->icon = $this->checkIssetImage($app, 'img_icon_url');

0 commit comments

Comments
 (0)