mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-11 14:07:09 +03:00
Changed to if statement
This commit is contained in:
committed by
GitHub
parent
99c8d5d238
commit
51fe7d5599
@@ -72,7 +72,7 @@ function sendDiscordNotification(userID, videoID, UUID, segmentInfo) {
|
|||||||
|
|
||||||
// Looks like this was broken for no defined youtube key - fixed but IMO we shouldn't return
|
// Looks like this was broken for no defined youtube key - fixed but IMO we shouldn't return
|
||||||
// false for a pass - it was confusing and lead to this bug - any use of this function in
|
// false for a pass - it was confusing and lead to this bug - any use of this function in
|
||||||
// the furute could have the same problem.
|
// the future could have the same problem.
|
||||||
async function autoModerateSubmission(submission, callback) {
|
async function autoModerateSubmission(submission, callback) {
|
||||||
// Get the video information from the youtube API
|
// Get the video information from the youtube API
|
||||||
if (config.youtubeAPIKey !== null) {
|
if (config.youtubeAPIKey !== null) {
|
||||||
@@ -105,7 +105,7 @@ async function autoModerateSubmission(submission, callback) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
(config.mode === 'development') && console.log("Skipped YouTube API");
|
if (config.mode === 'development') console.log("Skipped YouTube API");
|
||||||
|
|
||||||
// Can't moderate the submission without calling the youtube API
|
// Can't moderate the submission without calling the youtube API
|
||||||
// so allow by default.
|
// so allow by default.
|
||||||
@@ -115,10 +115,12 @@ async function autoModerateSubmission(submission, callback) {
|
|||||||
|
|
||||||
function proxySubmission(req) {
|
function proxySubmission(req) {
|
||||||
request.post(config.proxySubmission + '/api/skipSegments?userID='+req.query.userID+'&videoID='+req.query.videoID, {json: req.body}, (err, result) => {
|
request.post(config.proxySubmission + '/api/skipSegments?userID='+req.query.userID+'&videoID='+req.query.videoID, {json: req.body}, (err, result) => {
|
||||||
if (!err) {
|
if (config.mode === 'development') {
|
||||||
console.log('Proxy Submission: ' + result.statusCode + ' ('+result.body+')');
|
if (!err) {
|
||||||
} else {
|
console.log('Proxy Submission: ' + result.statusCode + ' ('+result.body+')');
|
||||||
console.log("Proxy Submission: Failed to make call");
|
} else {
|
||||||
|
console.log("Proxy Submission: Failed to make call");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user