chore: sync with main

This commit is contained in:
Hydra
2024-04-20 00:42:31 +01:00
22 changed files with 182 additions and 61 deletions

View File

@@ -1,7 +1,8 @@
import path from "node:path";
import cp from "node:child_process";
import fs from "node:fs";
import * as Sentry from "@sentry/electron/main";
import { Notification, app } from "electron";
import { Notification, app, dialog } from "electron";
import type { QueryDeepPartialEntity } from "typeorm/query-builder/QueryPartialEntity";
import { Game } from "@main/entity";
@@ -54,6 +55,15 @@ export class TorrentClient {
binaryName
);
if (!fs.existsSync(binaryPath)) {
dialog.showErrorBox(
"Fatal",
"Hydra download manager binary not found. Please check if it has been removed by Windows Defender."
);
app.quit();
}
cp.spawn(binaryPath, commonArgs, {
stdio: "inherit",
windowsHide: true,
@@ -155,7 +165,6 @@ export class TorrentClient {
}
} catch (err) {
Sentry.captureException(err);
Sentry.captureMessage(message, "error");
}
}
}