mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-03-09 15:40:26 +00:00
feat: restart downloads and move seed process initiation to main.ts
This commit is contained in:
parent
65b1ec9b1f
commit
3aa8230e17
3 changed files with 24 additions and 9 deletions
|
@ -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();
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue