mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-01-23 02:41:02 +00:00
feat: batch games and code refactor
This commit is contained in:
@@ -6,7 +6,7 @@ import type { GameShop } from "@types";
|
||||
import { getFileBase64, getSteamAppAsset } from "@main/helpers";
|
||||
|
||||
import { steamGamesWorker } from "@main/workers";
|
||||
import { HydraApi } from "@main/services/hydra-api";
|
||||
import { createGame } from "@main/services/library-sync";
|
||||
|
||||
const addGameToLibrary = async (
|
||||
_event: Electron.IpcMainInvokeEvent,
|
||||
@@ -53,12 +53,7 @@ const addGameToLibrary = async (
|
||||
|
||||
const game = await gameRepository.findOne({ where: { objectID } });
|
||||
|
||||
HydraApi.post("/games", {
|
||||
objectId: objectID,
|
||||
playTimeInMilliseconds: game?.playTimeInMilliseconds,
|
||||
shop,
|
||||
lastTimePlayed: game?.lastTimePlayed,
|
||||
}).then((response) => {
|
||||
createGame(game!).then((response) => {
|
||||
const {
|
||||
id: remoteId,
|
||||
playTimeInMilliseconds,
|
||||
|
||||
Reference in New Issue
Block a user