From 9de8a3d40a1a1ae6c5c387c998eb5be96aff9544 Mon Sep 17 00:00:00 2001 From: Manav Rathi Date: Wed, 24 Apr 2024 13:19:37 +0530 Subject: [PATCH] Fixes --- web/apps/cast/src/pages/slideshow.tsx | 2 +- .../cast/src/services/castDownloadManager.ts | 2 +- web/apps/photos/src/services/ffmpeg.ts | 19 +++++-------------- 3 files changed, 7 insertions(+), 16 deletions(-) diff --git a/web/apps/cast/src/pages/slideshow.tsx b/web/apps/cast/src/pages/slideshow.tsx index 000d18380..d13a26346 100644 --- a/web/apps/cast/src/pages/slideshow.tsx +++ b/web/apps/cast/src/pages/slideshow.tsx @@ -1,7 +1,7 @@ +import { FILE_TYPE } from "@/media/file"; import log from "@/next/log"; import PairedSuccessfullyOverlay from "components/PairedSuccessfullyOverlay"; import { PhotoAuditorium } from "components/PhotoAuditorium"; -import { FILE_TYPE } from "@/media/file"; import { useRouter } from "next/router"; import { useEffect, useState } from "react"; import { diff --git a/web/apps/cast/src/services/castDownloadManager.ts b/web/apps/cast/src/services/castDownloadManager.ts index 1b890fbbc..40a5f25af 100644 --- a/web/apps/cast/src/services/castDownloadManager.ts +++ b/web/apps/cast/src/services/castDownloadManager.ts @@ -1,8 +1,8 @@ +import { FILE_TYPE } from "@/media/file"; import ComlinkCryptoWorker from "@ente/shared/crypto"; import { CustomError } from "@ente/shared/error"; import HTTPService from "@ente/shared/network/HTTPService"; import { getCastFileURL } from "@ente/shared/network/api"; -import { FILE_TYPE } from "@/media/file"; import { EnteFile } from "types/file"; import { generateStreamFromArrayBuffer } from "utils/file"; diff --git a/web/apps/photos/src/services/ffmpeg.ts b/web/apps/photos/src/services/ffmpeg.ts index 58b182e73..f6f4b017d 100644 --- a/web/apps/photos/src/services/ffmpeg.ts +++ b/web/apps/photos/src/services/ffmpeg.ts @@ -105,9 +105,7 @@ export async function extractVideoMetadata(file: File | ElectronFile) { file, `metadata.txt`, ); - return parseFFmpegExtractedMetadata( - new Uint8Array(await metadata.arrayBuffer()), - ); + return parseFFmpegExtractedMetadata(metadata); } enum MetadataTags { @@ -236,9 +234,10 @@ const ffmpegExec2 = async ( inputFile: File | ElectronFile, outputFileName: string, timeoutMS: number = 0, -): Promise => { +) => { const electron = globalThis.electron; if (electron || false) { + throw new Error("WIP"); // return electron.ffmpegExec( // command, // /* TODO(MR): ElectronFile changes */ @@ -247,16 +246,8 @@ const ffmpegExec2 = async ( // timeoutMS, // ); } else { - return workerFactory - .lazy() - .then((worker) => - worker.execute( - command, - /* TODO(MR): ElectronFile changes */ inputFile as File, - outputFileName, - timeoutMS, - ), - ); + /* TODO(MR): ElectronFile changes */ + return ffmpegExecWeb(command, inputFile as File, timeoutMS); } };