mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-02-03 00:33:49 +03:00
feat: refactor
This commit is contained in:
parent
c9c585f820
commit
b8bd786c45
@ -4,10 +4,9 @@ import { steamGamesWorker } from "@main/workers";
|
||||
import { getSteamAppAsset } from "@main/helpers";
|
||||
|
||||
export const mergeWithRemoteGames = async () => {
|
||||
try {
|
||||
const games = await HydraApi.get("/games");
|
||||
|
||||
for (const game of games.data) {
|
||||
return HydraApi.get("/games")
|
||||
.then(async (response) => {
|
||||
for (const game of response.data) {
|
||||
const localGame = await gameRepository.findOne({
|
||||
where: {
|
||||
objectID: game.objectId,
|
||||
@ -60,5 +59,6 @@ export const mergeWithRemoteGames = async () => {
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (err) {}
|
||||
})
|
||||
.catch();
|
||||
};
|
||||
|
@ -6,7 +6,6 @@ import { mergeWithRemoteGames } from "./merge-with-remote-games";
|
||||
import { WindowManager } from "../window-manager";
|
||||
|
||||
export const uploadGamesBatch = async () => {
|
||||
try {
|
||||
const games = await gameRepository.find({
|
||||
where: { remoteId: IsNull(), isDeleted: false },
|
||||
});
|
||||
@ -31,5 +30,4 @@ export const uploadGamesBatch = async () => {
|
||||
|
||||
if (WindowManager.mainWindow)
|
||||
WindowManager.mainWindow.webContents.send("on-library-batch-complete");
|
||||
} catch (err) {}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user