mirror of
https://github.com/warengroup/eximiabots-radiox.git
synced 2024-12-22 21:33:17 +00:00
Fixed calculateGlobal
This commit is contained in:
parent
b9ad745770
commit
d3f8aee812
@ -26,7 +26,7 @@ module.exports = class {
|
||||
calculateGlobal(client){
|
||||
let guilds = this.map.keys();
|
||||
let stations = client.stations;
|
||||
let statistics = {};
|
||||
var statistics = {};
|
||||
|
||||
if(!client.stations) return;
|
||||
|
||||
@ -34,13 +34,10 @@ module.exports = class {
|
||||
|
||||
while (!calculation.done) {
|
||||
let currentGuild = this.getEntry(calculation.value);
|
||||
if(calculation.value == 'global'){
|
||||
return calculation = guilds.next();
|
||||
}
|
||||
|
||||
if(calculation.value != 'global'){
|
||||
if(stations){
|
||||
Object.keys(stations).forEach(function(station) {
|
||||
if(currentGuild.statistics[stations[station].name] && currentGuild.statistics[stations[station].name].time && !parseInt(currentGuild.statistics[stations[station].name].time) == 0 && currentGuild.statistics[stations[station].name].used && !parseInt(currentGuild.statistics[stations[station].name].used) == 0){
|
||||
if(currentGuild.statistics[stations[station].name] && currentGuild.statistics[stations[station].name].time && parseInt(currentGuild.statistics[stations[station].name].time) != 0 && currentGuild.statistics[stations[station].name].used && parseInt(currentGuild.statistics[stations[station].name].used) != 0){
|
||||
if(!statistics[stations[station].name]){
|
||||
statistics[stations[station].name] = {};
|
||||
statistics[stations[station].name].time = 0;
|
||||
@ -52,6 +49,7 @@ module.exports = class {
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
calculation = guilds.next();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user