bhaberer / steam-api

Simple Ruby implementation of the Steam WebAPI.
MIT License
59 stars 29 forks source link

Steam::Player.owned_games() Handles AppInfo Param Oddly #2

Closed wtchappell closed 9 years ago

wtchappell commented 10 years ago

Assuming that 'player' is a valid player id:

Steam::Player.owned_games(player, params: { include_appinfo: true })

This returns all of the games, but none of the appinfo.

However, the following does return all the games and their appinfo:

Steam::Player.owned_games(player, params: { include_appinfo: 1 })

Example output:

2.1.2 :028 > Steam::Player.owned_games(player, params: { :include_appinfo => true })['games'].select { |app| app['appid'] == 20 }

 => [{"appid"=>20, "playtime_forever"=>0}]

2.1.2 :029 > Steam::Player.owned_games(player, params: { :include_appinfo => 1 })['games'].select { |app| app['appid'] == 20 }

 => [{"appid"=>20, "name"=>"Team Fortress Classic", "playtime_forever"=>0, "img_icon_url"=>"38ea7ebe3c1abbbbf4eabdbef174c41a972102b9", "img_logo_url"=>"515bc393c861d91b9165f0697040c015f50bcb5e", "has_community_visible_stats"=>true}]
tak1n commented 9 years ago

This is not a bug in steam-api itself, its the given behaviour from the Steam Web API: https://developer.valvesoftware.com/wiki/Steam_Web_API#GetOwnedGames_.28v0001.29

The Ruby API is passing the params 1 to 1 to the Web API: https://github.com/bhaberer/steam-api/blob/master/lib/steam-api/steam/player.rb#L34

bhaberer commented 9 years ago

Yea this is just an example of how dumb the API is in places, I tried to sand down the edges where I could, but there's got to be a line.