From 275ddd5717aa157019dd73343b9d6670d83fcfaf Mon Sep 17 00:00:00 2001 From: herz Date: Mon, 14 Mar 2022 00:46:13 +0100 Subject: [PATCH] Added some checks in the template & added Links --- main.py | 9 +++++++-- templates/steamids.html | 13 ++++++++----- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/main.py b/main.py index 7aabb28..ca0ad33 100644 --- a/main.py +++ b/main.py @@ -23,6 +23,9 @@ def index(): faceit_level_dict = {} steam_name_dict = {} steam_pic_dict = {} + faceit_name_dict = {} + + for steamid in steamids: steamid64_dict[steamid] = steamid_to_64bit(steamid) faceit_json = get_faceit_data(steamid64_dict[steamid]) @@ -32,9 +35,11 @@ def index(): try: faceit_elo_dict[steamid] = faceit_json['games']['csgo']['faceit_elo'] faceit_level_dict[steamid] = faceit_json['games']['csgo']['skill_level'] + faceit_name_dict[steamid] = faceit_json['nickname'] except: - faceit_elo_dict[steamid] = "No FaceIT Account found" - faceit_level_dict[steamid] = "No FaceIT Account found" + faceit_elo_dict[steamid] = 0 + faceit_level_dict[steamid] = 0 + faceit_name_dict[steamid] = 0 diff --git a/templates/steamids.html b/templates/steamids.html index cff8fb9..cb98922 100644 --- a/templates/steamids.html +++ b/templates/steamids.html @@ -34,13 +34,16 @@

- Card link - Another link + Steam Profile + {% if not faceit_elo_dict[steamid] == 0 %} + FaceIT Link + {% endif %}
{%endfor%}