fix: discord rpc timestamp jitter

This commit is contained in:
Darkiox 2024-11-25 19:15:26 -03:00
parent ae699887b2
commit a3aa45a96b

View File

@ -103,8 +103,7 @@ const getActivity = (): SetActivity => {
if (includeTimestamps) {
const currentSeconds = convertDurationToSeconds(mediaInfo.current);
const durationSeconds = convertDurationToSeconds(mediaInfo.duration);
const date = new Date();
const now = Math.floor(date.getTime() / 1000);
const now = Math.trunc((Date.now() + 500) / 1000);
presence.startTimestamp = now - currentSeconds;
presence.endTimestamp = presence.startTimestamp + durationSeconds;
}