mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-02-12 19:22:28 +00:00
This commit is contained in:
parent
c29f28dbdd
commit
50a2185ad7
1 changed files with 19 additions and 18 deletions
|
@ -4,7 +4,7 @@ import path from "node:path";
|
||||||
import fs from "node:fs";
|
import fs from "node:fs";
|
||||||
import EasyDL from "easydl";
|
import EasyDL from "easydl";
|
||||||
import { GameStatus } from "@shared";
|
import { GameStatus } from "@shared";
|
||||||
import { fullArchive } from "node-7z-archive";
|
// import { fullArchive } from "node-7z-archive";
|
||||||
|
|
||||||
import { Downloader } from "./downloader";
|
import { Downloader } from "./downloader";
|
||||||
import { RealDebridClient } from "../real-debrid";
|
import { RealDebridClient } from "../real-debrid";
|
||||||
|
@ -29,19 +29,19 @@ export class RealDebridDownloader extends Downloader {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static async startDecompression(
|
// private static async startDecompression(
|
||||||
rarFile: string,
|
// rarFile: string,
|
||||||
dest: string,
|
// dest: string,
|
||||||
game: Game
|
// game: Game
|
||||||
) {
|
// ) {
|
||||||
await fullArchive(rarFile, dest);
|
// await fullArchive(rarFile, dest);
|
||||||
|
|
||||||
const updatePayload: QueryDeepPartialEntity<Game> = {
|
// const updatePayload: QueryDeepPartialEntity<Game> = {
|
||||||
status: GameStatus.Finished,
|
// status: GameStatus.Finished,
|
||||||
};
|
// };
|
||||||
|
|
||||||
await this.updateGameProgress(game.id, updatePayload, {});
|
// await this.updateGameProgress(game.id, updatePayload, {});
|
||||||
}
|
// }
|
||||||
|
|
||||||
static destroy() {
|
static destroy() {
|
||||||
if (this.download) {
|
if (this.download) {
|
||||||
|
@ -96,7 +96,7 @@ export class RealDebridDownloader extends Downloader {
|
||||||
|
|
||||||
this.download.on("end", async () => {
|
this.download.on("end", async () => {
|
||||||
const updatePayload: QueryDeepPartialEntity<Game> = {
|
const updatePayload: QueryDeepPartialEntity<Game> = {
|
||||||
status: GameStatus.Decompressing,
|
status: GameStatus.Finished,
|
||||||
progress: 1,
|
progress: 1,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -104,11 +104,12 @@ export class RealDebridDownloader extends Downloader {
|
||||||
timeRemaining: 0,
|
timeRemaining: 0,
|
||||||
});
|
});
|
||||||
|
|
||||||
this.startDecompression(
|
/* This has to be improved */
|
||||||
path.join(downloadPath, filename),
|
// this.startDecompression(
|
||||||
downloadPath,
|
// path.join(downloadPath, filename),
|
||||||
game
|
// downloadPath,
|
||||||
);
|
// game
|
||||||
|
// );
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue