fusic-meteor icon indicating copy to clipboard operation
fusic-meteor copied to clipboard

Users playing a song isn't representative

Open pepf opened this issue 10 years ago • 2 comments

It never deletes user's of the list. We should make use of some sort of polling to make sure user is actually still playing the list or logged in, otherwise remove the user.

Something like https://github.com/murilopolese/howmanypeoplearelooking could be a good starting point

pepf avatar Jun 29 '14 15:06 pepf

Just log a time stamp . No polling On Jun 29, 2014 5:13 PM, "Pepijn" [email protected] wrote:

It never deletes user's of the list. We should make use of some sort of polling to make sure user is actually still playing the list or logged in, otherwise remove the user.

Something like https://github.com/murilopolese/howmanypeoplearelooking could be a good starting point

— Reply to this email directly or view it on GitHub https://github.com/Rayman/fusic-meteor/issues/48.

reinzor avatar Jun 29 '14 15:06 reinzor

Sorry, I didn't mean polling; the "howmanypeoplearelooking" solution is about monitoring the "socket close" event from somewhere deep inside the core of Meteor and then mapping it to one of the userIds. I think that's pretty clever, when you're disconnected obviously you can't be playing any songs.

So this part:

 socket.on('close', Meteor.bindEnvironment(function () {
            People.remove({
                connectionID: socket.id
            });

is where they basically remove a user from a collection based on the socket.id.

pepf avatar Jun 30 '14 08:06 pepf