mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-01-21 10:03:56 +00:00
14 lines
341 B
TypeScript
14 lines
341 B
TypeScript
import { Game } from "@main/entity";
|
|
import { HydraApi } from "../hydra-api";
|
|
|
|
export const updateGamePlaytime = async (
|
|
game: Game,
|
|
deltaInMillis: number,
|
|
lastTimePlayed: Date
|
|
) => {
|
|
HydraApi.put(`/games/${game.remoteId}`, {
|
|
playTimeDeltaInSeconds: Math.trunc(deltaInMillis / 1000),
|
|
lastTimePlayed,
|
|
}).catch(() => {});
|
|
};
|