(video: typeof videos.$inferSelect)
| 520 | } |
| 521 | |
| 522 | async 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 | |
| 537 | async function waitForEditCompletion( |
| 538 | videoId: string, |
no test coverage detected