feat: adding aria2

This commit is contained in:
Chubby Granny Chaser 2024-05-20 02:21:11 +01:00
parent a89e6760da
commit 4941709296
No known key found for this signature in database
58 changed files with 895 additions and 1329 deletions

View file

@ -5,7 +5,7 @@ import { contextBridge, ipcRenderer } from "electron";
import type {
CatalogueCategory,
GameShop,
TorrentProgress,
DownloadProgress,
UserPreferences,
} from "@types";
@ -32,10 +32,10 @@ contextBridge.exposeInMainWorld("electron", {
ipcRenderer.invoke("pauseGameDownload", gameId),
resumeGameDownload: (gameId: number) =>
ipcRenderer.invoke("resumeGameDownload", gameId),
onDownloadProgress: (cb: (value: TorrentProgress) => void) => {
onDownloadProgress: (cb: (value: DownloadProgress) => void) => {
const listener = (
_event: Electron.IpcRendererEvent,
value: TorrentProgress
value: DownloadProgress
) => cb(value);
ipcRenderer.on("on-download-progress", listener);
return () => ipcRenderer.removeListener("on-download-progress", listener);