voteskip: add early exit for duplicate votes

This commit is contained in:
Calvin Montgomery 2018-11-11 16:08:00 -08:00
parent f6a58d00b2
commit 2d6af31c00
3 changed files with 7 additions and 2 deletions

View file

@ -40,7 +40,10 @@ VoteskipModule.prototype.handleVoteskip = function (user) {
this.poll = new Poll("[server]", "voteskip", ["skip"], false);
}
this.poll.vote(user.realip, 0);
if (!this.poll.vote(user.realip, 0)) {
// Vote was already recorded for this IP, no update needed
return;
}
var title = "";
if (this.channel.modules.playlist.current) {