Drop narration, history and restated-code comments across the repo, keep short ones for security boundaries, upstream quirks and ordering constraints, and record the convention in CLAUDE.md. Co-Authored-By: Claude Opus 5.5 <[email protected]>
25 lines
701 B
Go
25 lines
701 B
Go
package graph
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"adam-french.co.uk/backend/graph/model"
|
|
"adam-french.co.uk/backend/services"
|
|
)
|
|
|
|
// mapSteamGames converts Steam API games into the GraphQL shape.
|
|
// Header images follow a predictable CDN path, saving an API call per game.
|
|
func mapSteamGames(games []services.SteamRecentGame) []*model.SteamGame {
|
|
result := make([]*model.SteamGame, len(games))
|
|
for i, g := range games {
|
|
result[i] = &model.SteamGame{
|
|
AppID: g.AppID,
|
|
Name: g.Name,
|
|
Playtime2Weeks: g.Playtime2Weeks,
|
|
PlaytimeForever: g.PlaytimeForever,
|
|
HeaderImageURL: fmt.Sprintf("https://cdn.akamai.steamstatic.com/steam/apps/%d/header.jpg", g.AppID),
|
|
}
|
|
}
|
|
return result
|
|
}
|