mirror of
https://github.com/warengroup/eximiabots-radiox.git
synced 2024-11-09 23:00:18 +00:00
Updated statisticsUpdate function
This commit is contained in:
parent
6a11482110
commit
95e8b17ddd
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user