feat: Implement download queue API endpoints

- Add comprehensive REST API for download queue management
- Implement GET /api/queue/status endpoint with queue status and statistics
- Implement POST /api/queue/add for adding episodes to queue with priority support
- Implement DELETE /api/queue/{id} and DELETE /api/queue/ for removing items
- Implement POST /api/queue/start and /api/queue/stop for queue control
- Implement POST /api/queue/pause and /api/queue/resume for pause/resume
- Implement POST /api/queue/reorder for queue item reordering
- Implement DELETE /api/queue/completed for clearing completed items
- Implement POST /api/queue/retry for retrying failed downloads
- Add get_download_service and get_anime_service dependencies
- Register download router in FastAPI application
- Add comprehensive test suite for all endpoints
- All endpoints require JWT authentication
- Update infrastructure documentation
- Remove completed task from instructions.md

Follows REST conventions with proper error handling and status codes.
Tests cover success cases, error conditions, and authentication requirements.
This commit is contained in:
2025-10-17 10:29:03 +02:00
parent 028d91283e
commit 577c55f32a
6 changed files with 1105 additions and 16 deletions

View File

@@ -18,6 +18,7 @@ from src.config.settings import settings
# Import core functionality
from src.core.SeriesApp import SeriesApp
from src.server.api.auth import router as auth_router
from src.server.api.download import router as download_router
from src.server.controllers.error_controller import (
not_found_handler,
server_error_handler,
@@ -57,6 +58,7 @@ app.add_middleware(AuthMiddleware, rate_limit_per_minute=5)
app.include_router(health_router)
app.include_router(page_router)
app.include_router(auth_router)
app.include_router(download_router)
# Global variables for application state
series_app: Optional[SeriesApp] = None