mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-01-21 18:13:55 +00:00
21 lines
487 B
TypeScript
21 lines
487 B
TypeScript
import { gameRepository } from "@main/repository";
|
|
import { DownloadManager } from "./download/download-manager";
|
|
import { sleep } from "@main/helpers";
|
|
|
|
export const startSeedProcess = async () => {
|
|
const seedList = await gameRepository.find({
|
|
where: {
|
|
shouldSeed: true,
|
|
downloader: 1,
|
|
progress: 1,
|
|
},
|
|
});
|
|
|
|
if (seedList.length === 0) return;
|
|
|
|
seedList.map(async (game) => {
|
|
await DownloadManager.startDownload(game);
|
|
await sleep(300);
|
|
});
|
|
};
|