mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-06 19:47:00 +03:00
allow submissions when duration is parsed as 0
This commit is contained in:
@@ -105,9 +105,11 @@ async function autoModerateSubmission(submission, callback) {
|
|||||||
} 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));
|
||||||
|
if (duration === 0) {
|
||||||
|
// Allow submission if the duration is 0 (bug in youtube api)
|
||||||
|
return false;
|
||||||
|
} else if ((submission.endTime - submission.startTime) > (duration/100)*80) {
|
||||||
// Reject submission if over 80% of the video
|
// Reject submission if over 80% of the video
|
||||||
if ((submission.endTime - submission.startTime) > (duration/100)*80) {
|
|
||||||
return "Sponsor segment is over 80% of the video.";
|
return "Sponsor segment is over 80% of the video.";
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user