mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-16 16:37:12 +03:00
Increased downvote power and VIP downvote power.
This commit is contained in:
13
index.js
13
index.js
@@ -325,7 +325,7 @@ app.get('/api/voteOnSponsorTime', function (req, res) {
|
|||||||
} else if (votesRow.type == 2) {
|
} else if (votesRow.type == 2) {
|
||||||
//extra downvote
|
//extra downvote
|
||||||
oldIncrementAmount = -4;
|
oldIncrementAmount = -4;
|
||||||
} else if (votesRow.type <= -25) {
|
} else if (votesRow.type < 0) {
|
||||||
//vip downvote
|
//vip downvote
|
||||||
oldIncrementAmount = votesRow.type;
|
oldIncrementAmount = votesRow.type;
|
||||||
}
|
}
|
||||||
@@ -340,13 +340,12 @@ app.get('/api/voteOnSponsorTime', function (req, res) {
|
|||||||
db.prepare("SELECT votes, views FROM sponsorTimes WHERE UUID = ?").get(UUID, async function(err, row) {
|
db.prepare("SELECT votes, views FROM sponsorTimes WHERE UUID = ?").get(UUID, async function(err, row) {
|
||||||
if (vipResult.row.userCount != 0 && incrementAmount < 0) {
|
if (vipResult.row.userCount != 0 && incrementAmount < 0) {
|
||||||
//this user is a vip and a downvote
|
//this user is a vip and a downvote
|
||||||
//their vote should be -25 or -80%
|
incrementAmount = -Math.min(350, Math.floor(row.votes + 2));
|
||||||
incrementAmount = -Math.max(25, Math.floor(row.votes * 0.8));
|
type = incrementAmount;
|
||||||
|
} else if (row != null && (row.votes > 8 || row.views > 15) && incrementAmount < 0) {
|
||||||
|
//increase the power of this downvote
|
||||||
|
incrementAmount = -10;
|
||||||
type = incrementAmount;
|
type = incrementAmount;
|
||||||
} else if (row != null && (row.votes > 3 || row.views > 4) && incrementAmount < 0) {
|
|
||||||
//multiply the power of this downvote
|
|
||||||
incrementAmount *= 4;
|
|
||||||
type = 2;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Send discord message
|
// Send discord message
|
||||||
|
|||||||
Reference in New Issue
Block a user