mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-24 16:38:41 +03:00
reject submissions that have meen marked as invalid by a vip
This commit is contained in:
@@ -157,6 +157,8 @@ module.exports = async function postSkipSegments(req, res) {
|
||||
//hash the ip 5000 times so no one can get it from the database
|
||||
let hashedIP = getHash(getIP(req) + config.globalSalt);
|
||||
|
||||
let noSegmentList = db.prepare('all', 'SELECT category from noSegments where videoID = ?', [videoID]);
|
||||
|
||||
// Check if all submissions are correct
|
||||
for (let i = 0; i < segments.length; i++) {
|
||||
if (segments[i] === undefined || segments[i].segment === undefined || segments[i].category === undefined) {
|
||||
@@ -165,6 +167,14 @@ module.exports = async function postSkipSegments(req, res) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Reject segemnt if it's in the no segments list
|
||||
if (noSegmentList.indexOf(segments[i].category) !== -1) {
|
||||
// TODO: Do something about the fradulent submission
|
||||
res.sendStatus(403);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
let startTime = parseFloat(segments[i].segment[0]);
|
||||
let endTime = parseFloat(segments[i].segment[1]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user