fix: load series from database on every startup

- Add _load_series_from_db call in lifespan startup
- Series now loaded into memory on every app start
- Fixes empty anime list issue (GET /api/anime)
This commit is contained in:
2026-01-23 17:26:42 +01:00
parent 611798b786
commit fed6162452
2 changed files with 9 additions and 0 deletions

View File

@@ -118,3 +118,7 @@ For each task completed:
---
## TODO List:
1. anime not showing issue
db has animes saved. but on get request http://127.0.0.1:8000/api/anime the js client get []

View File

@@ -219,6 +219,11 @@ async def lifespan(_application: FastAPI):
from src.server.utils.dependencies import get_anime_service
anime_service = get_anime_service()
# Always load series from database into memory on startup
logger.info("Loading series from database into memory...")
await anime_service._load_series_from_db()
logger.info("Series loaded from database into memory")
# Run NFO scan only on first run (if configured)
await perform_nfo_scan_if_needed()