mirror of https://github.com/calzoneman/sync.git
Fix voteskip calculation
This commit is contained in:
parent
7477c64ae2
commit
103e01042e
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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"
|
||||
},
|
||||
|
|
|
@ -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;
|
||||
|
|
4
user.js
4
user.js
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue