mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2024-11-10 01:02:30 +01:00
Change how video duration check works for submissions
This commit is contained in:
parent
8eb6f5b2ea
commit
5c10e071dc
1 changed files with 6 additions and 3 deletions
|
@ -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}`));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue