8 Commits

Author SHA1 Message Date
b0f3b643c7 Migrate download queue from JSON to SQLite database
- Created QueueRepository adapter in src/server/services/queue_repository.py
- Refactored DownloadService to use repository pattern instead of JSON
- Updated application startup to initialize download service from database
- Updated all test fixtures to use MockQueueRepository
- All 1104 tests passing
2025-12-02 16:01:25 +01:00
6e9087d0f4 Complete Phase 7: Testing and Validation for identifier standardization
- Task 7.1: Update All Test Fixtures to Use Key
  - Updated FakeSerie/FakeSeriesApp with realistic keys in test_anime_endpoints.py
  - Updated 6+ fixtures in test_websocket_integration.py
  - Updated 5 fixtures in test_download_progress_integration.py
  - Updated 9 fixtures in test_download_progress_websocket.py
  - Updated 10+ fixtures in test_download_models.py
  - All fixtures now use URL-safe, lowercase, hyphenated key format

- Task 7.2: Add Integration Tests for Identifier Consistency
  - Created tests/integration/test_identifier_consistency.py with 10 tests
  - TestAPIIdentifierConsistency: API response validation
  - TestServiceIdentifierConsistency: Download service key usage
  - TestWebSocketIdentifierConsistency: WebSocket events
  - TestIdentifierValidation: Model validation
  - TestEndToEndIdentifierFlow: Full flow verification
  - Tests use UUID suffixes for isolation

All 1006 tests passing.
2025-11-28 17:41:54 +01:00
7b07e0cfae fixed : tests 2025-11-15 17:55:27 +01:00
fac0cecf90 fixed some tests 2025-11-15 16:56:12 +01:00
f91875f6fc fix tests 2025-11-15 09:11:02 +01:00
3be175522f download re implemented 2025-10-30 22:06:41 +01:00
17e5a551e1 feat: migrate to Pydantic V2 and implement rate limiting middleware
- Migrate settings.py to Pydantic V2 (SettingsConfigDict, validation_alias)
- Update config models to use @field_validator with @classmethod
- Replace deprecated datetime.utcnow() with datetime.now(timezone.utc)
- Migrate FastAPI app from @app.on_event to lifespan context manager
- Implement comprehensive rate limiting middleware with:
  * Endpoint-specific rate limits (login: 5/min, register: 3/min)
  * IP-based and user-based tracking
  * Authenticated user multiplier (2x limits)
  * Bypass paths for health, docs, static, websocket endpoints
  * Rate limit headers in responses
- Add 13 comprehensive tests for rate limiting (all passing)
- Update instructions.md to mark completed tasks
- Fix asyncio.create_task usage in anime_service.py

All 714 tests passing. No deprecation warnings.
2025-10-23 22:03:15 +02:00
71207bc935 feat: Complete WebSocket integration with core services
- Enhanced DownloadService broadcasts for all queue operations
  - Download progress, complete, and failed broadcasts with full metadata
  - Queue operations (add, remove, reorder, retry, clear) broadcast queue status
  - Queue control (start, stop, pause, resume) broadcasts state changes

- AnimeService scan progress fully integrated with ProgressService
  - Scan lifecycle events (start, update, complete, fail) broadcasted
  - Progress tracking via ProgressService to scan_progress room

- ProgressService WebSocket integration
  - Broadcast callback registered during application startup
  - All progress types route to appropriate rooms
  - Throttled broadcasts for performance (>1% changes)

- Comprehensive integration tests
  - Test download progress and completion broadcasts
  - Test queue operation broadcasts
  - Test scan progress lifecycle
  - Test progress service integration
  - End-to-end flow testing

- Updated infrastructure documentation
  - Detailed broadcast message formats
  - Room structure and subscription patterns
  - Production deployment considerations
  - Architecture benefits and scalability notes
2025-10-17 11:51:16 +02:00