mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-06 19:47:00 +03:00
Fix private db table removal and original title type
This commit is contained in:
@@ -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,
|
||||||
|
|||||||
@@ -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 {
|
||||||
|
|||||||
Reference in New Issue
Block a user