Merge branch 'main' into linux-install

This commit is contained in:
Daniel Freitas
2024-05-13 22:41:49 -03:00
committed by GitHub
21 changed files with 1019 additions and 100 deletions

View File

@@ -13,34 +13,33 @@ const addGameToLibrary = async (
gameShop: GameShop,
executablePath: string | null
) => {
const game = await gameRepository.findOne({
where: {
objectID,
},
});
if (game) {
return gameRepository.update(
return gameRepository
.update(
{
id: game.id,
objectID,
},
{
shop: gameShop,
status: null,
executablePath,
isDeleted: false,
}
);
} else {
const iconUrl = await getFileBase64(await getSteamGameIconUrl(objectID));
)
.then(async ({ affected }) => {
if (!affected) {
const iconUrl = await getFileBase64(
await getSteamGameIconUrl(objectID)
);
return gameRepository.insert({
title,
iconUrl,
objectID,
shop: gameShop,
executablePath,
await gameRepository.insert({
title,
iconUrl,
objectID,
shop: gameShop,
executablePath,
});
}
});
}
};
registerEvent(addGameToLibrary, {

View File

@@ -124,21 +124,20 @@ export class TorrentDownloader extends Downloader {
stdio: "inherit",
windowsHide: true,
});
return;
} else {
const scriptPath = path.join(
__dirname,
"..",
"..",
"torrent-client",
"main.py"
);
cp.spawn("python3", [scriptPath, ...commonArgs], {
stdio: "inherit",
});
}
const scriptPath = path.join(
__dirname,
"..",
"..",
"torrent-client",
"main.py"
);
cp.spawn("python3", [scriptPath, ...commonArgs], {
stdio: "inherit",
});
Promise.all([writePipe.createPipe(), readPipe.createPipe()]).then(
async () => {
this.attachListener();

View File

@@ -29,7 +29,7 @@ export const getSteamGridData = async (
const searchParams = new URLSearchParams(params);
if (!import.meta.env.MAIN_VITE_STEAMGRIDDB_API_KEY) {
throw new Error("STEAMGRIDDB_API_KEY is not set");
throw new Error("MAIN_VITE_STEAMGRIDDB_API_KEY is not set");
}
const response = await axios.get(