Fix for offline-listeners overflooding total viewers

This commit is contained in:
Kasper Rynning-Tønnesen
2018-01-29 13:57:54 +01:00
parent a6e87696b8
commit 05980fe33c
7 changed files with 35 additions and 25 deletions

View File

@@ -5,7 +5,7 @@ function frontpage_lists(msg, socket) {
db.collection("frontpage_lists").find({frontpage:true}, function(err, docs){
db.collection("connected_users").find({"_id": "total_users"}, function(err, tot){
socket.compress(true).emit("playlists", {channels: docs, viewers: tot[0].total_users});
socket.compress(true).emit("playlists", {channels: docs, viewers: tot[0].total_users.length});
});
});
}