mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-01-21 01:53:57 +00:00
fix: playtime count and custom games request on process watcher
This commit is contained in:
@@ -3,6 +3,10 @@ import { HydraApi } from "../hydra-api";
|
||||
import { gamesSublevel, levelKeys } from "@main/level";
|
||||
|
||||
export const createGame = async (game: Game) => {
|
||||
if (game.shop === "custom") {
|
||||
return;
|
||||
}
|
||||
|
||||
return HydraApi.post(`/profile/games`, {
|
||||
objectId: game.objectId,
|
||||
playTimeInMilliseconds: Math.trunc(game.playTimeInMilliseconds ?? 0),
|
||||
|
||||
@@ -6,6 +6,10 @@ export const updateGamePlaytime = async (
|
||||
deltaInMillis: number,
|
||||
lastTimePlayed: Date
|
||||
) => {
|
||||
if (game.shop === "custom") {
|
||||
return;
|
||||
}
|
||||
|
||||
return HydraApi.put(`/profile/games/${game.remoteId}`, {
|
||||
playTimeDeltaInSeconds: Math.trunc(deltaInMillis / 1000),
|
||||
lastTimePlayed,
|
||||
|
||||
Reference in New Issue
Block a user