diff --git a/src/main/events/cloud-save/get-game-backup-preview.ts b/src/main/events/cloud-save/get-game-backup-preview.ts index 65f6e98a..daffa487 100644 --- a/src/main/events/cloud-save/get-game-backup-preview.ts +++ b/src/main/events/cloud-save/get-game-backup-preview.ts @@ -1,13 +1,21 @@ import { registerEvent } from "../register-event"; import type { GameShop } from "@types"; import { Ludusavi } from "@main/services"; +import { gameRepository } from "@main/repository"; const getGameBackupPreview = async ( _event: Electron.IpcMainInvokeEvent, objectId: string, shop: GameShop ) => { - return Ludusavi.getBackupPreview(shop, objectId); + const game = await gameRepository.findOne({ + where: { + objectID: objectId, + shop, + }, + }); + + return Ludusavi.getBackupPreview(shop, objectId, game?.winePrefixPath); }; registerEvent("getGameBackupPreview", getGameBackupPreview); diff --git a/src/main/services/ludusavi.ts b/src/main/services/ludusavi.ts index 34144102..746c6a22 100644 --- a/src/main/services/ludusavi.ts +++ b/src/main/services/ludusavi.ts @@ -52,12 +52,13 @@ export class Ludusavi { static async getBackupPreview( _shop: GameShop, - objectId: string + objectId: string, + winePrefix?: string | null ): Promise { const config = await this.getConfig(); const backupData = await this.worker.run( - { title: objectId, preview: true }, + { title: objectId, winePrefix, preview: true }, { name: "backupGame" } );