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:
@@ -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 []
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user