- {% if steam.most_played_game_id %}
-
+ {% if record.most_played_game_id %}
+
-
+
{% endif %}
diff --git a/templates/profile.html b/templates/profile.html
index 8c528f2d..db10a27e 100644
--- a/templates/profile.html
+++ b/templates/profile.html
@@ -20,21 +20,33 @@
{% include "minis/ryg.html" %}
{% if steam %}
- {% include "minis/steam.html" %}
+ {% with record = steam %}
+ {% include "minis/steam.html" %}
+ {% endwith %}
{% endif %}
{% if rl %}
- {% include "minis/rl.html" %}
+ {% with record = rl %}
+ {% include "minis/rl.html" %}
+ {% endwith %}
{% endif %}
{% if dota %}
- {% include "minis/dota.html" %}
+ {% with record = dota %}
+ {% include "minis/dota.html" %}
+ {% endwith %}
{% endif %}
{% if osu %}
- {% include "minis/osu.html" %}
+ {% with record = osu %}
+ {% include "minis/osu.html" %}
+ {% endwith %}
{% endif %}
{% if lol %}
- {% include "minis/lol.html" %}
+ {% with record = lol %}
+ {% include "minis/lol.html" %}
+ {% endwith %}
{% endif %}
{% if ow %}
- {% include "minis/ow.html" %}
+ {% with record = ow %}
+ {% include "minis/ow.html" %}
+ {% endwith %}
{% endif %}
{% endblock %}
\ No newline at end of file
diff --git a/update.py b/update.py
index 232e37a8..a44962dc 100644
--- a/update.py
+++ b/update.py
@@ -8,85 +8,85 @@ try:
while True:
session = db.Session()
# Update Steam
- print("STEAM")
- for user in session.query(db.Steam).all():
- t = time.clock()
- print(f"Updating {user.royal.username}", end="\t\t", flush=True)
- try:
- user.update()
- except errors.RequestError:
- print("Request Error")
- except errors.NotFoundError:
- print("Not Found Error (?)")
- else:
- print("OK")
- finally:
- sleep_time = 1 - time.clock() + t
- time.sleep(sleep_time if sleep_time > 0 else 0)
- # Update Rocket League
- print("ROCKET LEAGUE")
- for user in session.query(db.RocketLeague).all():
- t = time.clock()
- print(f"Updating {user.steam.royal.username}", end="\t\t", flush=True)
- try:
- user.update()
- except errors.RequestError:
- print("Request Error")
- except errors.NotFoundError:
- print("Not Found Error (?)")
- else:
- print("OK")
- finally:
- sleep_time = 1 - time.clock() + t
- time.sleep(sleep_time if sleep_time > 0 else 0)
- # Update Dota 2
- print("DOTA 2")
- for user in session.query(db.Dota).all():
- t = time.clock()
- print(f"Updating {user.steam.royal.username}", end="\t\t", flush=True)
- try:
- user.update()
- except errors.RequestError:
- print("Request Error")
- except errors.NotFoundError:
- print("Not Found Error (?)")
- else:
- print("OK")
- finally:
- sleep_time = 1 - time.clock() + t
- time.sleep(sleep_time if sleep_time > 0 else 0)
- # Update League of Legends
- print("LEAGUE OF LEGENDS")
- for user in session.query(db.LeagueOfLegends).all():
- t = time.clock()
- print(f"Updating {user.royal.username}", end="\t\t", flush=True)
- try:
- user.update()
- except errors.RequestError:
- print("Request Error")
- except errors.NotFoundError:
- print("Not Found Error (?)")
- else:
- print("OK")
- finally:
- sleep_time = 1 - time.clock() + t
- time.sleep(sleep_time if sleep_time > 0 else 0)
- # Update Osu!
- print("OSU!")
- for user in session.query(db.Osu).all():
- t = time.clock()
- print(f"Updating {user.royal.username}", end="\t\t", flush=True)
- try:
- user.update()
- except errors.RequestError:
- print("Request Error")
- except errors.NotFoundError:
- print("Not Found Error (?)")
- else:
- print("OK")
- finally:
- sleep_time = 1 - time.clock() + t
- time.sleep(sleep_time if sleep_time > 0 else 0)
+ #print("STEAM")
+ #for user in session.query(db.Steam).all():
+ # t = time.clock()
+ # print(f"Updating {user.royal.username}", end="\t\t", flush=True)
+ # try:
+ # user.update()
+ # except errors.RequestError:
+ # print("Request Error")
+ # except errors.NotFoundError:
+ # print("Not Found Error (?)")
+ # else:
+ # print("OK")
+ # finally:
+ # sleep_time = 1 - time.clock() + t
+ # time.sleep(sleep_time if sleep_time > 0 else 0)
+ ## Update Rocket League
+ #print("ROCKET LEAGUE")
+ #for user in session.query(db.RocketLeague).all():
+ # t = time.clock()
+ # print(f"Updating {user.steam.royal.username}", end="\t\t", flush=True)
+ # try:
+ # user.update()
+ # except errors.RequestError:
+ # print("Request Error")
+ # except errors.NotFoundError:
+ # print("Not Found Error (?)")
+ # else:
+ # print("OK")
+ # finally:
+ # sleep_time = 1 - time.clock() + t
+ # time.sleep(sleep_time if sleep_time > 0 else 0)
+ ## Update Dota 2
+ #print("DOTA 2")
+ #for user in session.query(db.Dota).all():
+ # t = time.clock()
+ # print(f"Updating {user.steam.royal.username}", end="\t\t", flush=True)
+ # try:
+ # user.update()
+ # except errors.RequestError:
+ # print("Request Error")
+ # except errors.NotFoundError:
+ # print("Not Found Error (?)")
+ # else:
+ # print("OK")
+ # finally:
+ # sleep_time = 1 - time.clock() + t
+ # time.sleep(sleep_time if sleep_time > 0 else 0)
+ ## Update League of Legends
+ #print("LEAGUE OF LEGENDS")
+ #for user in session.query(db.LeagueOfLegends).all():
+ # t = time.clock()
+ # print(f"Updating {user.royal.username}", end="\t\t", flush=True)
+ # try:
+ # user.update()
+ # except errors.RequestError:
+ # print("Request Error")
+ # except errors.NotFoundError:
+ # print("Not Found Error (?)")
+ # else:
+ # print("OK")
+ # finally:
+ # sleep_time = 1 - time.clock() + t
+ # time.sleep(sleep_time if sleep_time > 0 else 0)
+ ## Update Osu!
+ #print("OSU!")
+ #for user in session.query(db.Osu).all():
+ # t = time.clock()
+ # print(f"Updating {user.royal.username}", end="\t\t", flush=True)
+ # try:
+ # user.update()
+ # except errors.RequestError:
+ # print("Request Error")
+ # except errors.NotFoundError:
+ # print("Not Found Error (?)")
+ # else:
+ # print("OK")
+ # finally:
+ # sleep_time = 1 - time.clock() + t
+ # time.sleep(sleep_time if sleep_time > 0 else 0)
# Update Overwatch
print("OVERWATCH")
for user in session.query(db.Overwatch).all():
diff --git a/webserver.py b/webserver.py
index 90ace384..b32d8780 100644
--- a/webserver.py
+++ b/webserver.py
@@ -123,6 +123,33 @@ def page_setcss():
return redirect(url_for("page_profile", name=royal.username))
+@app.route("/game/
")
+def page_game(name: str):
+ db_session = db.Session()
+ if name == "rl":
+ game_name = "Rocket League"
+ query = db_session.query(db.RocketLeague).join(db.Steam).all()
+ elif name == "dota":
+ game_name = "Dota 2"
+ query = db_session.query(db.Dota).join(db.Steam).all()
+ elif name == "lol":
+ game_name = "League of Legends"
+ query = db_session.query(db.LeagueOfLegends).all()
+ elif name == "osu":
+ game_name = "osu!"
+ query = db_session.query(db.Osu).all()
+ elif name == "ow":
+ game_name = "Overwatch"
+ query = db_session.query(db.Overwatch).all()
+ elif name == "steam":
+ game_name = "Steam"
+ query = db_session.query(db.Steam).all()
+ elif name == "ryg":
+ game_name = "Royalnet"
+ query = db_session.query(db.Royal).all()
+ db_session.close()
+ return render_template("game.html", minis=query, game_name=game_name, game_short_name=name)
+
if __name__ == "__main__":
try:
app.run(host="0.0.0.0", port=1234, debug=__debug__)