mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-01-20 01:33:56 +00:00
feat: improving cloud sync manual mapping
This commit is contained in:
@@ -122,12 +122,9 @@ const downloadGameArtifact = async (
|
||||
cwd: backupPath,
|
||||
})
|
||||
.then(async () => {
|
||||
const [game] = await Ludusavi.findGames(shop, objectId);
|
||||
if (!game) throw new Error("Game not found in Ludusavi manifest");
|
||||
|
||||
replaceLudusaviBackupWithCurrentUser(
|
||||
backupPath,
|
||||
game.replaceAll(":", "_"),
|
||||
objectId,
|
||||
normalizePath(homeDir)
|
||||
);
|
||||
|
||||
|
||||
@@ -1,17 +1,13 @@
|
||||
import { registerEvent } from "../register-event";
|
||||
import type { GameShop } from "@types";
|
||||
import { Ludusavi } from "@main/services";
|
||||
import path from "node:path";
|
||||
import { backupsPath } from "@main/constants";
|
||||
|
||||
const getGameBackupPreview = async (
|
||||
_event: Electron.IpcMainInvokeEvent,
|
||||
objectId: string,
|
||||
shop: GameShop
|
||||
) => {
|
||||
const backupPath = path.join(backupsPath, `${shop}-${objectId}`);
|
||||
|
||||
return Ludusavi.getBackupPreview(shop, objectId, backupPath);
|
||||
return Ludusavi.getBackupPreview(shop, objectId);
|
||||
};
|
||||
|
||||
registerEvent("getGameBackupPreview", getGameBackupPreview);
|
||||
|
||||
14
src/main/events/cloud-save/select-game-backup-path.ts
Normal file
14
src/main/events/cloud-save/select-game-backup-path.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { registerEvent } from "../register-event";
|
||||
import type { GameShop } from "@types";
|
||||
import { Ludusavi } from "@main/services";
|
||||
|
||||
const selectGameBackupPath = async (
|
||||
_event: Electron.IpcMainInvokeEvent,
|
||||
_shop: GameShop,
|
||||
objectId: string,
|
||||
backupPath: string | null
|
||||
) => {
|
||||
return Ludusavi.addCustomGame(objectId, backupPath);
|
||||
};
|
||||
|
||||
registerEvent("selectGameBackupPath", selectGameBackupPath);
|
||||
Reference in New Issue
Block a user