From 91fd5932dabce08ed2c4e6fa9cdef8b14b6b0754 Mon Sep 17 00:00:00 2001 From: Zamitto <167933696+zamitto@users.noreply.github.com> Date: Fri, 10 Oct 2025 14:40:57 -0300 Subject: [PATCH] fix: lastTimePlayed not updating correctly when merging games --- src/main/services/cloud-sync.ts | 4 ++-- src/main/services/library-sync/merge-with-remote-games.ts | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/services/cloud-sync.ts b/src/main/services/cloud-sync.ts index 6da24ce1..200a5ee3 100644 --- a/src/main/services/cloud-sync.ts +++ b/src/main/services/cloud-sync.ts @@ -80,7 +80,7 @@ export class CloudSync { try { await fs.promises.rm(backupPath, { recursive: true }); } catch (error) { - logger.error("Failed to remove backup path", error); + logger.error("Failed to remove backup path", { backupPath, error }); } } @@ -163,7 +163,7 @@ export class CloudSync { try { await fs.promises.unlink(bundleLocation); } catch (error) { - logger.error("Failed to remove tar file", error); + logger.error("Failed to remove tar file", { bundleLocation, error }); } } } 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 b5b2d551..68b4b835 100644 --- a/src/main/services/library-sync/merge-with-remote-games.ts +++ b/src/main/services/library-sync/merge-with-remote-games.ts @@ -22,7 +22,8 @@ export const mergeWithRemoteGames = async () => { const updatedLastTimePlayed = localGame.lastTimePlayed == null || (game.lastTimePlayed && - new Date(game.lastTimePlayed) > localGame.lastTimePlayed) + new Date(game.lastTimePlayed) > + new Date(localGame.lastTimePlayed)) ? game.lastTimePlayed : localGame.lastTimePlayed;