Use Pug template generator
Docker Build and Push / build-and-push (push) Successful in 1m15s

This commit is contained in:
2026-03-31 16:09:57 +03:00
parent 4844cdb7b6
commit 3a47b84a1b
32 changed files with 419 additions and 468 deletions
+3 -11
View File
@@ -85,7 +85,7 @@ args = {
def index():
lb_refresh()
steam_refresh()
return render_tmpl('index.html', **args)
return render_tmpl('index.pug', **args)
@bp.route("/m/<module>")
def module(module):
@@ -93,22 +93,14 @@ def module(module):
lb_refresh()
elif module == "steam":
steam_refresh()
if modified_since := request.headers.get('if-modified-since'):
modified_since = int(modified_since)
none_match = request.headers.get('if-none-match')
if any((modified_since, none_match)):
if none_match := request.headers.get('if-none-match'):
match module:
case "listenbrainz":
if modified_since >= int(lb_data['last_updated']):
return '', 304
if none_match == lb_data['etag']:
return '', 304
case "steam":
if modified_since >= int(steam_data['last_updated']):
return '', 304
if none_match == steam_data['etag']:
return '', 304
return render_tmpl(f'{module}.htm', **args)
return render_tmpl(f'{module}.pug', **args)