diff --git a/src/backend/core/recording/event/notification.py b/src/backend/core/recording/event/notification.py index 89ea5111..f7fe1d57 100644 --- a/src/backend/core/recording/event/notification.py +++ b/src/backend/core/recording/event/notification.py @@ -26,7 +26,12 @@ class NotificationService: return self._notify_summary_service(recording) if recording.mode == models.RecordingModeChoices.SCREEN_RECORDING: - return self._notify_user_by_email(recording) + summary_success = True + if recording.options.get("transcribe", False): + summary_success = self._notify_summary_service(recording) + + email_success = self._notify_user_by_email(recording) + return email_success and summary_success logger.error( "Unknown recording mode %s for recording %s", diff --git a/src/backend/core/tests/recording/event/test_notification.py b/src/backend/core/tests/recording/event/test_notification.py index 856cea52..0cfd6059 100644 --- a/src/backend/core/tests/recording/event/test_notification.py +++ b/src/backend/core/tests/recording/event/test_notification.py @@ -60,6 +60,26 @@ def test_notify_external_services_screen_recording_mode(mock_notify_email): mock_notify_email.assert_called_once_with(recording) +@mock.patch.object(NotificationService, "_notify_summary_service", return_value=True) +@mock.patch.object(NotificationService, "_notify_user_by_email", return_value=True) +def test_notify_external_services_screen_recording_mode_with_transcribe( + mock_notify_email, mock_notify_summary +): + """Test notification routing for screen recording mode with transcribe option.""" + + service = NotificationService() + + recording = factories.RecordingFactory( + mode=models.RecordingModeChoices.SCREEN_RECORDING, options={"transcribe": True} + ) + + result = service.notify_external_services(recording) + + assert result is True + mock_notify_email.assert_called_once_with(recording) + mock_notify_summary.assert_called_once_with(recording) + + def test_notify_external_services_unknown_mode(caplog): """Test notification for unknown recording mode.""" recording = factories.RecordingFactory() diff --git a/src/summary/summary/core/config.py b/src/summary/summary/core/config.py index 2624cced..4e408b25 100644 --- a/src/summary/summary/core/config.py +++ b/src/summary/summary/core/config.py @@ -19,7 +19,7 @@ class Settings(BaseSettings): # Audio recordings recording_max_duration: Optional[int] = None - recording_allowed_extensions: Set[str] = {".ogg"} + recording_allowed_extensions: Set[str] = {".ogg", ".mp4"} # Celery settings celery_broker_url: str = "redis://redis/0"