Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Res

Manav Rathi657a57f46ab4
diff --git a/web/packages/gallery/services/ffmpeg/index.ts b/web/packages/gallery/services/ffmpeg/index.ts
index 57b263c189..3f69fdc520 100644
--- a/web/packages/gallery/services/ffmpeg/index.ts
+++ b/web/packages/gallery/services/ffmpeg/index.ts
@@ -268,7 +268,9 @@ export const convertToMP4 = async (blob: Blob): Promise<Blob | Uint8Array> => {
const convertToMP4Native = async (electron: Electron, blob: Blob) => {
const tokens = await writeVideoStream(electron, "convert-to-mp4", blob);
const token = tokens[0]!;
- const mp4Blob = await readVideoStream(electron, token);
+ const mp4Blob = await readVideoStream(electron, token).then((res) =>
+ res.blob(),
+ );
await videoStreamDone(electron, token);
return mp4Blob;
};
diff --git a/web/packages/gallery/utils/native-stream.ts b/web/packages/gallery/utils/native-stream.ts
index 28187fa711..50934e5afa 100644
--- a/web/packages/gallery/utils/native-stream.ts
+++ b/web/packages/gallery/utils/native-stream.ts
@@ -177,12 +177,12 @@ export const writeVideoStream = async (
*
* @param token A token obtained from {@link writeVideoStream}.
*
- * @returns the contents of the processed video.
+ * @returns a Response that contains the contents of the processed video.
*/
export const readVideoStream = async (
_: Electron,
token: string,
-): Promise<Blob> => {
+): Promise<Response> => {
const params = new URLSearchParams({ token });
const url = new URL(`stream://video?${params.toString()}`);
@@ -194,7 +194,7 @@ export const readVideoStream = async (
`Failed to read stream from ${url.href}: HTTP ${res.status}`,
);
- return res.blob();
+ return res;
};
/**