Fix API calls by all workers
Quite a complex commit by GPT. I'll rewrite it somewhen
This commit is contained in:
1 parent
6c22740fbd
commit
4844cdb7b6
5 files changed
+278
-35
No files matched your search
@@ -15,8 +15,8 @@ import magic
|
||||
from htmlmin import minify
|
||||
from musicbrainzngs import get_image_front
|
||||
|
||||
from .modules.api.lb import data as lb_data
|
||||
from .modules.api.steam import data as steam_data
|
||||
from .modules.api.lb import data as lb_data, refresh_cache as lb_refresh
|
||||
from .modules.api.steam import data as steam_data, refresh_cache as steam_refresh
|
||||
|
||||
def tmsmp(sec: int) -> str:
|
||||
if sec == 0:
|
||||
@@ -83,10 +83,16 @@ args = {
|
||||
|
||||
@bp.route("/")
|
||||
def index():
|
||||
lb_refresh()
|
||||
steam_refresh()
|
||||
return render_tmpl('index.html', **args)
|
||||
|
||||
@bp.route("/m/<module>")
|
||||
def module(module):
|
||||
if module == "listenbrainz":
|
||||
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')
|
||||
|
||||
Reference in new issue
Block a user