Fix voteskip calculation

This commit is contained in:
Calvin Montgomery 2013-08-01 00:03:56 -04:00
parent 7477c64ae2
commit 103e01042e
4 changed files with 6 additions and 6 deletions

View file

@ -1550,8 +1550,8 @@ Channel.prototype.tryVoteskip = function(user) {
}
this.voteskip.vote(user.ip, 0);
this.broadcastVoteskipUpdate();
var need = parseInt(this.users.length * this.opts.voteskip_ratio);
need -= this.afkcount;
var count = this.users.length - this.afkcount;
var need = parseInt(count * this.opts.voteskip_ratio);
if(this.voteskip.counts[0] >= need) {
this.playNext();
}

View file

@ -2,7 +2,7 @@
"author": "Calvin Montgomery",
"name": "CyTube",
"description": "Online media synchronizer and chat",
"version": "2.2.0",
"version": "2.2.1",
"repository": {
"url": "http://github.com/calzoneman/sync"
},

View file

@ -6,7 +6,7 @@ var Logger = require("./logger");
var Channel = require("./channel");
var User = require("./user");
const VERSION = "2.2.0";
const VERSION = "2.2.1";
function getIP(req) {
var raw = req.connection.remoteAddress;

View file

@ -96,8 +96,8 @@ User.prototype.setAFK = function (afk) {
}
if(chan.voteskip) {
chan.voteskip.unvote(this.ip);
var need = parseInt(chan.users.length * chan.opts.voteskip_ratio);
need -= chan.afkcount;
var count = chan.users.length - chan.afkcount;
var need = parseInt(count * chan.opts.voteskip_ratio);
if(chan.voteskip.counts[0] >= need) {
chan.playNext();
}