refactor: remove unnecessary download key deletion in game installer actions and simplify file size handling in download manager

This commit is contained in:
Moyasee
2026-01-25 10:40:38 +02:00
parent c9afd65536
commit d4bd8f7bf1
6 changed files with 18 additions and 14 deletions

View File

@@ -22,7 +22,6 @@ const getGameInstallerActionType = async (
);
if (!fs.existsSync(gamePath)) {
await downloadsSublevel.del(downloadKey);
return "open-folder";
}

View File

@@ -38,7 +38,6 @@ const openGameInstaller = async (
);
if (!fs.existsSync(gamePath)) {
await downloadsSublevel.del(downloadKey);
return true;
}

View File

@@ -2,7 +2,6 @@ import { registerEvent } from "../register-event";
import type { Download, StartGameDownloadPayload } from "@types";
import { DownloadManager, HydraApi, logger } from "@main/services";
import { createGame } from "@main/services/library-sync";
import { parseBytes } from "@shared";
import { downloadsSublevel, gamesSublevel, levelKeys } from "@main/level";
import { handleDownloadError, prepareGameEntry } from "@main/helpers";
@@ -18,7 +17,6 @@ const startGameDownload = async (
downloader,
uri,
automaticallyExtract,
fileSize,
} = payload;
const gameKey = levelKeys.game(shop, objectId);
@@ -48,7 +46,7 @@ const startGameDownload = async (
downloader,
uri,
folderName: null,
fileSize: parseBytes(fileSize ?? null),
fileSize: null,
shouldSeed: false,
timestamp: Date.now(),
queued: true,