Skip to content

Commit

Permalink
feat(plugins/steam): add support for free games
Browse files Browse the repository at this point in the history
  • Loading branch information
Seraphli committed Aug 6, 2024
1 parent 366f8b9 commit 9a315dd
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 2 deletions.
4 changes: 4 additions & 0 deletions action.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions source/plugins/steam/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,16 @@ All product and company names are trademarks™ or registered® trademarks of th
<br>
<b>default:</b> 2<br></td>
</tr>
<tr>
<td nowrap="nowrap"><h4><code>plugin_steam_freegames</code></h4></td>
<td rowspan="2"><p>Include free games</p>
<img width="900" height="1" alt=""></td>
</tr>
<tr>
<td nowrap="nowrap"><b>type:</b> <code>boolean</code>
<br>
<b>default:</b> no<br></td>
</tr>
</table>
<!--/options-->

Expand Down
4 changes: 2 additions & 2 deletions source/plugins/steam/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ export default async function({login, q, imports, data, account}, {token, enable
return null

//Load inputs
let {user, sections, "games.ignored": _games_ignored, "games.limit": _games_limit, "recent.games.limit": _recent_games_limit, "achievements.limit": _achievements_limit, "playtime.threshold": _playtime_threshold} = imports.metadata.plugins.steam.inputs({data, account, q})
let {user, sections, "games.ignored": _games_ignored, "games.limit": _games_limit, "recent.games.limit": _recent_games_limit, "achievements.limit": _achievements_limit, "playtime.threshold": _playtime_threshold, freegames} = imports.metadata.plugins.steam.inputs({data, account, q})

const urls = {
games: {
owned: `https://api.steampowered.com/IPlayerService/GetOwnedGames/v0001/?key=${token}&steamid=${user}&format=json&include_appinfo=1`,
owned: `https://api.steampowered.com/IPlayerService/GetOwnedGames/v0001/?key=${token}&steamid=${user}&format=json&include_appinfo=1&include_played_free_games=${freegames ? '1' : '0'}`,
schema: `https://api.steampowered.com/ISteamUserStats/GetSchemaForGame/v0002/?key=${token}&format=json`,
details: "https://store.steampowered.com/api/appdetails?",
},
Expand Down
5 changes: 5 additions & 0 deletions source/plugins/steam/metadata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,8 @@ inputs:
min: 0
default: 2

plugin_steam_freegames:
description: |
Include free games
type: boolean
default: no

0 comments on commit 9a315dd

Please sign in to comment.