mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-07 20:17:02 +03:00
Made it so that -2 to 0 votes has a chance in the randomizer.
This commit is contained in:
6
index.js
6
index.js
@@ -226,9 +226,11 @@ function getVoteOrganisedSponsorTimes(sponsorTimes, votes, UUIDs) {
|
|||||||
let sqrtVotesList = [];
|
let sqrtVotesList = [];
|
||||||
let totalSqrtVotes = 0;
|
let totalSqrtVotes = 0;
|
||||||
for (let j = 0; j < similarSponsorsGroups[i].length; j++) {
|
for (let j = 0; j < similarSponsorsGroups[i].length; j++) {
|
||||||
//multiplying by 10 makes the 10 votes the point where it the votes start not mattering as much
|
//multiplying by 10 makes around 13 votes the point where it the votes start not mattering as much (10 + 3)
|
||||||
|
//The 3 makes -2 the minimum votes before being ignored completely
|
||||||
|
//https://www.desmos.com/calculator/ljftxolg9j
|
||||||
//this can be changed if this system increases in popularity.
|
//this can be changed if this system increases in popularity.
|
||||||
let sqrtVote = Math.sqrt(votes[similarSponsorsGroups[i][j]] * 10);
|
let sqrtVote = Math.sqrt((votes[similarSponsorsGroups[i][j]] + 3) * 10);
|
||||||
sqrtVotesList.push(sqrtVote)
|
sqrtVotesList.push(sqrtVote)
|
||||||
totalSqrtVotes += sqrtVote;
|
totalSqrtVotes += sqrtVote;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user