mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-01-17 16:33:55 +00:00
feat: disabling button when installing
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { registerEvent } from "../register-event";
|
||||
import { GameShop } from "@types";
|
||||
import path from "node:path";
|
||||
import { _7Zip, GameFilesManager } from "@main/services";
|
||||
import { GameFilesManager } from "@main/services";
|
||||
import { downloadsSublevel, gamesSublevel, levelKeys } from "@main/level";
|
||||
import { FILE_EXTENSIONS_TO_EXTRACT } from "@shared";
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ export const binaryName = {
|
||||
win32: "7z.exe",
|
||||
};
|
||||
|
||||
export class _7Zip {
|
||||
export class SevenZip {
|
||||
private static readonly binaryPath = app.isPackaged
|
||||
? path.join(process.resourcesPath, binaryName[process.platform])
|
||||
: path.join(
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Downloader, DownloadError } from "@shared";
|
||||
import { Downloader, DownloadError, FILE_EXTENSIONS_TO_EXTRACT } from "@shared";
|
||||
import { WindowManager } from "../window-manager";
|
||||
import { publishDownloadCompleteNotification } from "../notifications";
|
||||
import type { Download, DownloadProgress, UserPreferences } from "@types";
|
||||
@@ -22,7 +22,6 @@ import { logger } from "../logger";
|
||||
import { db, downloadsSublevel, gamesSublevel, levelKeys } from "@main/level";
|
||||
import { sortBy } from "lodash-es";
|
||||
import { TorBoxClient } from "./torbox";
|
||||
import { FILE_EXTENSIONS_TO_EXTRACT } from "@shared";
|
||||
import { GameFilesManager } from "../game-files-manager";
|
||||
|
||||
export class DownloadManager {
|
||||
|
||||
@@ -3,7 +3,7 @@ import fs from "node:fs";
|
||||
import type { GameShop } from "@types";
|
||||
import { downloadsSublevel, gamesSublevel, levelKeys } from "@main/level";
|
||||
import { FILE_EXTENSIONS_TO_EXTRACT } from "@shared";
|
||||
import { _7Zip } from "./7zip";
|
||||
import { SevenZip } from "./7zip";
|
||||
import { WindowManager } from "./window-manager";
|
||||
import { publishExtractionCompleteNotification } from "./notifications";
|
||||
import { logger } from "./logger";
|
||||
@@ -45,7 +45,7 @@ export class GameFilesManager {
|
||||
await Promise.all(
|
||||
filesToExtract.map((file) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
_7Zip.extractFile(
|
||||
SevenZip.extractFile(
|
||||
{
|
||||
filePath: path.join(directoryPath, file),
|
||||
cwd: directoryPath,
|
||||
@@ -120,7 +120,7 @@ export class GameFilesManager {
|
||||
path.parse(download.folderName!).name
|
||||
);
|
||||
|
||||
_7Zip.extractFile(
|
||||
SevenZip.extractFile(
|
||||
{
|
||||
filePath,
|
||||
outputPath: extractionPath,
|
||||
|
||||
Reference in New Issue
Block a user