From c6d28d7fc527e1e564bfa94ba6d079a69b4c8ddb Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Sat, 29 Aug 2020 17:45:59 -0400 Subject: [PATCH] Apply suggestions from code review Fix syntax changes caused by bad merge Co-authored-by: Ajay Ramachandran --- src/routes/postSkipSegments.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/routes/postSkipSegments.js b/src/routes/postSkipSegments.js index e5b2f96..0b1f561 100644 --- a/src/routes/postSkipSegments.js +++ b/src/routes/postSkipSegments.js @@ -79,7 +79,7 @@ async function autoModerateSubmission(submission, callback) { let {err, data} = await new Promise((resolve, reject) => { YouTubeAPI.videos.list({ part: "contentDetails", - id: videoID + id: submission.videoID }, (err, data) => resolve({err, data})); }); @@ -88,7 +88,7 @@ async function autoModerateSubmission(submission, callback) { } else { // Check to see if video exists if (data.pageInfo.totalResults === 0) { - return "No video exists with id " + videoID; + return "No video exists with id " + submission.videoID; } else { let duration = data.items[0].contentDetails.duration; duration = isoDurations.toSeconds(isoDurations.parse(duration)); @@ -193,7 +193,7 @@ module.exports = async function postSkipSegments(req, res) { let hashedIP = getHash(getIP(req) + config.globalSalt); //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 for (let i = 0; i < segments.length; i++) {