mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-12 14:37:17 +03:00
Fix tests
This commit is contained in:
@@ -169,7 +169,7 @@ function categoryVote(UUID, userID, isVIP, category, hashedIP, res) {
|
|||||||
// Add the info into the private db
|
// Add the info into the private db
|
||||||
if (previousVoteInfo !== undefined) {
|
if (previousVoteInfo !== undefined) {
|
||||||
// Reverse the previous vote
|
// Reverse the previous vote
|
||||||
db.prepare('run', "update categoryVotes set votes -= ? where UUID = ? and category = ?", [voteAmount, UUID, previousVoteInfo.category]);
|
db.prepare('run', "update categoryVotes set votes = votes - ? where UUID = ? and category = ?", [voteAmount, UUID, previousVoteInfo.category]);
|
||||||
|
|
||||||
privateDB.prepare('run', "update categoryVotes set category = ?, timeSubmitted = ?, hashedIP = ? where userID = ?", [category, timeSubmitted, hashedIP, userID]);
|
privateDB.prepare('run', "update categoryVotes set category = ?, timeSubmitted = ?, hashedIP = ? where userID = ?", [category, timeSubmitted, hashedIP, userID]);
|
||||||
} else {
|
} else {
|
||||||
@@ -191,7 +191,7 @@ function categoryVote(UUID, userID, isVIP, category, hashedIP, res) {
|
|||||||
if (!currentCategoryInfo && submissionInfo) {
|
if (!currentCategoryInfo && submissionInfo) {
|
||||||
db.prepare("run", "insert into categoryVotes (UUID, category, votes) values (?, ?, ?)", [UUID, currentCategory.category, currentCategoryCount]);
|
db.prepare("run", "insert into categoryVotes (UUID, category, votes) values (?, ?, ?)", [UUID, currentCategory.category, currentCategoryCount]);
|
||||||
|
|
||||||
privateDB.prepare("run", "insert into categoryVotes (UUID, userID, hashedIP, category, timeSubmitted) values (?, ?, ?, ?, ?)", [UUID, submissionInfo.userID, "unknown", currentCategory.category, submissionUserIDInfo.timeSubmitted]);
|
privateDB.prepare("run", "insert into categoryVotes (UUID, userID, hashedIP, category, timeSubmitted) values (?, ?, ?, ?, ?)", [UUID, submissionInfo.userID, "unknown", currentCategory.category, submissionInfo.timeSubmitted]);
|
||||||
}
|
}
|
||||||
|
|
||||||
let nextCategoryCount = (previousVoteInfo.votes || 0) + voteAmount;
|
let nextCategoryCount = (previousVoteInfo.votes || 0) + voteAmount;
|
||||||
|
|||||||
Reference in New Issue
Block a user