mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-15 16:07:03 +03:00
Fixed it not checking if there are more than 4 choices to choose from.
This commit is contained in:
4
index.js
4
index.js
@@ -241,7 +241,9 @@ function getVoteOrganisedSponsorTimes(sponsorTimes, votes, UUIDs) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//if there are too many indexes, find the best 4
|
//if there are too many indexes, find the best 4
|
||||||
finalSponsorTimeIndexes = getWeightedRandomChoice(finalSponsorTimeIndexes, votes, 4).finalChoices;
|
if (finalSponsorTimeIndexes.length > 4) {
|
||||||
|
finalSponsorTimeIndexes = getWeightedRandomChoice(finalSponsorTimeIndexes, votes, 4).finalChoices;
|
||||||
|
}
|
||||||
|
|
||||||
//convert this to a final array to return
|
//convert this to a final array to return
|
||||||
let finalSponsorTimes = [];
|
let finalSponsorTimes = [];
|
||||||
|
|||||||
Reference in New Issue
Block a user