mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-01-31 06:41:03 +00:00
refactor: remove unnecessary download key deletion in game installer actions and simplify file size handling in download manager
This commit is contained in:
@@ -22,7 +22,6 @@ const getGameInstallerActionType = async (
|
||||
);
|
||||
|
||||
if (!fs.existsSync(gamePath)) {
|
||||
await downloadsSublevel.del(downloadKey);
|
||||
return "open-folder";
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +38,6 @@ const openGameInstaller = async (
|
||||
);
|
||||
|
||||
if (!fs.existsSync(gamePath)) {
|
||||
await downloadsSublevel.del(downloadKey);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user