chore: merge with main

This commit is contained in:
Chubby Granny Chaser
2025-04-12 21:27:03 +01:00
4 changed files with 24 additions and 12 deletions

View File

@@ -13,35 +13,42 @@ const deleteGameFolder = async (
objectId: string
): Promise<void> => {
const downloadKey = levelKeys.game(shop, objectId);
const download = await downloadsSublevel.get(downloadKey);
if (!download) return;
if (!download?.folderName) return;
if (download.folderName) {
const folderPath = path.join(
download.downloadPath ?? (await getDownloadsPath()),
download.folderName
);
const folderPath = path.join(
download.downloadPath ?? (await getDownloadsPath()),
download.folderName
);
if (fs.existsSync(folderPath)) {
const metaPath = `${folderPath}.meta`;
const deleteFile = async (filePath: string, isDirectory = false) => {
if (fs.existsSync(filePath)) {
await new Promise<void>((resolve, reject) => {
fs.rm(
folderPath,
{ recursive: true, force: true, maxRetries: 5, retryDelay: 200 },
filePath,
{
recursive: isDirectory,
force: true,
maxRetries: 5,
retryDelay: 200,
},
(error) => {
if (error) {
logger.error(error);
reject();
}
resolve();
}
);
});
}
}
};
await deleteFile(folderPath, true);
await deleteFile(metaPath);
await downloadsSublevel.del(downloadKey);
};

View File

@@ -32,6 +32,10 @@ export class PythonRPC {
public static readonly RPC_PORT = "8084";
private static readonly RPC_PASSWORD = crypto.randomBytes(32).toString("hex");
private static readonly binaryPath = app.isPackaged
? path.join(process.resourcesPath, "hydra-httpdl.exe")
: path.join(__dirname, "..", "..", "binaries", "hydra-httpdl.exe");
private static pythonProcess: cp.ChildProcess | null = null;
public static readonly rpc = axios.create({

View File

@@ -81,6 +81,7 @@ export interface UserPreferences {
enableAutoInstall?: boolean;
seedAfterDownloadComplete?: boolean;
showHiddenAchievementsDescription?: boolean;
showDownloadSpeedInMegabits?: boolean;
downloadNotificationsEnabled?: boolean;
repackUpdatesNotificationsEnabled?: boolean;
achievementNotificationsEnabled?: boolean;