From 95e8b17ddde333d3e23c512a12374cded4e884d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christer=20War=C3=A9n?= Date: Sun, 8 Aug 2021 20:06:30 +0300 Subject: [PATCH] Updated statisticsUpdate function --- src/client/funcs/statisticsUpdate.js | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/client/funcs/statisticsUpdate.js b/src/client/funcs/statisticsUpdate.js index d036f3b..2ca66c6 100644 --- a/src/client/funcs/statisticsUpdate.js +++ b/src/client/funcs/statisticsUpdate.js @@ -11,14 +11,10 @@ module.exports = function statisticsUpdate(client, guild, radio) { client.datastore.updateEntry(guild, radio.currentGuild); } - if(!radio.connection.dispatcher){ - let date = new Date(); - radio.currentTime = date.getTime(); - radio.playTime = parseInt(radio.currentTime)-parseInt(radio.startTime); - radio.currentGuild.statistics[radio.station.name].time = parseInt(radio.currentGuild.statistics[radio.station.name].time)+parseInt(radio.playTime); - } else { - radio.currentGuild.statistics[radio.station.name].time = parseInt(radio.currentGuild.statistics[radio.station.name].time)+parseInt(radio.connection.dispatcher.streamTime.toFixed(0)); - } + let date = new Date(); + radio.currentTime = date.getTime(); + radio.playTime = parseInt(radio.currentTime)-parseInt(radio.startTime); + radio.currentGuild.statistics[radio.station.name].time = parseInt(radio.currentGuild.statistics[radio.station.name].time)+parseInt(radio.playTime); radio.currentGuild.statistics[radio.station.name].used = parseInt(radio.currentGuild.statistics[radio.station.name].used)+1; client.datastore.updateEntry(guild, radio.currentGuild);