mirror of
https://github.com/warengroup/eximiabots-radiox.git
synced 2024-12-22 21:33:17 +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);
|
client.datastore.updateEntry(guild, radio.currentGuild);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!radio.connection.dispatcher){
|
let date = new Date();
|
||||||
let date = new Date();
|
radio.currentTime = date.getTime();
|
||||||
radio.currentTime = date.getTime();
|
radio.playTime = parseInt(radio.currentTime)-parseInt(radio.startTime);
|
||||||
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].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));
|
|
||||||
}
|
|
||||||
|
|
||||||
radio.currentGuild.statistics[radio.station.name].used = parseInt(radio.currentGuild.statistics[radio.station.name].used)+1;
|
radio.currentGuild.statistics[radio.station.name].used = parseInt(radio.currentGuild.statistics[radio.station.name].used)+1;
|
||||||
client.datastore.updateEntry(guild, radio.currentGuild);
|
client.datastore.updateEntry(guild, radio.currentGuild);
|
||||||
|
Loading…
Reference in New Issue
Block a user