This commit is contained in:
Manav Rathi 2024-04-24 13:19:37 +05:30
parent e919dfd09d
commit 9de8a3d40a
No known key found for this signature in database
3 changed files with 7 additions and 16 deletions

View file

@ -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 {

View file

@ -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";

View file

@ -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<File | ElectronFile> => {
) => {
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);
}
};