feat: adding auto refresh of download sources

This commit is contained in:
Chubby Granny Chaser 2024-06-03 21:39:37 +01:00
parent 3da751a67b
commit 0ea2cd39db
No known key found for this signature in database
19 changed files with 241 additions and 93 deletions

View file

@ -8,6 +8,7 @@ import { UserPreferences } from "./entity";
import { RealDebridClient } from "./services/real-debrid";
import { Not } from "typeorm";
import { repacksWorker } from "./workers";
import { fetchDownloadSourcesAndUpdate } from "./helpers";
startMainLoop();
@ -27,15 +28,14 @@ const loadState = async (userPreferences: UserPreferences | null) => {
if (game) DownloadManager.startDownload(game);
repackRepository
.find({
order: {
createdAt: "DESC",
},
})
.then((repacks) => {
repacksWorker.run(repacks, { name: "setRepacks" });
});
const repacks = await repackRepository.find({
order: {
createdAt: "DESC",
},
});
repacksWorker.run(repacks, { name: "setRepacks" });
fetchDownloadSourcesAndUpdate();
};
userPreferencesRepository