Skip to content

Commit 68d88bc

Browse files
author
babelshift
committed
Trim game names when returning OwnedGames.
1 parent fd9b8f7 commit 68d88bc

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

SteamWebAPI2/Interfaces/PlayerService.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,16 @@ public async Task<OwnedGamesResult> GetOwnedGamesAsync(long steamId, bool? inclu
6868
}
6969

7070
var ownedGamesResult = await CallMethodAsync<OwnedGamesResultContainer>("GetOwnedGames", 1, parameters);
71+
72+
// for some reason, some games have trailing spaces in the result
73+
if (ownedGamesResult.Result != null && ownedGamesResult.Result.OwnedGames != null)
74+
{
75+
foreach (var ownedGame in ownedGamesResult.Result.OwnedGames)
76+
{
77+
ownedGame.Name = ownedGame.Name.Trim();
78+
}
79+
}
80+
7181
return ownedGamesResult.Result;
7282
}
7383

0 commit comments

Comments
 (0)