feat: dispatching event when remote games are fetched

This commit is contained in:
Chubby Granny Chaser 2024-06-19 02:35:57 +01:00
parent ca81281f1f
commit 944f3891bf
No known key found for this signature in database
8 changed files with 31 additions and 17 deletions

View file

@ -10,7 +10,7 @@ import { fetchDownloadSourcesAndUpdate } from "./helpers";
import { publishNewRepacksNotifications } from "./services/notifications";
import { MoreThan } from "typeorm";
import { HydraApi } from "./services/hydra-api";
import { getRemoteGames, uploadBatchGames } from "./services/library-sync";
import { uploadGamesBatch } from "./services/library-sync";
startMainLoop();
@ -23,10 +23,7 @@ const loadState = async (userPreferences: UserPreferences | null) => {
RealDebridClient.authorize(userPreferences?.realDebridApiToken);
HydraApi.setupApi().then(async () => {
if (HydraApi.isLoggedIn()) {
await uploadBatchGames();
getRemoteGames();
}
if (HydraApi.isLoggedIn()) uploadGamesBatch();
});
const [nextQueueItem] = await downloadQueueRepository.find({