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

This commit is contained in:
Sweetbread committed 2026-04-08 23:03:37 +03:00
1 parent 4844cdb7b6
commit 3a47b84a1b
32 files changed
+419 -468

No files matched your search

+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)