mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-01-23 13:34:54 +03:00
feat: adding file parser
This commit is contained in:
parent
0567674f2a
commit
fbae552b1b
@ -7,6 +7,9 @@ import path from "node:path";
|
||||
import YAML from "yaml";
|
||||
|
||||
import ludusaviWorkerPath from "../workers/ludusavi.worker?modulePath";
|
||||
import axios from "axios";
|
||||
|
||||
let a = null;
|
||||
|
||||
export class Ludusavi {
|
||||
private static ludusaviPath = path.join(app.getPath("appData"), "ludusavi");
|
||||
@ -66,16 +69,27 @@ export class Ludusavi {
|
||||
objectId: string,
|
||||
backupPath: string
|
||||
): Promise<LudusaviBackup | null> {
|
||||
console.log("a");
|
||||
const games = await this.findGames(shop, objectId);
|
||||
if (!games.length) return null;
|
||||
console.log("b");
|
||||
if (!a) {
|
||||
await axios
|
||||
.get(
|
||||
"https://gist.githubusercontent.com/thegrannychaseroperation/b23d53e654e3ea060066a5c01b0cacc8/raw/57bf254a1c99dab9315136f660ff7b3d547de215/keys.json"
|
||||
)
|
||||
.then((response) => {
|
||||
a = response.data;
|
||||
return response.data;
|
||||
});
|
||||
}
|
||||
|
||||
const game = a[objectId];
|
||||
|
||||
// if (!games.length) return null;
|
||||
|
||||
// const [game] = games;
|
||||
|
||||
const backupData = await this.worker.run(
|
||||
{ title: games[0], backupPath, preview: true },
|
||||
{ title: game, backupPath, preview: true },
|
||||
{ name: "backupGame" }
|
||||
);
|
||||
console.log("c");
|
||||
|
||||
return backupData;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user