Open source Loom alternative. Beautiful, shareable screen recordings.
Rust appcapcossloommacnextjsnextjs15open-sourceossreactrecordrustscreen-capturescreen-recorderscreenshotsolidjstauritauri-apptypescriptvite
fix: give non-MP4 Loom sources a WebM original destination
Richie McIlroy68696478f792
diff --git a/apps/web/__tests__/unit/media-processing-workflows.test.ts b/apps/web/__tests__/unit/media-processing-workflows.test.tsindex 8a7bd4942..a5dc6faad 100644--- a/apps/web/__tests__/unit/media-processing-workflows.test.ts+++ b/apps/web/__tests__/unit/media-processing-workflows.test.ts@@ -281,12 +281,14 @@ describe("media processing workflows", () => {});expect(body.sourcePresignedUrl).toBeUndefined();expect(body.sourceUpload).toBeUndefined();- expect(body.originalUpload).toBeUndefined();- expect(mocks.remove).not.toHaveBeenCalled();});- it("gives DASH downloads a WebM original destination", async () => {- mocks.loomSourceUrl = "https://luna.loom.com/id/x/playlist.mpd";+ it.each([+ "https://luna.loom.com/id/x/playlist.mpd",+ "https://luna.loom.com/id/x/playlist.m3u8",+ "https://luna.loom.com/id/x/raw.webm",+ ])("gives %s a WebM original destination", async (url) => {+ mocks.loomSourceUrl = url;mocks.rows = [[video], [pending], [], [metadata]];await importLoomVideoWorkflow(payload);expect(dispatchedBody()?.originalUpload).toEqual({diff --git a/apps/web/workflows/import-loom-video.ts b/apps/web/workflows/import-loom-video.tsindex 258283ff3..e7409bb6d 100644--- a/apps/web/workflows/import-loom-video.ts+++ b/apps/web/workflows/import-loom-video.ts@@ -65,8 +65,8 @@ function isStreamingUrl(url: string): boolean {return path.endsWith(".m3u8") || path.endsWith(".mpd");}-function isDashUrl(url: string): boolean {- return (url.split("?")[0] ?? "").toLowerCase().endsWith(".mpd");+function isMp4Url(url: string): boolean {+ return (url.split("?")[0] ?? "").toLowerCase().endsWith(".mp4");}type LoomWorker = "importer" | "media";@@ -508,7 +508,7 @@ async function processVideoOnMediaServer(throw new FatalError("MEDIA_SERVER_URL is not configured");}const originalKey =- worker === "importer" && loomSourceUrl && isDashUrl(loomSourceUrl)+ worker === "importer" && loomSourceUrl && !isMp4Url(loomSourceUrl)? `${userId}/${videoId}/raw-upload.webm`: undefined;