Skip to content

armgit / ente

Public Imported from GitHub
0

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

bg ml and export

Manav Rathie22f74d65306
diff --git a/web/packages/gallery/services/download.ts b/web/packages/gallery/services/download.ts
index 4926ae14de..82f3dc1686 100644
--- a/web/packages/gallery/services/download.ts
+++ b/web/packages/gallery/services/download.ts
@@ -343,8 +343,8 @@ class DownloadManager {
* This is a convenience abstraction over {@link fileStream} that converts
* it into a {@link Blob}.
*/
- async fileBlob(file: EnteFile) {
- return this.fileStream(file).then((s) => new Response(s).blob());
+ async fileBlob(file: EnteFile, opts?: FileDownloadOpts) {
+ return this.fileStream(file, opts).then((s) => new Response(s).blob());
}
/**
@@ -356,6 +356,8 @@ class DownloadManager {
* cached for subsequent use.
*
* @param file The {@link EnteFile} whose data we want.
+ *
+ * @param opts Optional options to modify the download.
*/
async fileStream(
file: EnteFile,
diff --git a/web/packages/new/photos/services/export.ts b/web/packages/new/photos/services/export.ts
index ac638b19ae..2c5ac352bb 100644
--- a/web/packages/new/photos/services/export.ts
+++ b/web/packages/new/photos/services/export.ts
@@ -1014,7 +1014,9 @@ class ExportService {
const electron = ensureElectron();
try {
const fileUID = getExportRecordFileUID(file);
- const originalFileStream = await downloadManager.fileStream(file);
+ const originalFileStream = await downloadManager.fileStream(file, {
+ background: true,
+ });
if (file.metadata.fileType === FileType.livePhoto) {
await this.exportLivePhoto(
exportDir,
diff --git a/web/packages/new/photos/services/ml/blob.ts b/web/packages/new/photos/services/ml/blob.ts
index 9752418dd6..0039fa4091 100644
--- a/web/packages/new/photos/services/ml/blob.ts
+++ b/web/packages/new/photos/services/ml/blob.ts
@@ -164,7 +164,9 @@ export const fetchRenderableEnteFileBlob = async (
return new Blob([thumbnailData!]);
}
- const originalFileBlob = await downloadManager.fileBlob(file);
+ const originalFileBlob = await downloadManager.fileBlob(file, {
+ background: true,
+ });
if (fileType == FileType.livePhoto) {
const { imageFileName, imageData } = await decodeLivePhoto(