From f252abc7a7c7b75338a1ac35a8ef57703095e2ce Mon Sep 17 00:00:00 2001 From: Zamitto <167933696+zamitto@users.noreply.github.com> Date: Wed, 22 May 2024 16:01:09 -0300 Subject: [PATCH] feat: change column type to datetime --- src/main/entity/game.entity.ts | 2 +- src/main/services/process-watcher.ts | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/main/entity/game.entity.ts b/src/main/entity/game.entity.ts index 91e19ea6..d6362928 100644 --- a/src/main/entity/game.entity.ts +++ b/src/main/entity/game.entity.ts @@ -59,7 +59,7 @@ export class Game { @Column("int", { default: 0 }) bytesDownloaded: number; - @Column("text", { nullable: true }) + @Column("datetime", { nullable: true }) lastTimePlayed: Date | null; @Column("float", { default: 0 }) diff --git a/src/main/services/process-watcher.ts b/src/main/services/process-watcher.ts index 16646934..65819502 100644 --- a/src/main/services/process-watcher.ts +++ b/src/main/services/process-watcher.ts @@ -56,10 +56,7 @@ export const startProcessWatcher = async () => { await gameRepository.update(game.id, { playTimeInMilliseconds: game.playTimeInMilliseconds + delta, - }); - - gameRepository.update(game.id, { - lastTimePlayed: new Date().toUTCString(), + lastTimePlayed: new Date(), }); }