From 579207e8a07e0108671a8da20df921bb93fd7668 Mon Sep 17 00:00:00 2001 From: Rick van Lieshout Date: Mon, 9 Dec 2024 13:35:13 +0100 Subject: [PATCH] Revert "Fix Discord RPC Timestamp jitter" --- src/scripts/discord.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/scripts/discord.ts b/src/scripts/discord.ts index 21d03b5..9da1387 100644 --- a/src/scripts/discord.ts +++ b/src/scripts/discord.ts @@ -103,7 +103,8 @@ const getActivity = (): SetActivity => { if (includeTimestamps) { const currentSeconds = convertDurationToSeconds(mediaInfo.current); const durationSeconds = convertDurationToSeconds(mediaInfo.duration); - const now = Math.trunc((Date.now() + 500) / 1000); + const date = new Date(); + const now = Math.floor(date.getTime() / 1000); presence.startTimestamp = now - currentSeconds; presence.endTimestamp = presence.startTimestamp + durationSeconds; }