Open source Loom alternative. Beautiful, shareable screen recordings.
Rust appcapcossloommacnextjsnextjs15open-sourceossreactrecordrustscreen-capturescreen-recorderscreenshotsolidjstauritauri-apptypescriptvite
fix(api): skip video metadata update when no fields provided
Richie McIlroy13ab388e16a0
diff --git a/apps/web/app/api/upload/[...route]/signed.ts b/apps/web/app/api/upload/[...route]/signed.tsindex 255dd8a12..7e30a8ff2 100644--- a/apps/web/app/api/upload/[...route]/signed.ts+++ b/apps/web/app/api/upload/[...route]/signed.ts@@ -180,17 +180,23 @@ app.post(if (videoIdToUse) {const videoId = Video.VideoId.make(videoIdToUse);- await db()- .update(Db.videos)- .set({- duration: updateIfDefined(durationInSecs, Db.videos.duration),- width: updateIfDefined(width, Db.videos.width),- height: updateIfDefined(height, Db.videos.height),- fps: updateIfDefined(fps, Db.videos.fps),- })- .where(- and(eq(Db.videos.id, videoId), eq(Db.videos.ownerId, user.id)),- );+ if (+ durationInSecs !== undefined ||+ width !== undefined ||+ height !== undefined ||+ fps !== undefined+ )+ await db()+ .update(Db.videos)+ .set({+ duration: updateIfDefined(durationInSecs, Db.videos.duration),+ width: updateIfDefined(width, Db.videos.width),+ height: updateIfDefined(height, Db.videos.height),+ fps: updateIfDefined(fps, Db.videos.fps),+ })+ .where(+ and(eq(Db.videos.id, videoId), eq(Db.videos.ownerId, user.id)),+ );const clientSupportsUploadProgress = isFromDesktopSemver(c.req,