mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2025-12-20 20:29:06 +00:00
fix: source kind for file processing (#601)
This commit is contained in:
@@ -96,6 +96,7 @@ class CreateTranscript(BaseModel):
|
|||||||
name: str
|
name: str
|
||||||
source_language: str = Field("en")
|
source_language: str = Field("en")
|
||||||
target_language: str = Field("en")
|
target_language: str = Field("en")
|
||||||
|
source_kind: SourceKind | None = None
|
||||||
|
|
||||||
|
|
||||||
class UpdateTranscript(BaseModel):
|
class UpdateTranscript(BaseModel):
|
||||||
@@ -213,7 +214,7 @@ async def transcripts_create(
|
|||||||
user_id = user["sub"] if user else None
|
user_id = user["sub"] if user else None
|
||||||
return await transcripts_controller.add(
|
return await transcripts_controller.add(
|
||||||
info.name,
|
info.name,
|
||||||
source_kind=SourceKind.LIVE,
|
source_kind=info.source_kind or SourceKind.LIVE,
|
||||||
source_language=info.source_language,
|
source_language=info.source_language,
|
||||||
target_language=info.target_language,
|
target_language=info.target_language,
|
||||||
user_id=user_id,
|
user_id=user_id,
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ async def transcript_process(
|
|||||||
)
|
)
|
||||||
|
|
||||||
if task_is_scheduled_or_active(
|
if task_is_scheduled_or_active(
|
||||||
"reflector.pipelines.main_live_pipeline.task_pipeline_process",
|
"reflector.pipelines.main_file_pipeline.task_pipeline_file_process",
|
||||||
transcript_id=transcript_id,
|
transcript_id=transcript_id,
|
||||||
):
|
):
|
||||||
return ProcessStatus(status="already running")
|
return ProcessStatus(status="already running")
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import About from "../../../(aboutAndPrivacy)/about";
|
|||||||
import Privacy from "../../../(aboutAndPrivacy)/privacy";
|
import Privacy from "../../../(aboutAndPrivacy)/privacy";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import useCreateTranscript from "../createTranscript";
|
import useCreateTranscript from "../createTranscript";
|
||||||
|
import { SourceKind } from "../../../api";
|
||||||
import SelectSearch from "react-select-search";
|
import SelectSearch from "react-select-search";
|
||||||
import { supportedLanguages } from "../../../supportedLanguages";
|
import { supportedLanguages } from "../../../supportedLanguages";
|
||||||
import useSessionStatus from "../../../lib/useSessionStatus";
|
import useSessionStatus from "../../../lib/useSessionStatus";
|
||||||
@@ -61,13 +62,21 @@ const TranscriptCreate = () => {
|
|||||||
const send = () => {
|
const send = () => {
|
||||||
if (loadingRecord || createTranscript.loading || permissionDenied) return;
|
if (loadingRecord || createTranscript.loading || permissionDenied) return;
|
||||||
setLoadingRecord(true);
|
setLoadingRecord(true);
|
||||||
createTranscript.create({ name, target_language: getTargetLanguage() });
|
createTranscript.create({
|
||||||
|
name,
|
||||||
|
target_language: getTargetLanguage(),
|
||||||
|
source_kind: "live" as SourceKind,
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const uploadFile = () => {
|
const uploadFile = () => {
|
||||||
if (loadingUpload || createTranscript.loading || permissionDenied) return;
|
if (loadingUpload || createTranscript.loading || permissionDenied) return;
|
||||||
setLoadingUpload(true);
|
setLoadingUpload(true);
|
||||||
createTranscript.create({ name, target_language: getTargetLanguage() });
|
createTranscript.create({
|
||||||
|
name,
|
||||||
|
target_language: getTargetLanguage(),
|
||||||
|
source_kind: "file" as SourceKind,
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|||||||
@@ -133,6 +133,16 @@ export const $CreateTranscript = {
|
|||||||
title: "Target Language",
|
title: "Target Language",
|
||||||
default: "en",
|
default: "en",
|
||||||
},
|
},
|
||||||
|
source_kind: {
|
||||||
|
anyOf: [
|
||||||
|
{
|
||||||
|
$ref: "#/components/schemas/SourceKind",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "null",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
},
|
},
|
||||||
type: "object",
|
type: "object",
|
||||||
required: ["name"],
|
required: ["name"],
|
||||||
@@ -1031,11 +1041,25 @@ export const $RoomDetails = {
|
|||||||
title: "Is Shared",
|
title: "Is Shared",
|
||||||
},
|
},
|
||||||
webhook_url: {
|
webhook_url: {
|
||||||
type: "string",
|
anyOf: [
|
||||||
|
{
|
||||||
|
type: "string",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "null",
|
||||||
|
},
|
||||||
|
],
|
||||||
title: "Webhook Url",
|
title: "Webhook Url",
|
||||||
},
|
},
|
||||||
webhook_secret: {
|
webhook_secret: {
|
||||||
type: "string",
|
anyOf: [
|
||||||
|
{
|
||||||
|
type: "string",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "null",
|
||||||
|
},
|
||||||
|
],
|
||||||
title: "Webhook Secret",
|
title: "Webhook Secret",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -1091,10 +1115,17 @@ export const $SearchResponse = {
|
|||||||
description: "Total number of search results",
|
description: "Total number of search results",
|
||||||
},
|
},
|
||||||
query: {
|
query: {
|
||||||
type: "string",
|
anyOf: [
|
||||||
minLength: 0,
|
{
|
||||||
|
type: "string",
|
||||||
|
minLength: 1,
|
||||||
|
description: "Search query text",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "null",
|
||||||
|
},
|
||||||
|
],
|
||||||
title: "Query",
|
title: "Query",
|
||||||
description: "Search query text",
|
|
||||||
},
|
},
|
||||||
limit: {
|
limit: {
|
||||||
type: "integer",
|
type: "integer",
|
||||||
@@ -1111,7 +1142,7 @@ export const $SearchResponse = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
type: "object",
|
type: "object",
|
||||||
required: ["results", "total", "query", "limit", "offset"],
|
required: ["results", "total", "limit", "offset"],
|
||||||
title: "SearchResponse",
|
title: "SearchResponse",
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ export type CreateTranscript = {
|
|||||||
name: string;
|
name: string;
|
||||||
source_language?: string;
|
source_language?: string;
|
||||||
target_language?: string;
|
target_language?: string;
|
||||||
|
source_kind?: SourceKind | null;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type DeletionStatus = {
|
export type DeletionStatus = {
|
||||||
@@ -191,8 +192,8 @@ export type RoomDetails = {
|
|||||||
recording_type: string;
|
recording_type: string;
|
||||||
recording_trigger: string;
|
recording_trigger: string;
|
||||||
is_shared: boolean;
|
is_shared: boolean;
|
||||||
webhook_url: string;
|
webhook_url: string | null;
|
||||||
webhook_secret: string;
|
webhook_secret: string | null;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type RtcOffer = {
|
export type RtcOffer = {
|
||||||
@@ -206,10 +207,7 @@ export type SearchResponse = {
|
|||||||
* Total number of search results
|
* Total number of search results
|
||||||
*/
|
*/
|
||||||
total: number;
|
total: number;
|
||||||
/**
|
query?: string | null;
|
||||||
* Search query text
|
|
||||||
*/
|
|
||||||
query: string;
|
|
||||||
/**
|
/**
|
||||||
* Results per page
|
* Results per page
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user