MCPcopy
hub / github.com/CapSoftware/Cap / cleanupTempAudio

Function cleanupTempAudio

apps/web/workflows/transcribe.ts:401–422  ·  view source on GitHub ↗
(
	videoId: string,
	userId: string,
	video: typeof videos.$inferSelect,
)

Source from the content-addressed store, hash-verified

399}
400
401async function cleanupTempAudio(
402 videoId: string,
403 userId: string,
404 video: typeof videos.$inferSelect,
405): Promise<void> {
406 "use step";
407
408 const audioKey = `${userId}/${videoId}/audio-temp.mp3`;
409
410 try {
411 const [bucket] = await Storage.getAccessForVideo(
412 decodeStorageVideo(video),
413 ).pipe(runPromise);
414
415 await bucket.deleteObject(audioKey).pipe(runPromise);
416 } catch (error) {
417 console.error(
418 `[transcribe] Failed to cleanup temp audio file: ${audioKey}`,
419 error,
420 );
421 }
422}
423
424async function queueAiGeneration(
425 videoId: string,

Callers 1

transcribeVideoWorkflowFunction · 0.85

Calls 1

decodeStorageVideoFunction · 0.90

Tested by

no test coverage detected