From 855f0aa334fff6407824c1ea28ec8508c8c9e868 Mon Sep 17 00:00:00 2001 From: Hachi-R Date: Sun, 22 Dec 2024 18:50:19 -0300 Subject: [PATCH] refactor: remove commented-out code in download-manager.ts --- .../services/download/download-manager.ts | 57 +------------------ 1 file changed, 1 insertion(+), 56 deletions(-) diff --git a/src/main/services/download/download-manager.ts b/src/main/services/download/download-manager.ts index 7c57300e..a4106fef 100644 --- a/src/main/services/download/download-manager.ts +++ b/src/main/services/download/download-manager.ts @@ -84,7 +84,7 @@ export class DownloadManager { public static async watchDownloads() { const status = await this.getDownloadStatus(); - // // status = await RealDebridDownloader.getStatus(); + // status = await RealDebridDownloader.getStatus(); if (status) { const { gameId, progress } = status; @@ -180,61 +180,6 @@ export class DownloadManager { "on-seeding-status", JSON.parse(JSON.stringify(seedStatus.data)) ); - - // const gamesToSeed = await gameRepository.find({ - // where: { shouldSeed: true, isDeleted: false }, - // }); - // if (gamesToSeed.length === 0) return; - // const seedStatus = await PythonRPC.rpc - // .get("/seed-status") - // .then((results) => { - // if (results === null) return []; - // return results.data; - // }); - // if (!seedStatus.length === 0) { - // for (const game of gamesToSeed) { - // if (game.uri && game.downloadPath) { - // await this.resumeSeeding(game.id, game.uri, game.downloadPath); - // } - // } - // } - // const gameIds = seedStatus.map((status) => status.gameId); - // for (const gameId of gameIds) { - // const game = await gameRepository.findOne({ - // where: { id: gameId }, - // }); - // if (game) { - // const isNotDeleted = fs.existsSync( - // path.join(game.downloadPath!, game.folderName!) - // ); - // if (!isNotDeleted) { - // await this.pauseSeeding(game.id); - // await gameRepository.update(game.id, { - // status: "complete", - // shouldSeed: false, - // }); - // WindowManager.mainWindow?.webContents.send("on-hard-delete"); - // } - // } - // } - // const updateList = await gameRepository.find({ - // where: { - // id: In(gameIds), - // status: Not(In(["complete", "seeding"])), - // shouldSeed: true, - // isDeleted: false, - // }, - // }); - // if (updateList.length > 0) { - // await gameRepository.update( - // { id: In(updateList.map((game) => game.id)) }, - // { status: "seeding" } - // ); - // } - // WindowManager.mainWindow?.webContents.send( - // "on-seeding-status", - // JSON.parse(JSON.stringify(seedStatus)) - // ); } static async pauseDownload() {