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

Function clearTranscriptObjects

apps/web/workflows/edit-video.ts:522–535  ·  view source on GitHub ↗
(video: typeof videos.$inferSelect)

Source from the content-addressed store, hash-verified

520}
521
522async function clearTranscriptObjects(video: typeof videos.$inferSelect) {
523 const [bucket] = await Storage.getAccessForVideo(
524 decodeStorageVideo(video),
525 ).pipe(runPromise);
526 const prefix = `${video.ownerId}/${video.id}/transcription`;
527 const listed = await bucket.listObjects({ prefix }).pipe(runPromise);
528 const objects = (listed.Contents ?? [])
529 .map((object) => ({ Key: object.Key }))
530 .filter((object): object is { Key: string } => Boolean(object.Key));
531
532 if (objects.length > 0) {
533 await bucket.deleteObjects(objects).pipe(runPromise);
534 }
535}
536
537async function waitForEditCompletion(
538 videoId: string,

Callers 1

Calls 1

decodeStorageVideoFunction · 0.90

Tested by

no test coverage detected