From 791a92a4464d0a620e51fa1d2f2b11a3392d0f06 Mon Sep 17 00:00:00 2001 From: Marie <8841466+Mar0xy@users.noreply.github.com> Date: Thu, 22 Apr 2021 11:34:26 +0200 Subject: [PATCH] change let to const and use full length as names. --- src/scripts/discord.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/scripts/discord.js b/src/scripts/discord.js index 2586423..aae5ca6 100644 --- a/src/scripts/discord.js +++ b/src/scripts/discord.js @@ -16,11 +16,11 @@ const observer = (event, arg) => { if (mediaInfoModule.mediaInfo.status == "paused" && rpc) { rpc.setActivity(idleStatus); } else if (rpc) { - let csec = timeToSeconds(mediaInfoModule.mediaInfo.current.split(":")); - let dsec = timeToSeconds(mediaInfoModule.mediaInfo.duration.split(":")); + const currentSeconds = timeToSeconds(mediaInfoModule.mediaInfo.current.split(":")); + const durationSeconds = timeToSeconds(mediaInfoModule.mediaInfo.duration.split(":")); const date = new Date(); - let now = date.getTime() / 1000 | 0; - let remaining = date.setSeconds(date.getSeconds() + (dsec - csec)); + const now = date.getTime() / 1000 | 0; + const remaining = date.setSeconds(date.getSeconds() + (durationSeconds - currentSeconds)); if (mediaInfoModule.mediaInfo.url) { rpc.setActivity({ ...idleStatus,