fix: adding wine prefix to preview

This commit is contained in:
Chubby Granny Chaser
2024-10-22 13:39:41 +01:00
parent bfcf8178d8
commit ceef316a19
2 changed files with 12 additions and 3 deletions

View File

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