summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--SteamAPI.py5
-rw-r--r--templates/premades_html.jinja2
2 files changed, 4 insertions, 3 deletions
diff --git a/SteamAPI.py b/SteamAPI.py
index e6548fc..c71f438 100644
--- a/SteamAPI.py
+++ b/SteamAPI.py
@@ -337,8 +337,9 @@ class SteamAPI():
profiles[steamid]['_friends'] = futures['friends'][steamid].result()
profiles[steamid]['_userstats'] = futures['userstats'][steamid].result()
profiles[steamid]['_ownedGames'] = futures['ownedGames'][steamid].result()
- profiles[steamid]['_ownedPlayedGames'] = len([game for game in profiles[steamid]['_ownedGames']['games'] if game['playtime_forever'] > 0])
-
+ profiles[steamid]['_ownedPlayedGames'] = 'n/a'
+ if profiles[steamid]['_ownedGames']:
+ profiles[steamid]['_ownedPlayedGames'] = len([game for game in profiles[steamid]['_ownedGames']['games'] if game['playtime_forever'] > 0])
return profiles
diff --git a/templates/premades_html.jinja b/templates/premades_html.jinja
index e886023..3bf6b55 100644
--- a/templates/premades_html.jinja
+++ b/templates/premades_html.jinja
@@ -61,7 +61,7 @@
.link(node.data.url)
)
if (node.data.details1) {
- const col = (node.data.details1 < 10) ? 'rgb(150, 0, 0)' : 'rgb(150, 150, 0)'
+ const col = (node.data.details1 < 10 || node.data.details1 == 'n/a') ? 'rgb(150, 0, 0)' : 'rgb(150, 150, 0)'
ui.append(Viva.Graph.svg('text')
.attr('text-anchor', 'middle')
.attr('fill', col)