Commit Graph

30 Commits

Author SHA1 Message Date
JSC
69544b6bb8 feat: Refactor cookie handling to use utility functions for setting access and refresh tokens
All checks were successful
Backend CI / lint (push) Successful in 9m30s
Backend CI / test (push) Successful in 3m31s
2025-08-08 10:06:45 +02:00
JSC
b4f0f54516 Refactor sound and extraction services to include user and timestamp fields
All checks were successful
Backend CI / lint (push) Successful in 18m8s
Backend CI / test (push) Successful in 53m35s
- Updated ExtractionInfo to include user_id, created_at, and updated_at fields.
- Modified ExtractionService to return user and timestamp information in extraction responses.
- Enhanced sound serialization in PlayerState to include extraction URL if available.
- Adjusted PlaylistRepository to load sound extractions when retrieving playlist sounds.
- Added tests for new fields in extraction and sound endpoints, ensuring proper response structure.
- Created new test file endpoints for sound downloads and thumbnail retrievals, including success and error cases.
- Refactored various test cases for consistency and clarity, ensuring proper mocking and assertions.
2025-08-03 20:54:14 +02:00
JSC
4bbae4c5d4 feat: Add endpoint to retrieve sounds with optional type filtering and implement corresponding repository method
Some checks failed
Backend CI / lint (push) Successful in 9m41s
Backend CI / test (push) Failing after 1m39s
2025-08-01 22:03:09 +02:00
JSC
d2d0240fdb feat: Add audio extraction endpoints and refactor sound API routes 2025-08-01 21:39:42 +02:00
JSC
6068599a47 Refactor test cases for improved readability and consistency
All checks were successful
Backend CI / lint (push) Successful in 9m49s
Backend CI / test (push) Successful in 6m15s
- Adjusted function signatures in various test files to enhance clarity by aligning parameters.
- Updated patching syntax for better readability across test cases.
- Improved formatting and spacing in test assertions and mock setups.
- Ensured consistent use of async/await patterns in async test functions.
- Enhanced comments for better understanding of test intentions.
2025-08-01 20:53:30 +02:00
JSC
0575d12b0e refactor: Rename global current playlist methods for clarity and consistency 2025-08-01 17:12:56 +02:00
JSC
c0f51b2e23 refactor: Update playlist service and endpoints for global current playlist management 2025-08-01 16:58:25 +02:00
JSC
3132175354 refactor: Create admin enpoints and some renaming of api endpoints 2025-08-01 15:34:35 +02:00
JSC
a10111793c fix: Lint fixes of services
All checks were successful
Backend CI / test (push) Successful in 3m59s
2025-08-01 01:27:47 +02:00
JSC
95ccb76233 fix: Lint fixes of api and repositories
All checks were successful
Backend CI / test (push) Successful in 3m58s
2025-07-31 22:29:11 +02:00
JSC
8847131f24 Refactor test files for improved readability and consistency
- Removed unnecessary blank lines and adjusted formatting in test files.
- Ensured consistent use of commas in function calls and assertions across various test cases.
- Updated import statements for better organization and clarity.
- Enhanced mock setups in tests for better isolation and reliability.
- Improved assertions to follow a consistent style for better readability.
2025-07-31 21:37:04 +02:00
JSC
e69098d633 refactor: Update player seek functionality to use consistent position field across schemas and services
All checks were successful
Backend CI / test (push) Successful in 4m5s
2025-07-31 21:33:00 +02:00
JSC
c13285ca4e refactor: Update response types to use common schemas across API endpoints
Some checks failed
Backend CI / test (push) Failing after 3m51s
2025-07-31 10:40:03 +02:00
JSC
dc372b961e refactor: Organize and implement player and playlist schemas 2025-07-31 10:23:46 +02:00
JSC
e43650c26c Add tests for sound repository, user OAuth repository, credit service, and credit decorators
- Implement comprehensive tests for SoundRepository covering CRUD operations and search functionalities.
- Create tests for UserOauthRepository to validate OAuth record management.
- Develop tests for CreditService to ensure proper credit management, including validation, deduction, and addition of credits.
- Add tests for credit-related decorators to verify correct behavior in credit management scenarios.
2025-07-30 21:33:55 +02:00
JSC
dd10ef5d41 feat: Add VLC player API endpoints and associated tests
- Implemented VLC player API endpoints for playing and stopping sounds.
- Added tests for successful playback, error handling, and authentication scenarios.
- Created utility function to get sound file paths based on sound properties.
- Refactored player service to utilize shared sound path utility.
- Enhanced test coverage for sound file path utility with various sound types.
- Introduced tests for VLC player service, including subprocess handling and play count tracking.
2025-07-30 20:46:49 +02:00
JSC
1b0d291ad3 Add comprehensive tests for player API endpoints and player service functionality
- Implemented tests for player API endpoints including play, pause, stop, next, previous, seek, set volume, set mode, reload playlist, and get state.
- Added mock player service for testing API interactions.
- Created tests for player service methods including play, pause, stop playback, next, previous, seek, set volume, set mode, and reload playlist.
- Ensured proper handling of success, error, and edge cases in both API and service tests.
- Verified state management and serialization in player state tests.
2025-07-30 01:22:24 +02:00
JSC
5ed19c8f0f Add comprehensive tests for playlist service and refactor socket service tests
- Introduced a new test suite for the PlaylistService covering various functionalities including creation, retrieval, updating, and deletion of playlists.
- Added tests for handling sounds within playlists, ensuring correct behavior when adding/removing sounds and managing current playlists.
- Refactored socket service tests for improved readability by adjusting function signatures.
- Cleaned up unnecessary whitespace in sound normalizer and sound scanner tests for consistency.
- Enhanced audio utility tests to ensure accurate hash and size calculations, including edge cases for nonexistent files.
- Removed redundant blank lines in cookie utility tests for cleaner code.
2025-07-29 19:25:46 +02:00
JSC
9b5f83eef0 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.
2025-07-29 01:06:29 +02:00
JSC
34e6289f92 Add sound normalization endpoints and corresponding tests
- Implemented endpoints for normalizing all sounds, normalizing sounds by type, and normalizing a specific sound by ID in the sounds API.
- Added dependency injection for the SoundNormalizerService.
- Included role-based access control to restrict normalization actions to admin users.
- Created comprehensive test cases for the new normalization endpoints, covering success scenarios, parameter handling, and error cases.
- Removed redundant test file for sound normalizer endpoints as tests are now integrated into the main sound endpoints test suite.
2025-07-28 17:15:21 +02:00
JSC
0fffce53b4 feat: Implement sound normalization service and API endpoints
- Added SoundNormalizerService for normalizing audio files with support for one-pass and two-pass normalization methods.
- Introduced API endpoints for normalizing all sounds and specific sounds by ID, including support for force normalization and handling of already normalized sounds.
- Created comprehensive test suite for the sound normalizer service and its API endpoints, covering various scenarios including success, errors, and edge cases.
- Refactored sound scanning service to utilize SHA-256 for file hashing instead of MD5 for improved security.
- Enhanced logging and error handling throughout the sound normalization process.
2025-07-28 09:18:18 +02:00
JSC
36949a1f1c feat: add SoundRepository and SoundScannerService for audio file management
- Implemented SoundRepository for database operations related to sounds, including methods for retrieving, creating, updating, and deleting sound records.
- Developed SoundScannerService to scan directories for audio files, calculate their metadata, and synchronize with the database.
- Added support for various audio file formats and integrated ffmpeg for audio duration extraction.
- Created comprehensive tests for sound API endpoints and sound scanner service to ensure functionality and error handling.
- Updated dependencies to include ffmpeg-python for audio processing.
2025-07-27 23:34:17 +02:00
JSC
3dc21337f9 Refactor tests for improved consistency and readability
- Updated test cases in `test_auth_endpoints.py` to ensure consistent formatting and style.
- Enhanced `test_socket_endpoints.py` with consistent parameter formatting and improved readability.
- Cleaned up `conftest.py` by ensuring consistent parameter formatting in fixtures.
- Added comprehensive tests for API token dependencies in `test_api_token_dependencies.py`.
- Refactored `test_auth_service.py` to maintain consistent parameter formatting.
- Cleaned up `test_oauth_service.py` by removing unnecessary imports.
- Improved `test_socket_service.py` with consistent formatting and readability.
- Enhanced `test_cookies.py` by ensuring consistent formatting and readability.
- Introduced new tests for token utilities in `test_token_utils.py` to validate token generation and expiration logic.
2025-07-27 15:11:47 +02:00
JSC
2e87ff9927 Refactor code structure for improved readability and maintainability 2025-07-27 14:24:11 +02:00
JSC
0f605d7ed1 feat: Enhance OAuth2 flow with temporary code exchange and update cookie handling 2025-07-26 18:31:40 +02:00
JSC
98e36b067d feat: Consolidate OAuth2 endpoints into auth module and remove redundant oauth file 2025-07-26 15:15:17 +02:00
JSC
51423779a8 feat: Implement OAuth2 authentication with Google and GitHub
- Added OAuth2 endpoints for Google and GitHub authentication.
- Created OAuth service to handle provider interactions and user info retrieval.
- Implemented user OAuth repository for managing user OAuth links in the database.
- Updated auth service to support linking existing users and creating new users via OAuth.
- Added CORS middleware to allow frontend access.
- Created tests for OAuth endpoints and service functionality.
- Introduced environment configuration for OAuth client IDs and secrets.
- Added logging for OAuth operations and error handling.
2025-07-26 14:38:13 +02:00
JSC
45ba28af52 Refactor auth service to improve refresh token revocation handling and logging 2025-07-25 18:23:19 +02:00
JSC
e456d34897 Add tests for authentication and utilities, and update dependencies
- Created a new test package for services and added tests for AuthService.
- Implemented tests for user registration, login, and token creation.
- Added a new test package for utilities and included tests for password and JWT utilities.
- Updated `uv.lock` to include new dependencies: bcrypt, email-validator, pyjwt, and pytest-asyncio.
2025-07-25 17:48:43 +02:00
JSC
c219aaac1a Add API routing for v1 endpoints and health check functionality 2025-07-25 11:24:03 +02:00