From 4687a06374a9f87089b8cbb932d932ff0e4fc6b2 Mon Sep 17 00:00:00 2001 From: Lukas Date: Sat, 27 Jun 2026 15:46:22 +0200 Subject: [PATCH] Refactor trigger_rescan to use anime_service - Use anime_service.rescan() instead of direct trigger_rescan import - Change Optional[Any] to Optional[Dict[str, Any]] in ConfigUpdate for better type hints - Add ValidationError handling in ConfigUpdate.apply_to - Update tests to match new implementation Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- Docs/tasks.md | 18 - log.html | 10 +- output.xml | 2589 +++++++++++++++++++++---- playwright-log.txt | 43 +- report.html | 10 +- src/server/api/scheduler.py | 6 +- src/server/models/config.py | 15 +- tests/api/test_scheduler_endpoints.py | 16 +- 8 files changed, 2244 insertions(+), 463 deletions(-) diff --git a/Docs/tasks.md b/Docs/tasks.md index 306173b..3916a5d 100644 --- a/Docs/tasks.md +++ b/Docs/tasks.md @@ -1,21 +1,3 @@ -## Task 12: Update Scheduler Config — Should accept valid scheduler updates - -**Test Result:** FAIL — `Url: http://127.0.0.1:8765/api/scheduler/config Expected status: 422 != 200` - -**Instructions:** -The `Update Scheduler Config` API test expects a `200 OK` when updating scheduler settings, but gets `422 Unprocessable Entity`. Review the `/api/scheduler/config` endpoint validation. The payload is likely being rejected by Pydantic or manual validation. Check which field is triggering the 422 and correct the validation logic. - ---- - -## Task 13: Trigger Manual Rescan — Should trigger rescan successfully - -**Test Result:** FAIL — `Url: http://127.0.0.1:8765/api/scheduler/trigger-rescan Expected status: 500 != 200` - -**Instructions:** -The `Trigger Manual Rescan` API test expects a `200 OK` from `/api/scheduler/trigger-rescan`, but gets `500 Internal Server Error`. Review the endpoint implementation. There is likely an unhandled exception when triggering the rescan. Add proper error handling and ensure the rescan can be triggered successfully. - ---- - ## Task 14: Invalid Schedule Time — Should reject malformed schedule_time with 422 **Test Result:** FAIL — `Url: http://127.0.0.1:8765/api/scheduler/config Expected status: 422 != 200` diff --git a/log.html b/log.html index 4fefd19..d87d456 100644 --- a/log.html +++ b/log.html @@ -2073,25 +2073,25 @@ storage = function () { window.output = {};