Merge branch 'feature/seed-completed-downloads' into feat/achievements-points

This commit is contained in:
Zamitto 2024-12-22 21:21:27 -03:00
commit c20369fa57
2 changed files with 9 additions and 12 deletions

View File

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

View File

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