mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-26 17:38:28 +03:00
Merge branch 'nb-mod-fetch' of https://github.com/andrewzlee/SponsorBlockServer into nb-mod-fetch
This commit is contained in:
@@ -81,7 +81,7 @@ async function autoModerateSubmission(submission, callback) {
|
|||||||
let {err, data} = await new Promise((resolve, reject) => {
|
let {err, data} = await new Promise((resolve, reject) => {
|
||||||
YouTubeAPI.videos.list({
|
YouTubeAPI.videos.list({
|
||||||
part: "contentDetails",
|
part: "contentDetails",
|
||||||
id: videoID
|
id: submission.videoID
|
||||||
}, (err, data) => resolve({err, data}));
|
}, (err, data) => resolve({err, data}));
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -90,7 +90,7 @@ async function autoModerateSubmission(submission, callback) {
|
|||||||
} else {
|
} else {
|
||||||
// Check to see if video exists
|
// Check to see if video exists
|
||||||
if (data.pageInfo.totalResults === 0) {
|
if (data.pageInfo.totalResults === 0) {
|
||||||
return "No video exists with id " + videoID;
|
return "No video exists with id " + submission.videoID;
|
||||||
} else {
|
} else {
|
||||||
let duration = data.items[0].contentDetails.duration;
|
let duration = data.items[0].contentDetails.duration;
|
||||||
duration = isoDurations.toSeconds(isoDurations.parse(duration));
|
duration = isoDurations.toSeconds(isoDurations.parse(duration));
|
||||||
@@ -195,7 +195,7 @@ module.exports = async function postSkipSegments(req, res) {
|
|||||||
let hashedIP = getHash(getIP(req) + config.globalSalt);
|
let hashedIP = getHash(getIP(req) + config.globalSalt);
|
||||||
|
|
||||||
//check if this user is on the vip list
|
//check if this user is on the vip list
|
||||||
let isVIP = db.prepare("SELECT count(*) as userCount FROM vipUsers WHERE userID = ?").get(userID).userCount > 0;
|
let isVIP = db.prepare("get", "SELECT count(*) as userCount FROM vipUsers WHERE userID = ?", [userID]).userCount > 0;
|
||||||
|
|
||||||
// Check if all submissions are correct
|
// Check if all submissions are correct
|
||||||
for (let i = 0; i < segments.length; i++) {
|
for (let i = 0; i < segments.length; i++) {
|
||||||
@@ -240,9 +240,6 @@ module.exports = async function postSkipSegments(req, res) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
//check if this user is on the vip list
|
|
||||||
let vipRow = db.prepare('get', "SELECT count(*) as userCount FROM vipUsers WHERE userID = ?", [userID]);
|
|
||||||
|
|
||||||
//get current time
|
//get current time
|
||||||
let timeSubmitted = Date.now();
|
let timeSubmitted = Date.now();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user