From c1609a826ab7e1280faf3f95ef4fb638a83910fa Mon Sep 17 00:00:00 2001 From: Ajay Ramachandran Date: Wed, 2 Jun 2021 19:17:29 -0400 Subject: [PATCH] Don't think duration changed when API fails --- src/routes/postSkipSegments.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/postSkipSegments.ts b/src/routes/postSkipSegments.ts index a5137f9..cf09762 100644 --- a/src/routes/postSkipSegments.ts +++ b/src/routes/postSkipSegments.ts @@ -368,7 +368,7 @@ export async function postSkipSegments(req: Request, res: Response) { AND "shadowHidden" = 0 AND "votes" >= 0 AND "videoDuration" != 0`, [videoID, service]) as {videoDuration: VideoDuration, UUID: SegmentUUID}[]; // If the video's duration is changed, then the video should be unlocked and old submissions should be hidden - const videoDurationChanged = (videoDuration: number) => previousSubmissions.length > 0 && !previousSubmissions.some((e) => Math.abs(videoDuration - e.videoDuration) < 2); + const videoDurationChanged = (videoDuration: number) => videoDuration != 0 && previousSubmissions.length > 0 && !previousSubmissions.some((e) => Math.abs(videoDuration - e.videoDuration) < 2); let apiVideoInfo: APIVideoInfo = null; if (service == Service.YouTube) {