This commit is contained in:
Hachi-R 2024-12-23 14:07:15 -03:00
parent f853a2a39e
commit 230c24cca5
2 changed files with 16 additions and 10 deletions

View file

@ -26,15 +26,18 @@ export class DownloadManager {
public static startRPC(game: Game, initialSeeding?: Game[]) { public static startRPC(game: Game, initialSeeding?: Game[]) {
if (game && game.status === "active") { if (game && game.status === "active") {
PythonRPC.spawn({ PythonRPC.spawn(
game_id: game.id, {
url: game.uri!, game_id: game.id,
save_path: game.downloadPath!, url: game.uri!,
}, initialSeeding?.map((game) => ({ save_path: game.downloadPath!,
game_id: game.id, },
url: game.uri!, initialSeeding?.map((game) => ({
save_path: game.downloadPath!, game_id: game.id,
}))); url: game.uri!,
save_path: game.downloadPath!,
}))
);
this.downloadingGameId = game.id; this.downloadingGameId = game.id;
} }

View file

@ -42,7 +42,10 @@ export class PythonRPC {
readable.on("data", logger.log); readable.on("data", logger.log);
} }
public static spawn(initialDownload?: GamePayload, initialSeeding?: GamePayload[]) { public static spawn(
initialDownload?: GamePayload,
initialSeeding?: GamePayload[]
) {
const commonArgs = [ const commonArgs = [
this.BITTORRENT_PORT, this.BITTORRENT_PORT,
this.RPC_PORT, this.RPC_PORT,