- 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.
- Add comprehensive download queue models in src/server/models/download.py
- DownloadStatus and DownloadPriority enums for type safety
- EpisodeIdentifier for episode references
- DownloadProgress for real-time progress tracking
- DownloadItem for queue item representation with timestamps and error handling
- QueueStatus for overall queue state management
- QueueStats for aggregated queue statistics
- DownloadRequest/DownloadResponse for API contracts
- QueueOperationRequest and QueueReorderRequest for queue management
- QueueStatusResponse for complete status endpoint responses
- Add comprehensive unit tests (47 tests, all passing)
- Test validation constraints (positive numbers, ranges, etc.)
- Test default values and optional fields
- Test serialization/deserialization
- Test model relationships and nested structures
- Update documentation
- Add download models section to infrastructure.md
- Remove completed task from instructions.md
- Update models package __init__.py
All models follow PEP 8 style guide with proper type hints and validation.
- Enhanced existing src/server/utils/dependencies.py with optional SQLAlchemy import
- Added comprehensive unit tests in tests/unit/test_dependencies.py
- Created pytest configuration with asyncio support
- Implemented SeriesApp singleton dependency with proper error handling
- Added placeholders for database session and authentication dependencies
- Updated infrastructure.md with dependency injection documentation
- Completed dependency injection task from instructions.md
Features implemented:
- SeriesApp dependency with lazy initialization and singleton pattern
- Configuration validation for anime directory
- Comprehensive error handling for initialization failures
- Common query parameters for pagination
- Placeholder dependencies for future authentication and database features
- 18 passing unit tests covering all dependency injection scenarios