refactor: clean up code

This commit is contained in:
Hachi-R
2024-12-22 20:20:46 -03:00
parent 859d849d36
commit db01980eb8
7 changed files with 15 additions and 37 deletions

View File

@@ -8,11 +8,9 @@ const pauseGameSeed = async (
_event: Electron.IpcMainInvokeEvent,
gameId: number
) => {
await dataSource.transaction(async (transactionalEntityManager) => {
await transactionalEntityManager
.getRepository(Game)
.update({ id: gameId }, { status: "complete", shouldSeed: false });
});
await dataSource
.getRepository(Game)
.update({ id: gameId }, { status: "complete", shouldSeed: false });
await DownloadManager.cancelDownload(gameId);
};

View File

@@ -20,11 +20,9 @@ const resumeGameSeed = async (
if (!game) return;
await dataSource.transaction(async (transactionalEntityManager) => {
await transactionalEntityManager
.getRepository(Game)
.update({ id: gameId }, { status: "seeding", shouldSeed: true });
});
await dataSource
.getRepository(Game)
.update({ id: gameId }, { status: "seeding", shouldSeed: true });
await DownloadManager.startDownload(game);
};