mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-01-20 01:33:56 +00:00
Feat: Added changing game playtime functionality
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user