diff --git a/src/routes/postSkipSegments.ts b/src/routes/postSkipSegments.ts index 83f8eda..be0f5a6 100644 --- a/src/routes/postSkipSegments.ts +++ b/src/routes/postSkipSegments.ts @@ -388,9 +388,12 @@ async function updateDataIfVideoDurationChange(videoID: VideoID, service: Servic // Only treat as difference if both the api duration and submitted duration have changed if (videoDurationChanged(videoDuration) && (!videoDurationParam || videoDurationChanged(videoDurationParam))) { // Hide all previous submissions - for (const submission of previousSubmissions) { - await db.prepare("run", `UPDATE "sponsorTimes" SET "hidden" = 1 WHERE "UUID" = ?`, [submission.UUID]); - } + await db.prepare("run", `UPDATE "sponsorTimes" SET "hidden" = 1 + WHERE "videoID" = ? AND "service" = ? AND "videoDuration" != ? + AND "hidden" = 0 AND "shadowHidden" = 0 AND + "actionType" != 'full' AND "votes" > -2`, + [videoID, service, videoDuration]); + lockedCategoryList = []; deleteLockCategories(videoID, null, null, service).catch((e) => Logger.error(`deleting lock categories: ${e}`)); }