Add Steam info

This commit is contained in:
2026-02-05 15:43:04 +03:00
parent c17bf8ca83
commit 25a179f5a0
5 changed files with 162 additions and 1 deletions
+23 -1
View File
@@ -14,6 +14,20 @@ from flask import (
)
from .modules.api.lb import listens, listening
from .modules.api.steam import recent, owned
def tmsmp(min: int) -> str:
if min < 60:
return f"{min} m"
elif min < 60*24:
return f"{min/60:.1f} h"
else:
return f"{min/60/24:.1f} d"
def rtmsmp(unix: int) -> str:
return datetime \
.utcfromtimestamp(unix) \
.strftime('%Y-%m-%d %H:%M:%S')
bp = Blueprint(
"risdeveau",
@@ -49,4 +63,12 @@ def mb_cover(mbid):
@bp.route("/")
def index():
return render_tmpl('index.html', lb=listens, lb_now=listening)
return render_tmpl(
'index.html',
lb=listens,
lb_now=listening,
recent=recent.get('data', {}),
owned=owned.get('data', {}),
tmsmp=tmsmp,
rtmsmp=rtmsmp
)