mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-03-09 15:40:26 +00:00
feat(events): Add new event for getting magnet data
This commit is contained in:
parent
02c4f0a0e6
commit
a0344ea491
4 changed files with 13 additions and 0 deletions
|
|
@ -27,6 +27,7 @@ import "./torrenting/start-game-download";
|
|||
import "./user-preferences/get-user-preferences";
|
||||
import "./user-preferences/update-user-preferences";
|
||||
import "./user-preferences/auto-launch";
|
||||
import "./repacks/magnet-data"
|
||||
|
||||
ipcMain.handle("ping", () => "pong");
|
||||
ipcMain.handle("getVersion", () => app.getVersion());
|
||||
|
|
|
|||
10
src/main/events/repacks/magnet-data.ts
Normal file
10
src/main/events/repacks/magnet-data.ts
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
import { openWebTorrent } from "@main/services/open-web-torrent"
|
||||
import { registerEvent } from "../register-event"
|
||||
|
||||
const getMagnetData = async (_event: Electron.IpcMainInvokeEvent, magnet: string) => {
|
||||
return openWebTorrent.getSeedersAndPeers(magnet)
|
||||
}
|
||||
|
||||
registerEvent(getMagnetData, {
|
||||
name: 'getMagnetData'
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue