mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-07 12:07:07 +03:00
Fixed duplicate check code
This commit is contained in:
@@ -170,12 +170,13 @@ module.exports = async function postSkipSegments(req, res) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//check if this info has already been submitted before
|
//check if this info has already been submitted before
|
||||||
let duplicateCheck2Row = db.prepare("SELECT UUID FROM sponsorTimes WHERE startTime = ? and endTime = ? and videoID = ?").get(startTime, endTime, videoID);
|
let duplicateCheck2Row = db.prepare("SELECT COUNT(*) as count FROM sponsorTimes WHERE startTime = ? " +
|
||||||
if (duplicateCheck2Row !== null) {
|
"and endTime = ? and category = ? and videoID = ?").get(startTime, endTime, segments[i].category, videoID);
|
||||||
// console.log(duplicateCheck2Row)
|
if (duplicateCheck2Row.count > 0) {
|
||||||
|
console.log(duplicateCheck2Row.count)
|
||||||
// console.log(db.prepare("SELECT UUID FROM sponsorTimes WHERE startTime = ? and endTime = ? and videoID = ?").all(1,10,"dQw4w9WgXcQ"))
|
// console.log(db.prepare("SELECT UUID FROM sponsorTimes WHERE startTime = ? and endTime = ? and videoID = ?").all(1,10,"dQw4w9WgXcQ"))
|
||||||
// res.sendStatus(409);
|
res.sendStatus(409);
|
||||||
// return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let autoModerateResult = await autoModerateSubmission({videoID, startTime, endTime});
|
let autoModerateResult = await autoModerateSubmission({videoID, startTime, endTime});
|
||||||
|
|||||||
Reference in New Issue
Block a user