Fix JSON parsing in NFO JavaScript modules

- Add response.json() calls in nfo-manager.js for all API calls
- Add response.json() calls in nfo-config.js for all API calls
- Fix createNFO, refreshNFO, viewNFO, getSeriesWithoutNFO functions
- Fix load and testTMDBConnection functions
- All API responses must be parsed before accessing properties
This commit is contained in:
2026-01-18 12:18:42 +01:00
parent e502dcb8bd
commit c92e2d340e
4 changed files with 57 additions and 17 deletions

View File

@@ -132,12 +132,15 @@ All tasks completed! Recent issues have been resolved.
**Solution:** Modified `get_nfo_service()` dependency function to check `settings.tmdb_api_key` first, and if not found, fall back to loading from `config.json` directly. This ensures the TMDB API key is always available even after hot reloads in development.
**Files Modified:**
- [src/server/api/nfo.py](../src/server/api/nfo.py)
**Tests Added:**
- [tests/unit/test_nfo_dependency.py](../tests/unit/test_nfo_dependency.py) - Tests for config fallback behavior
**Verification:**
**Verification:**
- All 4 unit tests pass
- NFO endpoints work correctly even after server reloads
- Falls back gracefully to config.json when settings are reset