From 9cf2e1f0e9529e043b2f3a65971e5d88cde8f8ab Mon Sep 17 00:00:00 2001 From: Ajay Date: Sat, 28 Jan 2023 02:31:49 -0500 Subject: [PATCH] Fix private db table removal and original title type --- databases/_sponsorTimes.db.sql | 2 +- src/routes/getBranding.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/databases/_sponsorTimes.db.sql b/databases/_sponsorTimes.db.sql index 8a5daf7..8a2818d 100644 --- a/databases/_sponsorTimes.db.sql +++ b/databases/_sponsorTimes.db.sql @@ -40,7 +40,7 @@ CREATE TABLE IF NOT EXISTS "config" ( CREATE TABLE IF NOT EXISTS "titles" ( "videoID" TEXT NOT NULL, "title" TEXT NOT NULL, - "original" BOOLEAN NOT NULL, + "original" INTEGER default 0, "userID" TEXT NOT NULL, "service" TEXT NOT NULL, "hashedVideoID" TEXT NOT NULL, diff --git a/src/routes/getBranding.ts b/src/routes/getBranding.ts index 0a8decf..54fc557 100644 --- a/src/routes/getBranding.ts +++ b/src/routes/getBranding.ts @@ -150,7 +150,7 @@ async function shouldKeepSubmission(submissions: BrandingDBSubmission[], type: B const shouldKeep = await Promise.all(submissions.map(async (s) => { if (s.shadowHidden != Visibility.HIDDEN) return true; - const table = type === BrandingSubmissionType.Title ? "titles" : "thumbnails"; + const table = type === BrandingSubmissionType.Title ? "titleVotes" : "thumbnailVotes"; const fetchData = () => privateDB.prepare("get", `SELECT "hashedIP" FROM "${table}" WHERE "UUID" = ?`, [s.UUID], { useReplica: true }) as Promise<{ hashedIP: HashedIP }>; try {