diff --git a/src/services/exportService.ts b/src/services/exportService.ts index 87a438fb6..8154e4821 100644 --- a/src/services/exportService.ts +++ b/src/services/exportService.ts @@ -483,16 +483,16 @@ class ExportService { motionPhoto.videoNameTitle, file.id ); - this.saveMediaFile(collectionPath, videoSaveName, videoStream); + await this.saveMediaFile(collectionPath, videoSaveName, videoStream); await this.saveMetadataFile(collectionPath, videoSaveName, file); } - private saveMediaFile( + private async saveMediaFile( collectionFolderPath: string, fileSaveName: string, fileStream: ReadableStream ) { - this.electronAPIs.saveStreamToDisk( + await this.electronAPIs.saveStreamToDisk( getFileSavePath(collectionFolderPath, fileSaveName), fileStream ); diff --git a/src/types/electron/index.ts b/src/types/electron/index.ts index 987b774f7..add80532e 100644 --- a/src/types/electron/index.ts +++ b/src/types/electron/index.ts @@ -13,7 +13,10 @@ export interface ElectronAPIs { oldDirPath: string, newDirPath: string ) => Promise; - saveStreamToDisk: (path: string, fileStream: ReadableStream) => void; + saveStreamToDisk: ( + path: string, + fileStream: ReadableStream + ) => Promise; saveFileToDisk: (path: string, file: any) => Promise; selectRootDirectory: () => Promise; sendNotification: (content: string) => void;