diff --git a/src/main/events/torrenting/pause-game-seed.ts b/src/main/events/torrenting/pause-game-seed.ts index 9daa4d7b..5ba7b4ce 100644 --- a/src/main/events/torrenting/pause-game-seed.ts +++ b/src/main/events/torrenting/pause-game-seed.ts @@ -1,16 +1,15 @@ import { registerEvent } from "../register-event"; - import { DownloadManager } from "@main/services"; -import { dataSource } from "@main/data-source"; -import { Game } from "@main/entity"; +import { gameRepository } from "@main/repository"; const pauseGameSeed = async ( _event: Electron.IpcMainInvokeEvent, gameId: number ) => { - await dataSource - .getRepository(Game) - .update({ id: gameId }, { status: "complete", shouldSeed: false }); + await gameRepository.update(gameId, { + status: "complete", + shouldSeed: false, + }); await DownloadManager.cancelDownload(gameId); }; diff --git a/src/main/events/torrenting/resume-game-seed.ts b/src/main/events/torrenting/resume-game-seed.ts index 59a56012..cee0a527 100644 --- a/src/main/events/torrenting/resume-game-seed.ts +++ b/src/main/events/torrenting/resume-game-seed.ts @@ -1,9 +1,6 @@ import { registerEvent } from "../register-event"; import { gameRepository } from "../../repository"; - import { DownloadManager } from "@main/services"; -import { dataSource } from "@main/data-source"; -import { Game } from "@main/entity"; const resumeGameSeed = async ( _event: Electron.IpcMainInvokeEvent, @@ -20,9 +17,10 @@ const resumeGameSeed = async ( if (!game) return; - await dataSource - .getRepository(Game) - .update({ id: gameId }, { status: "seeding", shouldSeed: true }); + await gameRepository.update(gameId, { + status: "seeding", + shouldSeed: true, + }); await DownloadManager.startDownload(game); };