mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2026-01-01 06:09:24 +03:00
Renamed variables and added spacing.
This commit is contained in:
@@ -112,15 +112,16 @@ async function autoModerateSubmission(submission, callback) {
|
|||||||
return "Sponsor segment is over 80% of the video.";
|
return "Sponsor segment is over 80% of the video.";
|
||||||
} else {
|
} else {
|
||||||
let overlap = false;
|
let overlap = false;
|
||||||
|
|
||||||
let response = await fetch("https://ai.neuralblock.app/api/getSponsorSegments?vid=" + submission.videoID);
|
let response = await fetch("https://ai.neuralblock.app/api/getSponsorSegments?vid=" + submission.videoID);
|
||||||
if (!response.ok) return false;
|
if (!response.ok) return false;
|
||||||
|
|
||||||
nb_predictions = await response.json();
|
let nbPredictions = await response.json();
|
||||||
for (const nb_seg of nb_predictions.sponsorSegments){
|
for (const nbSegment of nbPredictions.sponsorSegments) {
|
||||||
// The submission needs to be a subset of the widened NB prediction
|
// The submission needs to be a subset of the widened NB prediction
|
||||||
// and at least 65% of NB's prediction.
|
// and at least 65% of NB's prediction.
|
||||||
if (nb_seg[0]-2 <= submission.startTime && submission.endTime <= nb_seg[1]+2){
|
if (nbSegment[0] - 2 <= submission.startTime && submission.endTime <= nbSegment[1] + 2){
|
||||||
if ((submission.endTime - submission.startTime)/(nb_seg[1]-nb_seg[0]) >= 0.65){
|
if ((submission.endTime - submission.startTime) / (nbSegment[1]-nbSegment[0]) >= 0.65){
|
||||||
overlap = true;
|
overlap = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user