feature: add collections section

This commit is contained in:
Tasheron 2024-07-06 14:56:35 +03:00
parent 6fce60f9f7
commit b7cabfdbde
26 changed files with 485 additions and 7 deletions

View file

@ -9,6 +9,8 @@ import type {
AppUpdaterEvent,
StartGameDownloadPayload,
GameRunning,
Collection,
Game,
} from "@types";
contextBridge.exposeInMainWorld("electron", {
@ -102,6 +104,16 @@ contextBridge.exposeInMainWorld("electron", {
ipcRenderer.removeListener("on-library-batch-complete", listener);
},
/* Collections */
addCollection: (title: string) => ipcRenderer.invoke("addCollection", title),
addCollectionGame: (id: number, game: Game) =>
ipcRenderer.invoke("addCollectionGame", id, game),
getCollections: () => ipcRenderer.invoke("getCollections"),
removeCollection: (collection: Collection) =>
ipcRenderer.invoke("removeCollection", collection),
removeCollectionGame: (id: number, game: Game) =>
ipcRenderer.invoke("removeCollectionGame", id, game),
/* Hardware */
getDiskFreeSpace: (path: string) =>
ipcRenderer.invoke("getDiskFreeSpace", path),