Skip to content

Commit

Permalink
feat: only return 3 most recent games
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Gleich <[email protected]>
  • Loading branch information
gleich committed Jul 25, 2024
1 parent 231e0a8 commit b677f18
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pkg/apis/steam/achievements.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/steam/games.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,5 +106,5 @@ func FetchRecentlyPlayedGames() []Game {
})
}

return games
return games[:3]
}

0 comments on commit b677f18

Please sign in to comment.