Feat: Added changing game playtime functionality

This commit is contained in:
Moyasee
2025-09-17 11:24:24 +03:00
parent 6ff694c078
commit 86da92aa3f
7 changed files with 137 additions and 118 deletions

View File

@@ -4,13 +4,12 @@ import { GameShop } from "@types";
import { gamesSublevel } from "@main/level";
import { levelKeys } from "@main/level";
const changeGamePlaytime = async (
_event: Electron.IpcMainInvokeEvent,
shop: GameShop,
objectId: string,
playTimeInSeconds: number,
) => {
playTimeInSeconds: number
) => {
try {
await HydraApi.put(`/profile/games/${shop}/${objectId}/playtime`, {
playTimeInSeconds,
@@ -26,10 +25,6 @@ const changeGamePlaytime = async (
} catch (error) {
throw new Error(`Failed to update game favorite status: ${error}`);
}
;
};
registerEvent("changeGamePlayTime", changeGamePlaytime);