This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user