mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-07 20:17:02 +03:00
Fixed weighted random cap not working.
Nothing would return if there were more than 4 sponsors.
This commit is contained in:
8
index.js
8
index.js
@@ -740,11 +740,9 @@ function getVoteOrganisedSponsorTimes(sponsorTimes, votes, UUIDs) {
|
|||||||
|
|
||||||
let voteSums = weightedRandomIndexes.weightSums;
|
let voteSums = weightedRandomIndexes.weightSums;
|
||||||
//convert these into the votes
|
//convert these into the votes
|
||||||
for (let i = 0; i < voteSums.length; i++) {
|
for (let i = 0; i < finalSponsorTimeIndexes.length; i++) {
|
||||||
if (voteSums[i] != undefined) {
|
//it should use the sum of votes, since anyone upvoting a similar sponsor is upvoting the existence of that sponsor.
|
||||||
//it should use the sum of votes, since anyone upvoting a similar sponsor is upvoting the existence of that sponsor.
|
votes[finalSponsorTimeIndexes[i]] = voteSums[i];
|
||||||
votes[finalSponsorTimeIndexes[i]] = voteSums;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//find the indexes never dealt with and add them
|
//find the indexes never dealt with and add them
|
||||||
|
|||||||
Reference in New Issue
Block a user