mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-08 04:27:09 +03:00
original as bool not string
This commit is contained in:
@@ -74,12 +74,12 @@ export const insertChapter = async(db: IDatabase, description: string, params: i
|
|||||||
// titles
|
// titles
|
||||||
interface insertTitleParams extends baseParams {
|
interface insertTitleParams extends baseParams {
|
||||||
title?: string,
|
title?: string,
|
||||||
original?: string,
|
original?: boolean | number,
|
||||||
}
|
}
|
||||||
const defaultTitleParams: insertTitleParams = {
|
const defaultTitleParams: insertTitleParams = {
|
||||||
videoID: "",
|
videoID: "",
|
||||||
title: "test-title",
|
title: "test-title",
|
||||||
original: "original-video-title",
|
original: false,
|
||||||
userID: "",
|
userID: "",
|
||||||
service: Service.YouTube,
|
service: Service.YouTube,
|
||||||
hashedVideoID: "",
|
hashedVideoID: "",
|
||||||
@@ -93,6 +93,7 @@ export const insertTitle = async (db: IDatabase, overrides: insertTitleParams =
|
|||||||
const defaults = generateDefaults(identifier);
|
const defaults = generateDefaults(identifier);
|
||||||
const params = { ...defaultTitleParams, ...defaults, ...overrides };
|
const params = { ...defaultTitleParams, ...defaults, ...overrides };
|
||||||
// convert bool to 0 | 1
|
// convert bool to 0 | 1
|
||||||
|
params.original = Number(params.original);
|
||||||
await db.prepare("run", query, Object.values(params));
|
await db.prepare("run", query, Object.values(params));
|
||||||
};
|
};
|
||||||
export const insertTitleVote = async (db: IDatabase, UUID: string, votes: number, locked = false, shadowHidden = false, verification = false) => {
|
export const insertTitleVote = async (db: IDatabase, UUID: string, votes: number, locked = false, shadowHidden = false, verification = false) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user