mirror of
https://github.com/fsolla/teqo.git
synced 2026-11-16 03:03:06 +00:00
Seleção do C166 ganha "Cortar vídeo": título/descrição por IA (editáveis, com fallback determinístico), job assíncrono com ffmpeg por re-encode exato e polling dos quatro passos, e página pública unlisted /corte/<id> (noindex, OG, crédito CC BY) servindo o mesmo MP4. Collection speechCut com access canReadSpeechCut (advisor/leader negados) e kill switch por status; ffmpeg entra só no runner da imagem com FFMPEG_PATH para teste.
20 lines
682 B
TypeScript
20 lines
682 B
TypeScript
import 'server-only'
|
|
|
|
import config from '@payload-config'
|
|
import { after } from 'next/server'
|
|
import { getPayload } from 'payload'
|
|
|
|
import { runSpeechCutJob } from '@/utilities/speech/speechCutJob'
|
|
|
|
/**
|
|
* C167 — starts the cut after the create/retry response has been sent
|
|
* (`after` from `next/server`), so the POST never waits on the Câmara download
|
|
* or ffmpeg. Kept apart from the job so `speechCutJob` stays importable in a
|
|
* plain Node test without the request lifecycle.
|
|
*/
|
|
export const startSpeechCutJobInBackground = (cutId: number): void => {
|
|
after(async () => {
|
|
const payload = await getPayload({ config })
|
|
await runSpeechCutJob(payload, cutId)
|
|
})
|
|
}
|