feat: move initial seeding for DownloadManager

This commit is contained in:
Hachi-R 2024-12-23 14:07:03 -03:00
parent 843301c8b6
commit f853a2a39e
4 changed files with 26 additions and 7 deletions

View file

@ -24,13 +24,17 @@ import { logger } from "../logger";
export class DownloadManager {
private static downloadingGameId: number | null = null;
public static startRPC(game: Game) {
public static startRPC(game: Game, initialSeeding?: Game[]) {
if (game && game.status === "active") {
PythonRPC.spawn({
game_id: game.id,
url: game.uri!,
save_path: game.downloadPath!,
});
}, initialSeeding?.map((game) => ({
game_id: game.id,
url: game.uri!,
save_path: game.downloadPath!,
})));
this.downloadingGameId = game.id;
}