feat: Implement background extraction processor with concurrency control
- Added `ExtractionProcessor` class to handle extraction queue processing in the background. - Implemented methods for starting, stopping, and queuing extractions with concurrency limits. - Integrated logging for monitoring the processor's status and actions. - Created tests for the extraction processor to ensure functionality and error handling. test: Add unit tests for extraction API endpoints - Created tests for successful extraction creation, authentication checks, and processor status retrieval. - Ensured proper responses for authenticated and unauthenticated requests. test: Implement unit tests for extraction repository - Added tests for creating, retrieving, and updating extractions in the repository. - Mocked database interactions to validate repository behavior without actual database access. test: Add comprehensive tests for extraction service - Developed tests for extraction creation, service detection, and sound record creation. - Included tests for handling duplicate extractions and invalid URLs. test: Add unit tests for extraction background processor - Created tests for the `ExtractionProcessor` class to validate its behavior under various conditions. - Ensured proper handling of extraction queuing, processing, and completion callbacks. fix: Update OAuth service tests to use AsyncMock - Modified OAuth provider tests to use `AsyncMock` for mocking asynchronous HTTP requests.
This commit is contained in:
@@ -52,5 +52,12 @@ class Settings(BaseSettings):
|
||||
NORMALIZED_AUDIO_BITRATE: str = "256k"
|
||||
NORMALIZED_AUDIO_PASSES: int = 2 # 1 for one-pass, 2 for two-pass
|
||||
|
||||
# Audio Extraction Configuration
|
||||
EXTRACTION_AUDIO_FORMAT: str = "mp3"
|
||||
EXTRACTION_AUDIO_BITRATE: str = "256k"
|
||||
EXTRACTION_TEMP_DIR: str = "sounds/temp"
|
||||
EXTRACTION_THUMBNAILS_DIR: str = "sounds/originals/extracted/thumbnails"
|
||||
EXTRACTION_MAX_CONCURRENT: int = 2 # Maximum concurrent extractions
|
||||
|
||||
|
||||
settings = Settings()
|
||||
|
||||
Reference in New Issue
Block a user