Skip to content

Commit 5c10e07

Browse files
committed
Change how video duration check works for submissions
1 parent 8eb6f5b commit 5c10e07

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/routes/postSkipSegments.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -388,9 +388,12 @@ async function updateDataIfVideoDurationChange(videoID: VideoID, service: Servic
388388
// Only treat as difference if both the api duration and submitted duration have changed
389389
if (videoDurationChanged(videoDuration) && (!videoDurationParam || videoDurationChanged(videoDurationParam))) {
390390
// Hide all previous submissions
391-
for (const submission of previousSubmissions) {
392-
await db.prepare("run", `UPDATE "sponsorTimes" SET "hidden" = 1 WHERE "UUID" = ?`, [submission.UUID]);
393-
}
391+
await db.prepare("run", `UPDATE "sponsorTimes" SET "hidden" = 1
392+
WHERE "videoID" = ? AND "service" = ? AND "videoDuration" != ?
393+
AND "hidden" = 0 AND "shadowHidden" = 0 AND
394+
"actionType" != 'full' AND "votes" > -2`,
395+
[videoID, service, videoDuration]);
396+
394397
lockedCategoryList = [];
395398
deleteLockCategories(videoID, null, null, service).catch((e) => Logger.error(`deleting lock categories: ${e}`));
396399
}

0 commit comments

Comments
 (0)