mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2026-04-23 05:35:18 +00:00
Allow reprocessing idle multitrack transcripts
This commit is contained in:
@@ -97,8 +97,11 @@ async def validate_transcript_for_processing(
|
|||||||
if transcript.locked:
|
if transcript.locked:
|
||||||
return ValidationLocked(detail="Recording is locked")
|
return ValidationLocked(detail="Recording is locked")
|
||||||
|
|
||||||
# Check if recording is ready for processing
|
if (
|
||||||
if transcript.status == "idle" and not transcript.workflow_run_id:
|
transcript.status == "idle"
|
||||||
|
and not transcript.workflow_run_id
|
||||||
|
and not transcript.recording_id
|
||||||
|
):
|
||||||
return ValidationNotReady(detail="Recording is not ready for processing")
|
return ValidationNotReady(detail="Recording is not ready for processing")
|
||||||
|
|
||||||
# Check Celery tasks
|
# Check Celery tasks
|
||||||
|
|||||||
@@ -255,7 +255,7 @@ async def test_validation_locked_transcript():
|
|||||||
@pytest.mark.usefixtures("setup_database")
|
@pytest.mark.usefixtures("setup_database")
|
||||||
@pytest.mark.asyncio
|
@pytest.mark.asyncio
|
||||||
async def test_validation_idle_transcript():
|
async def test_validation_idle_transcript():
|
||||||
"""Test that validation rejects idle transcripts (not ready)."""
|
"""Test that validation rejects idle transcripts without recording (file upload not ready)."""
|
||||||
from reflector.services.transcript_process import (
|
from reflector.services.transcript_process import (
|
||||||
ValidationNotReady,
|
ValidationNotReady,
|
||||||
validate_transcript_for_processing,
|
validate_transcript_for_processing,
|
||||||
@@ -274,6 +274,29 @@ async def test_validation_idle_transcript():
|
|||||||
assert "not ready" in result.detail.lower()
|
assert "not ready" in result.detail.lower()
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.usefixtures("setup_database")
|
||||||
|
@pytest.mark.asyncio
|
||||||
|
async def test_validation_idle_transcript_with_recording_allowed():
|
||||||
|
"""Test that validation allows idle transcripts with recording_id (multitrack ready/retry)."""
|
||||||
|
from reflector.services.transcript_process import (
|
||||||
|
ValidationOk,
|
||||||
|
validate_transcript_for_processing,
|
||||||
|
)
|
||||||
|
|
||||||
|
mock_transcript = Transcript(
|
||||||
|
id="test-transcript-id",
|
||||||
|
name="Test",
|
||||||
|
status="idle",
|
||||||
|
source_kind="room",
|
||||||
|
recording_id="test-recording-id",
|
||||||
|
)
|
||||||
|
|
||||||
|
result = await validate_transcript_for_processing(mock_transcript)
|
||||||
|
|
||||||
|
assert isinstance(result, ValidationOk)
|
||||||
|
assert result.recording_id == "test-recording-id"
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.usefixtures("setup_database")
|
@pytest.mark.usefixtures("setup_database")
|
||||||
@pytest.mark.asyncio
|
@pytest.mark.asyncio
|
||||||
async def test_prepare_multitrack_config():
|
async def test_prepare_multitrack_config():
|
||||||
|
|||||||
Reference in New Issue
Block a user