Merge branch 'feature/cloud-sync' into feature/game-achievements

# Conflicts:
#	src/main/services/achievements/achievement-watcher.ts
#	src/main/services/achievements/update-local-unlocked-achivements.ts
#	src/main/services/hydra-api.ts
This commit is contained in:
Zamitto
2024-10-21 15:31:26 -03:00
24 changed files with 288 additions and 255 deletions

View File

@@ -9,9 +9,8 @@ import { uploadGamesBatch } from "./library-sync";
import { clearGamesRemoteIds } from "./library-sync/clear-games-remote-id";
import { logger } from "./logger";
import { UserNotLoggedInError, SubscriptionRequiredError } from "@shared";
// import { omit } from "lodash-es";
import { appVersion } from "@main/constants";
import { omit } from "lodash-es";
import { appVersion } from "@main/constants";
interface HydraApiOptions {
needsAuth?: boolean;

View File

@@ -7,9 +7,6 @@ import path from "node:path";
import YAML from "yaml";
import ludusaviWorkerPath from "../workers/ludusavi.worker?modulePath";
import axios from "axios";
let a: Record<string, string> | null = null;
export class Ludusavi {
private static ludusaviPath = path.join(app.getPath("appData"), "ludusavi");
@@ -65,26 +62,14 @@ export class Ludusavi {
}
static async getBackupPreview(
_shop: GameShop,
shop: GameShop,
objectId: string,
backupPath: string
): Promise<LudusaviBackup | null> {
if (!a) {
await axios
.get(
"https://gist.githubusercontent.com/thegrannychaseroperation/b23d53e654e3ea060066a5c01b0cacc8/raw/57bf254a1c99dab9315136f660ff7b3d547de215/keys.json"
)
.then((response) => {
a = response.data;
return response.data;
});
}
const games = await this.findGames(shop, objectId);
const game = a?.[objectId];
// if (!games.length) return null;
// const [game] = games;
if (!games.length) return null;
const [game] = games;
const backupData = await this.worker.run(
{ title: game, backupPath, preview: true },