Fix NFO service 503 error
- Load TMDB API key and NFO settings from config.json - Sync NFO config to settings during app startup - NFO endpoints now work correctly (no more 503)
This commit is contained in:
@@ -39,7 +39,16 @@ If you encounter:
|
||||
|
||||
---
|
||||
|
||||
## 📚 Helpful Commands
|
||||
## <EFBFBD> Credentials
|
||||
|
||||
**Admin Login:**
|
||||
|
||||
- Username: `admin`
|
||||
- Password: `Hallo123!`
|
||||
|
||||
---
|
||||
|
||||
## <20>📚 Helpful Commands
|
||||
|
||||
```bash
|
||||
# Run all tests
|
||||
@@ -114,6 +123,21 @@ All tasks completed! The NFO database query issue has been resolved.
|
||||
|
||||
## Recently Fixed Issues:
|
||||
|
||||
### ✅ Fixed: NFO Service 503 Error (2026-01-18)
|
||||
|
||||
**Issue:** Failed to load resource: the server responded with a status of 503 (Service Unavailable) when creating NFO files.
|
||||
|
||||
**Root Cause:** The TMDB API key configured in `data/config.json` was not being loaded into the application settings during startup. The NFO service dependency check was failing because `settings.tmdb_api_key` was None.
|
||||
|
||||
**Solution:** Updated `fastapi_app.py` startup code to sync NFO configuration (including TMDB API key) from `data/config.json` to `settings` object, similar to how `anime_directory` was already being synced.
|
||||
|
||||
**Files Modified:**
|
||||
- [src/server/fastapi_app.py](../src/server/fastapi_app.py)
|
||||
|
||||
**Verification:** NFO endpoints now return 200 OK instead of 503, and NFO creation is functional.
|
||||
|
||||
---
|
||||
|
||||
### ✅ Fixed: NFO Database Query Error (2026-01-18)
|
||||
|
||||
**Issue:** WARNING: Could not fetch NFO data from database: '\_AsyncGeneratorContextManager' object has no attribute 'query'
|
||||
|
||||
@@ -92,6 +92,20 @@ async def lifespan(_application: FastAPI):
|
||||
logger.debug(
|
||||
"anime_directory not found in config.other"
|
||||
)
|
||||
|
||||
# Sync NFO settings from config.json to settings
|
||||
if config.nfo:
|
||||
if config.nfo.tmdb_api_key:
|
||||
settings.tmdb_api_key = config.nfo.tmdb_api_key
|
||||
logger.info("Loaded TMDB API key from config")
|
||||
|
||||
settings.nfo_auto_create = config.nfo.auto_create
|
||||
settings.nfo_update_on_scan = config.nfo.update_on_scan
|
||||
settings.nfo_download_poster = config.nfo.download_poster
|
||||
settings.nfo_download_logo = config.nfo.download_logo
|
||||
settings.nfo_download_fanart = config.nfo.download_fanart
|
||||
settings.nfo_image_size = config.nfo.image_size
|
||||
logger.debug("Synced NFO settings from config")
|
||||
except (OSError, ValueError, KeyError) as e:
|
||||
logger.warning("Failed to load config from config.json: %s", e)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user