mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2024-11-10 09:07:47 +01:00
Fix rep hurting negatively voted segments
This commit is contained in:
parent
98494aec4a
commit
a66588619a
1 changed files with 2 additions and 1 deletions
|
@ -223,7 +223,8 @@ function getWeightedRandomChoice<T extends VotableObject>(choices: T[], amountOf
|
||||||
|
|
||||||
//The 3 makes -2 the minimum votes before being ignored completely
|
//The 3 makes -2 the minimum votes before being ignored completely
|
||||||
//this can be changed if this system increases in popularity.
|
//this can be changed if this system increases in popularity.
|
||||||
const weight = Math.exp(choice.votes * Math.max(1, choice.reputation + 1) + 3 + boost);
|
const repFactor = choice.votes > 0 ? Math.max(1, choice.reputation + 1) : 1;
|
||||||
|
const weight = Math.exp(choice.votes * repFactor + 3 + boost);
|
||||||
totalWeight += Math.max(weight, 0);
|
totalWeight += Math.max(weight, 0);
|
||||||
|
|
||||||
return { ...choice, weight };
|
return { ...choice, weight };
|
||||||
|
|
Loading…
Reference in a new issue