feat: adding aria2c

This commit is contained in:
Chubby Granny Chaser 2024-11-28 19:09:13 +00:00
parent 2d8b63c803
commit 4060f7a1a6
No known key found for this signature in database
30 changed files with 371 additions and 1351 deletions

View file

@ -1,21 +1,20 @@
import {
DownloadManager,
Ludusavi,
PythonInstance,
startMainLoop,
} from "./services";
import { DownloadManager, Ludusavi, startMainLoop } from "./services";
import {
downloadQueueRepository,
userPreferencesRepository,
} from "./repository";
import { UserPreferences } from "./entity";
import { RealDebridClient } from "./services/real-debrid";
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";
const loadState = async (userPreferences: UserPreferences | null) => {
import("./events");
Aria2.spawn();
if (userPreferences?.realDebridApiToken) {
RealDebridClient.authorize(userPreferences?.realDebridApiToken);
}
@ -35,11 +34,14 @@ const loadState = async (userPreferences: UserPreferences | null) => {
},
});
if (nextQueueItem?.game.status === "active") {
DownloadManager.startDownload(nextQueueItem.game);
} else {
PythonInstance.spawn();
}
PythonRPC.spawn();
// start download
// if (nextQueueItem?.game.status === "active") {
// DownloadManager.startDownload(nextQueueItem.game);
// } else {
// PythonInstance.spawn();
// }
startMainLoop();
};