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