feat: Add NFO configuration settings (Task 7)

- Added NFOConfig model with TMDB API key, auto-create, media downloads, image size settings
- Created NFO settings section in UI with form fields and validation
- Implemented nfo-config.js module for loading, saving, and testing TMDB connection
- Added TMDB API key validation endpoint (POST /api/config/tmdb/validate)
- Integrated NFO config into AppConfig and ConfigUpdate models
- Added 5 unit tests for NFO config model validation
- Added API test for TMDB validation endpoint
- All 16 config model tests passing, all 10 config API tests passing
- Documented in docs/task7_status.md (100% complete)
This commit is contained in:
2026-01-16 19:33:23 +01:00
parent ecfa8d3c10
commit 120b26b9f7
8 changed files with 635 additions and 0 deletions

View File

@@ -191,3 +191,19 @@ async def test_config_persistence(authenticated_client, mock_config_service):
resp2 = await authenticated_client.get("/api/config")
assert resp2.status_code == 200
assert resp2.json() == initial
@pytest.mark.asyncio
async def test_tmdb_validation_endpoint_exists(authenticated_client):
"""Test TMDB validation endpoint exists and is callable."""
resp = await authenticated_client.post(
"/api/config/tmdb/validate",
json={"api_key": ""}
)
assert resp.status_code == 200
data = resp.json()
assert "valid" in data
assert "message" in data
assert data["valid"] is False # Empty key should be invalid
assert "required" in data["message"].lower()