From b677f185a7c0dd466fd363c4eab6352df9e91b79 Mon Sep 17 00:00:00 2001 From: Matt Gleich Date: Thu, 25 Jul 2024 14:16:43 -0400 Subject: [PATCH] feat: only return 3 most recent games Signed-off-by: Matt Gleich --- pkg/apis/steam/achievements.go | 4 ++-- pkg/apis/steam/games.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/apis/steam/achievements.go b/pkg/apis/steam/achievements.go index e13d3e9..f2c450c 100644 --- a/pkg/apis/steam/achievements.go +++ b/pkg/apis/steam/achievements.go @@ -155,8 +155,8 @@ func FetchGameAchievements(appID int32) (*float32, *[]Achievement) { return achievements[i].UnlockTime.After(*achievements[j].UnlockTime) }) - if len(achievements) > 20 { - achievements = achievements[:20] + if len(achievements) > 5 { + achievements = achievements[:5] } return &achievementPercentage, &achievements diff --git a/pkg/apis/steam/games.go b/pkg/apis/steam/games.go index 2c5c6ad..9e77061 100644 --- a/pkg/apis/steam/games.go +++ b/pkg/apis/steam/games.go @@ -106,5 +106,5 @@ func FetchRecentlyPlayedGames() []Game { }) } - return games + return games[:3] }