(
videoId: string,
metadata: { duration: number; width: number; height: number; fps: number },
)
| 417 | } |
| 418 | |
| 419 | async function saveMetadataAndComplete( |
| 420 | videoId: string, |
| 421 | metadata: { duration: number; width: number; height: number; fps: number }, |
| 422 | ): Promise<void> { |
| 423 | "use step"; |
| 424 | |
| 425 | const duration = getValidDuration(metadata.duration); |
| 426 | |
| 427 | await db() |
| 428 | .update(videos) |
| 429 | .set({ |
| 430 | width: metadata.width, |
| 431 | height: metadata.height, |
| 432 | fps: metadata.fps, |
| 433 | ...(duration === undefined ? {} : { duration }), |
| 434 | }) |
| 435 | .where(eq(videos.id, videoId as Video.VideoId)); |
| 436 | |
| 437 | await db() |
| 438 | .delete(videoUploads) |
| 439 | .where(eq(videoUploads.videoId, videoId as Video.VideoId)); |
| 440 | } |
| 441 | |
| 442 | async function cleanupRawUpload( |
| 443 | videoId: string, |
no test coverage detected