feat: use new ep to track game playtime

This commit is contained in:
Zamitto
2025-10-31 10:20:11 -03:00
parent 1af69465c1
commit c71f5947ba
3 changed files with 7 additions and 13 deletions

View File

@@ -1,7 +1,7 @@
import type { Game } from "@types";
import { HydraApi } from "../hydra-api";
export const updateGamePlaytime = async (
export const trackGamePlaytime = async (
game: Game,
deltaInMillis: number,
lastTimePlayed: Date
@@ -10,7 +10,7 @@ export const updateGamePlaytime = async (
return;
}
return HydraApi.put(`/profile/games/${game.remoteId}`, {
return HydraApi.put(`/profile/games/${game.shop}/${game.objectId}`, {
playTimeDeltaInSeconds: Math.trunc(deltaInMillis / 1000),
lastTimePlayed,
});