fix(utils): Add code to MVC model
Build, Test and Push Flask App / docker-build-and-push (push) Successful in 1m8s
Build, Test and Push Flask App / deploy (push) Successful in 1m4s

This commit is contained in:
Black_Raven committed 2026-10-20 20:36:39 +03:00
1 parent 13bb16759b
commit 5031ce6120
6 files changed
+31 -28

No files matched your search

+17
View File
@@ -0,0 +1,17 @@
from utils.listenbrainzutils import _HISTORY_CACHE, _HISTORY_LOCK, HISTORY_TTL, _NOW_CACHE, _NOW_LOCK, NOW_TTL, LB_USERNAME, _fetch_recent, _fetch_now, _serve
from flask import Blueprint, jsonify
listenbrainz_bp = Blueprint("listenbrainz", __name__)
@listenbrainz_bp.route("/api/listenbrainz/recent")
def listenbrainz_recent():
if not LB_USERNAME:
return jsonify(ok=False, error="LISTENBRAINZ_USERNAME is not set"), 503
return _serve(_HISTORY_CACHE, _HISTORY_LOCK, HISTORY_TTL, _fetch_recent)
@listenbrainz_bp.route("/api/listenbrainz/now")
def listenbrainz_now():
if not LB_USERNAME:
return jsonify(ok=False, error="LISTENBRAINZ_USERNAME is not set"), 503
return _serve(_NOW_CACHE, _NOW_LOCK, NOW_TTL, _fetch_now)
+10
View File
@@ -0,0 +1,10 @@
from utils.steamutils import STEAM_API_KEY, _serve
from flask import Blueprint, jsonify
steam_bp = Blueprint("steam", __name__)
@steam_bp.route("/api/steam/activity")
def steam_activity():
if not STEAM_API_KEY:
return jsonify(ok=False, error="STEAM_API_KEY is not set"), 503
return _serve()