mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-01-23 05:24:55 +03:00
Merge branch 'feature/seed-completed-downloads' into feat/achievements-points
This commit is contained in:
commit
c20369fa57
@ -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);
|
||||
};
|
||||
|
@ -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);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user