This commit is contained in:
2026-03-31 19:42:43 +03:00
parent ceffe633fd
commit 297648d4a2
7 changed files with 95 additions and 129 deletions
+2 -10
View File
@@ -87,22 +87,14 @@ def index():
@bp.route("/m/<module>")
def module(module):
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)