mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-01-23 21:44:55 +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 YAML from "yaml";
|
||||||
|
|
||||||
import ludusaviWorkerPath from "../workers/ludusavi.worker?modulePath";
|
import ludusaviWorkerPath from "../workers/ludusavi.worker?modulePath";
|
||||||
|
import axios from "axios";
|
||||||
|
|
||||||
|
let a = null;
|
||||||
|
|
||||||
export class Ludusavi {
|
export class Ludusavi {
|
||||||
private static ludusaviPath = path.join(app.getPath("appData"), "ludusavi");
|
private static ludusaviPath = path.join(app.getPath("appData"), "ludusavi");
|
||||||
@ -66,16 +69,27 @@ export class Ludusavi {
|
|||||||
objectId: string,
|
objectId: string,
|
||||||
backupPath: string
|
backupPath: string
|
||||||
): Promise<LudusaviBackup | null> {
|
): Promise<LudusaviBackup | null> {
|
||||||
console.log("a");
|
if (!a) {
|
||||||
const games = await this.findGames(shop, objectId);
|
await axios
|
||||||
if (!games.length) return null;
|
.get(
|
||||||
console.log("b");
|
"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(
|
const backupData = await this.worker.run(
|
||||||
{ title: games[0], backupPath, preview: true },
|
{ title: game, backupPath, preview: true },
|
||||||
{ name: "backupGame" }
|
{ name: "backupGame" }
|
||||||
);
|
);
|
||||||
console.log("c");
|
|
||||||
|
|
||||||
return backupData;
|
return backupData;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user