mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-12-04 15:14:10 +00:00
feat(video): add video transcripts (#559)
* feat(video): generate transcripts with the local embedding server * feat(video): show saved transcripts in the player * fix(video): preserve transcript seek timestamps * fix(video): refine transcript viewing and generation * feat(video): resize transcripts and follow playback earlier * fix(video): animate transcript playback scrolling * fix(video): transcribe from the smallest full proxy * fix(video): refine the sync to playback button * feat(video): edit transcript segment text inline * fix(video): keep transcript segment highlighted over edit button * docs(video): note embedding server version for transcripts
This commit is contained in:
@@ -18,6 +18,10 @@ export function registerWorkflowTrigger(cb: WorkflowTriggerCallback) {
|
||||
onWorkflowTaskCreated = cb
|
||||
}
|
||||
|
||||
export async function notifyWorkflowTaskCreated(task: WorkflowTask): Promise<void> {
|
||||
if (task.status === 'pending') await onWorkflowTaskCreated?.(task)
|
||||
}
|
||||
|
||||
// Global callback for workflow task cancellation (decouples db/core packages from workflow engine)
|
||||
type WorkflowCancelCallback = (taskId: string) => Promise<void>
|
||||
let onWorkflowTaskCancelled: WorkflowCancelCallback | null = null
|
||||
@@ -149,9 +153,7 @@ function createPrismaClient() {
|
||||
workflowTask: {
|
||||
async create({ args, query }) {
|
||||
const result = await query(args)
|
||||
if (onWorkflowTaskCreated && (result as WorkflowTask).status === 'pending') {
|
||||
onWorkflowTaskCreated(result as WorkflowTask).catch(console.error)
|
||||
}
|
||||
notifyWorkflowTaskCreated(result as WorkflowTask).catch(console.error)
|
||||
return result
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user