fix: parse string-encoded JSON in episode fields + return success for empty queue

- Add field validators to parse season/episode/title from JSON strings
- Add episodes list parser handling string-encoded dicts
- Return 200 with message instead of 400 when queue empty
- Remove completed tasks 8+9 from Docs
This commit is contained in:
2026-06-26 18:39:02 +02:00
parent 881da35dfd
commit e7d5df3a90
3 changed files with 78 additions and 20 deletions

View File

@@ -1,19 +1,3 @@
### Task 8: Fix `Get Empty Queue Status` API Test
**Test Result:** FAIL — `List '${values}' has no item in index 0.`
**File:** `tests/robot/api/download.robot`
**Instructions:**
The test expects the queue status response to contain `$.statistics.pending`, but the JSON path extraction fails. Open `src/server/api/download.py` and inspect the `get_queue_status` endpoint. Check the `QueueStatusResponse` model in `src/server/models/download.py`. The response structure may use `statistics.pending_count` instead of `statistics.pending`, or the `statistics` object may be missing. Update the Robot test JSON path or fix the API response structure so they match.
---
### Task 9: Fix `Add Episodes To Queue` API Test
**Test Result:** FAIL — Expected status: 201, got 422
**File:** `tests/robot/api/download.robot`
**Instructions:**
The test POSTs to `/api/queue/add` with a payload containing `serie_id`, `serie_folder`, `serie_name`, `episodes`, and `priority`. The server returns 422. Open `src/server/models/download.py` and inspect the `DownloadRequest` Pydantic model. Compare the model fields with the Robot test payload. The field names or types may mismatch (e.g., `episodes` list structure, `priority` enum values). Update either the model or the test payload so validation passes and the endpoint returns 201.
---
### Task 10: Fix `Start Queue` API Test
**Test Result:** FAIL — Expected status: 200, got 400 (`No pending downloads in queue`)
**File:** `tests/robot/api/download.robot`