Merge branch 'main' into hyd-228-investigate-why-users-are-being-logged-out-when-updating

# Conflicts:
#	src/main/events/user-preferences/auto-launch.ts
This commit is contained in:
Zamitto 2024-07-03 16:32:25 -03:00
commit 981116f221
24 changed files with 142 additions and 154 deletions

View file

@ -1,4 +1,9 @@
import { DownloadManager, RepacksManager, startMainLoop } from "./services";
import {
DownloadManager,
RepacksManager,
PythonInstance,
startMainLoop,
} from "./services";
import {
downloadQueueRepository,
repackRepository,
@ -12,8 +17,6 @@ import { MoreThan } from "typeorm";
import { HydraApi } from "./services/hydra-api";
import { uploadGamesBatch } from "./services/library-sync";
startMainLoop();
const loadState = async (userPreferences: UserPreferences | null) => {
await RepacksManager.updateRepacks();
@ -35,8 +38,13 @@ const loadState = async (userPreferences: UserPreferences | null) => {
},
});
if (nextQueueItem?.game.status === "active")
if (nextQueueItem?.game.status === "active") {
DownloadManager.startDownload(nextQueueItem.game);
} else {
PythonInstance.spawn();
}
startMainLoop();
const now = new Date();