Fix NFO API endpoint mismatch in frontend

- Update nfo-manager.js to use correct API routes:
  * POST /api/nfo/{id}/create (was /api/nfo/series/{id})
  * PUT /api/nfo/{id}/update (was /api/nfo/series/{id})
  * GET /api/nfo/{id}/content (was /api/nfo/series/{id})
- Add request body to createNFO with default options
- Fix response handling to check actual API fields
- Remove non-existent getStatistics function
- Fix getSeriesWithoutNFO response structure
- Update instructions.md with fix documentation
This commit is contained in:
2026-01-16 20:48:46 +01:00
parent d1a966cc0d
commit d676cb7dca
2 changed files with 48 additions and 40 deletions

View File

@@ -109,3 +109,28 @@ For each task completed:
---
## TODO List:
<!-- No pending issues -->
## Recently Fixed Issues
### 1. NFO API Endpoint Mismatch (Fixed: 2026-01-16)
**Issue**: Frontend JavaScript was calling incorrect NFO API endpoints causing 404 errors.
**Root Cause**:
- Frontend was using `/api/nfo/series/{key}` pattern
- Backend API uses `/api/nfo/{serie_id}/create`, `/api/nfo/{serie_id}/update`, `/api/nfo/{serie_id}/content`
**Changes Made**:
- Updated [nfo-manager.js](../src/server/web/static/js/index/nfo-manager.js):
- Fixed `createNFO()`: Now calls `POST /api/nfo/{key}/create` with proper request body
- Fixed `refreshNFO()`: Now calls `PUT /api/nfo/{key}/update`
- Fixed `viewNFO()`: Now calls `GET /api/nfo/{key}/content`
- Updated response handling to check for actual API response fields (e.g., `message`, `content`)
- Removed non-existent `getStatistics()` function
- Fixed `getSeriesWithoutNFO()` to use correct endpoint and response structure
**Status**: ✅ Fixed and tested
---