mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Update in refreshing viewers in playlist
This commit is contained in:
@@ -59,6 +59,7 @@ function get_short_id(socket) {
|
|||||||
|
|
||||||
function check_inlist(coll, guid, socket, offline)
|
function check_inlist(coll, guid, socket, offline)
|
||||||
{
|
{
|
||||||
|
|
||||||
if(coll == undefined) return;
|
if(coll == undefined) return;
|
||||||
coll = coll.replace(/ /g,'');
|
coll = coll.replace(/ /g,'');
|
||||||
if(!offline && coll != undefined){
|
if(!offline && coll != undefined){
|
||||||
@@ -79,6 +80,10 @@ function check_inlist(coll, guid, socket, offline)
|
|||||||
db.collection("connected_users").update({"_id": "total_users"}, {$addToSet: {total_users: guid + coll}}, function(err, docs){});
|
db.collection("connected_users").update({"_id": "total_users"}, {$addToSet: {total_users: guid + coll}}, function(err, docs){});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
db.collection("connected_users").find({"_id": coll}, function(err, new_doc) {
|
||||||
|
io.to(coll).emit("viewers", new_doc[0].users.length);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user