mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2026-04-21 20:55:18 +00:00
fix: set source_kind to FILE on audio file upload
The upload endpoint left source_kind as the default LIVE even when a file was uploaded. Now sets it to FILE when the upload completes.
This commit is contained in:
@@ -5,7 +5,7 @@ from fastapi import APIRouter, Depends, HTTPException, UploadFile
|
|||||||
from pydantic import BaseModel
|
from pydantic import BaseModel
|
||||||
|
|
||||||
import reflector.auth as auth
|
import reflector.auth as auth
|
||||||
from reflector.db.transcripts import transcripts_controller
|
from reflector.db.transcripts import SourceKind, transcripts_controller
|
||||||
from reflector.pipelines.main_file_pipeline import task_pipeline_file_process
|
from reflector.pipelines.main_file_pipeline import task_pipeline_file_process
|
||||||
|
|
||||||
router = APIRouter()
|
router = APIRouter()
|
||||||
@@ -88,8 +88,10 @@ async def transcript_record_upload(
|
|||||||
finally:
|
finally:
|
||||||
container.close()
|
container.close()
|
||||||
|
|
||||||
# set the status to "uploaded"
|
# set the status to "uploaded" and mark as file source
|
||||||
await transcripts_controller.update(transcript, {"status": "uploaded"})
|
await transcripts_controller.update(
|
||||||
|
transcript, {"status": "uploaded", "source_kind": SourceKind.FILE}
|
||||||
|
)
|
||||||
|
|
||||||
# launch a background task to process the file
|
# launch a background task to process the file
|
||||||
task_pipeline_file_process.delay(transcript_id=transcript_id)
|
task_pipeline_file_process.delay(transcript_id=transcript_id)
|
||||||
|
|||||||
Reference in New Issue
Block a user