mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-01-30 22:31:03 +00:00
feat: restart downloads and move seed process initiation to main.ts
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
import { Ludusavi, startMainLoop } from "./services";
|
||||
import { userPreferencesRepository } from "./repository";
|
||||
import { DownloadManager, Ludusavi, startMainLoop } from "./services";
|
||||
import { downloadQueueRepository, userPreferencesRepository } from "./repository";
|
||||
import { UserPreferences } from "./entity";
|
||||
import { RealDebridClient } from "./services/download/real-debrid";
|
||||
import { HydraApi } from "./services/hydra-api";
|
||||
import { uploadGamesBatch } from "./services/library-sync";
|
||||
import { PythonRPC } from "./services/python-rpc";
|
||||
import { Aria2 } from "./services/aria2";
|
||||
import { startSeedProcess } from "./services/seed";
|
||||
import { sleep } from "./helpers";
|
||||
|
||||
const loadState = async (userPreferences: UserPreferences | null) => {
|
||||
import("./events");
|
||||
@@ -22,7 +24,26 @@ const loadState = async (userPreferences: UserPreferences | null) => {
|
||||
uploadGamesBatch();
|
||||
});
|
||||
|
||||
|
||||
const [nextQueueItem] = await downloadQueueRepository.find({
|
||||
order: {
|
||||
id: "DESC",
|
||||
},
|
||||
relations: {
|
||||
game: true,
|
||||
},
|
||||
});
|
||||
|
||||
PythonRPC.spawn();
|
||||
await sleep(1000);
|
||||
// wait for python process to start
|
||||
|
||||
if (nextQueueItem?.game.status === "active") {
|
||||
DownloadManager.startDownload(nextQueueItem.game);
|
||||
}
|
||||
|
||||
await startSeedProcess();
|
||||
|
||||
startMainLoop();
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user