mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-03-09 15:40:26 +00:00
13 lines
339 B
TypeScript
13 lines
339 B
TypeScript
import type { Game } from "@types";
|
|
import { HydraApi } from "../hydra-api";
|
|
|
|
export const updateGamePlaytime = async (
|
|
game: Game,
|
|
deltaInMillis: number,
|
|
lastTimePlayed: Date
|
|
) => {
|
|
return HydraApi.put(`/profile/games/${game.remoteId}`, {
|
|
playTimeDeltaInSeconds: Math.trunc(deltaInMillis / 1000),
|
|
lastTimePlayed,
|
|
});
|
|
};
|