mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-01-23 21:44:55 +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";
|
import { getSteamAppAsset } from "@main/helpers";
|
||||||
|
|
||||||
export const mergeWithRemoteGames = async () => {
|
export const mergeWithRemoteGames = async () => {
|
||||||
try {
|
return HydraApi.get("/games")
|
||||||
const games = await HydraApi.get("/games");
|
.then(async (response) => {
|
||||||
|
for (const game of response.data) {
|
||||||
for (const game of games.data) {
|
|
||||||
const localGame = await gameRepository.findOne({
|
const localGame = await gameRepository.findOne({
|
||||||
where: {
|
where: {
|
||||||
objectID: game.objectId,
|
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";
|
import { WindowManager } from "../window-manager";
|
||||||
|
|
||||||
export const uploadGamesBatch = async () => {
|
export const uploadGamesBatch = async () => {
|
||||||
try {
|
|
||||||
const games = await gameRepository.find({
|
const games = await gameRepository.find({
|
||||||
where: { remoteId: IsNull(), isDeleted: false },
|
where: { remoteId: IsNull(), isDeleted: false },
|
||||||
});
|
});
|
||||||
@ -31,5 +30,4 @@ export const uploadGamesBatch = async () => {
|
|||||||
|
|
||||||
if (WindowManager.mainWindow)
|
if (WindowManager.mainWindow)
|
||||||
WindowManager.mainWindow.webContents.send("on-library-batch-complete");
|
WindowManager.mainWindow.webContents.send("on-library-batch-complete");
|
||||||
} catch (err) {}
|
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user