From fb416b64835f032b1ecef030d40950f6f9f20bc9 Mon Sep 17 00:00:00 2001 From: Zamitto <167933696+zamitto@users.noreply.github.com> Date: Thu, 20 Jun 2024 21:55:16 -0300 Subject: [PATCH] fix: merge with remote games setting 1970 sometimes --- src/main/services/library-sync/merge-with-remote-games.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/services/library-sync/merge-with-remote-games.ts b/src/main/services/library-sync/merge-with-remote-games.ts index 8790318f..460cad0f 100644 --- a/src/main/services/library-sync/merge-with-remote-games.ts +++ b/src/main/services/library-sync/merge-with-remote-games.ts @@ -19,7 +19,8 @@ export const mergeWithRemoteGames = async () => { if (localGame) { const updatedLastTimePlayed = localGame.lastTimePlayed == null || - new Date(game.lastTimePlayed) > localGame.lastTimePlayed + (game.lastTimePlayed && + new Date(game.lastTimePlayed) > localGame.lastTimePlayed) ? new Date(game.lastTimePlayed) : localGame.lastTimePlayed;