mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-03-09 15:40:26 +00:00
feat: batch games and code refactor
This commit is contained in:
parent
da5cc11bff
commit
7fc376b47f
10 changed files with 161 additions and 106 deletions
11
src/main/services/library-sync/create-game.ts
Normal file
11
src/main/services/library-sync/create-game.ts
Normal file
|
@ -0,0 +1,11 @@
|
|||
import { Game } from "@main/entity";
|
||||
import { HydraApi } from "../hydra-api";
|
||||
|
||||
export const createGame = async (game: Game) => {
|
||||
return HydraApi.post(`/games`, {
|
||||
objectId: game.objectID,
|
||||
playTimeInMilliseconds: Math.round(game.playTimeInMilliseconds),
|
||||
shop: game.shop,
|
||||
lastTimePlayed: game.lastTimePlayed,
|
||||
});
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue