Fix private db table removal and original title type

This commit is contained in:
Ajay 2023-01-28 02:31:49 -05:00
parent 10e9aef8cc
commit 9cf2e1f0e9
2 changed files with 2 additions and 2 deletions

View file

@ -40,7 +40,7 @@ CREATE TABLE IF NOT EXISTS "config" (
CREATE TABLE IF NOT EXISTS "titles" ( CREATE TABLE IF NOT EXISTS "titles" (
"videoID" TEXT NOT NULL, "videoID" TEXT NOT NULL,
"title" TEXT NOT NULL, "title" TEXT NOT NULL,
"original" BOOLEAN NOT NULL, "original" INTEGER default 0,
"userID" TEXT NOT NULL, "userID" TEXT NOT NULL,
"service" TEXT NOT NULL, "service" TEXT NOT NULL,
"hashedVideoID" TEXT NOT NULL, "hashedVideoID" TEXT NOT NULL,

View file

@ -150,7 +150,7 @@ async function shouldKeepSubmission(submissions: BrandingDBSubmission[], type: B
const shouldKeep = await Promise.all(submissions.map(async (s) => { const shouldKeep = await Promise.all(submissions.map(async (s) => {
if (s.shadowHidden != Visibility.HIDDEN) return true; 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" = ?`, const fetchData = () => privateDB.prepare("get", `SELECT "hashedIP" FROM "${table}" WHERE "UUID" = ?`,
[s.UUID], { useReplica: true }) as Promise<{ hashedIP: HashedIP }>; [s.UUID], { useReplica: true }) as Promise<{ hashedIP: HashedIP }>;
try { try {