feat: adding artifact limit

This commit is contained in:
Chubby Granny Chaser
2024-10-21 19:19:18 +01:00
parent 2599b332fd
commit 34a33ccef3
24 changed files with 290 additions and 255 deletions

View File

@@ -15,7 +15,7 @@ const getCatalogue = async (
});
const response = await HydraApi.get<{ objectId: string; shop: GameShop }[]>(
`/games/${category}?${params.toString()}`,
`/catalogue/${category}?${params.toString()}`,
{},
{ needsAuth: false }
);

View File

@@ -66,6 +66,7 @@ import "./cloud-save/upload-save-game";
import "./cloud-save/delete-game-artifact";
import "./notifications/publish-new-repacks-notification";
import { isPortableVersion } from "@main/helpers";
import "./misc/show-item-in-folder";
ipcMain.handle("ping", () => "pong");
ipcMain.handle("getVersion", () => appVersion);

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 },