implement JellyStat API for watch history, genre summary, and user summary; add PostgreSQL connection pool and update requirements

This commit is contained in:
2026-05-25 13:54:30 +02:00
parent 4b87b817a8
commit 0151c8210e
10 changed files with 743 additions and 35 deletions
+7 -1
View File
@@ -6,6 +6,7 @@ from fastapi.middleware.cors import CORSMiddleware
from gateway.v1.auth import router as auth_router
from gateway.v1.chat import router as v1_router
from gateway.jellystat.api import router as jellystat_router
from src.config import DEEPSEEK_API_KEY, get_config
from src.llm import create_client
@@ -33,11 +34,15 @@ import gateway.auth.jellyfin # noqa: E402 — self-registers JellyfinAuth
@asynccontextmanager
async def lifespan(app: FastAPI):
from gateway.discord.bot import start_in_background # noqa: E402
from gateway.jellystat.db import init_pool, close_pool # noqa: E402
await init_pool(app)
start_in_background()
yield
await close_pool(app)
# ---------------------------------------------------------------------------
# App
@@ -64,4 +69,5 @@ app.state.agent_graphs: dict = {}
# Routers
# ---------------------------------------------------------------------------
app.include_router(v1_router, prefix="/v1")
app.include_router(auth_router)
app.include_router(auth_router)
app.include_router(jellystat_router)