add API version of stats page (#378)

statsmaxxing
remotes/1693176582716663532/tmp_refs/heads/watchparty
justcool393 2022-09-28 01:14:40 -07:00 committed by GitHub
parent 2fc5552573
commit 6c8faf6de7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -79,6 +79,7 @@ def sidebar(v):
@app.get("/stats")
@auth_required
def participation_stats(v):
if request.headers.get("Authorization"): return stats_cached()
return render_template("stats.html", v=v, title="Content Statistics", data=stats_cached())
@cache.memoize(timeout=86400)
@ -609,4 +610,4 @@ if SITE == 'pcmemes.net':
if live: cache.set('live', live)
if offline: cache.set('offline', offline)
return redirect('/live')
return redirect('/live')