fix: removing decompression
Some checks failed
Lint / lint (push) Has been cancelled

This commit is contained in:
Hydra 2024-05-12 13:34:06 +01:00
parent c29f28dbdd
commit 50a2185ad7
No known key found for this signature in database

View file

@ -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
// );
}); });
} }
} }