mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2026-04-14 23:18:58 +03:00
Merge branch 'master' of https://github.com/ajayyy/SponsorBlockServer into k8s-test
This commit is contained in:
@@ -1,9 +1,8 @@
|
|||||||
-- sponsorTimes
|
-- sponsorTimes
|
||||||
|
|
||||||
CREATE INDEX IF NOT EXISTS "privateDB_sponsorTimes_v3"
|
CREATE INDEX IF NOT EXISTS "privateDB_sponsorTimes_v4"
|
||||||
ON public."sponsorTimes" USING btree
|
ON public."sponsorTimes" USING btree
|
||||||
("hashedIP" COLLATE pg_catalog."default" ASC NULLS LAST, "videoID" ASC NULLS LAST, service COLLATE pg_catalog."default" ASC NULLS LAST)
|
("videoID" ASC NULLS LAST, service COLLATE pg_catalog."default" ASC NULLS LAST, "timeSubmitted" ASC NULLS LAST);
|
||||||
;
|
|
||||||
|
|
||||||
-- votes
|
-- votes
|
||||||
|
|
||||||
|
|||||||
9
databases/_upgrade_private_9.sql
Normal file
9
databases/_upgrade_private_9.sql
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
BEGIN TRANSACTION;
|
||||||
|
|
||||||
|
-- Add primary keys
|
||||||
|
|
||||||
|
DROP INDEX "privateDB_sponsorTimes_v3"; --!sqlite-ignore
|
||||||
|
|
||||||
|
UPDATE "config" SET value = 9 WHERE key = 'version';
|
||||||
|
|
||||||
|
COMMIT;
|
||||||
@@ -54,6 +54,7 @@ describe("lockCategoriesRecords", () => {
|
|||||||
await db.prepare("run", insertLockCategoryQuery, [lockVIPUserHash, "delete-record-1", "mute", "sponsor", "reason-5", "YouTube"]);
|
await db.prepare("run", insertLockCategoryQuery, [lockVIPUserHash, "delete-record-1", "mute", "sponsor", "reason-5", "YouTube"]);
|
||||||
await db.prepare("run", insertLockCategoryQuery, [lockVIPUserHash, "delete-record-1", "skip", "intro", "reason-5", "YouTube"]);
|
await db.prepare("run", insertLockCategoryQuery, [lockVIPUserHash, "delete-record-1", "skip", "intro", "reason-5", "YouTube"]);
|
||||||
await db.prepare("run", insertLockCategoryQuery, [lockVIPUserHash, "delete-record-1", "mute", "intro", "reason-5", "YouTube"]);
|
await db.prepare("run", insertLockCategoryQuery, [lockVIPUserHash, "delete-record-1", "mute", "intro", "reason-5", "YouTube"]);
|
||||||
|
await db.prepare("run", insertLockCategoryQuery, [lockVIPUserHash, "delete-record-poi", "poi", "poi_highlight", "reason-6", "YouTube"]);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("Should update the database version when starting the application", async () => {
|
it("Should update the database version when starting the application", async () => {
|
||||||
@@ -519,4 +520,44 @@ describe("lockCategoriesRecords", () => {
|
|||||||
})
|
})
|
||||||
.catch(err => done(err));
|
.catch(err => done(err));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("should be able to delete poi type category by type poi", (done) => {
|
||||||
|
const videoID = "delete-record-poi";
|
||||||
|
const json = {
|
||||||
|
videoID,
|
||||||
|
userID: lockVIPUser,
|
||||||
|
categories: [
|
||||||
|
"poi_highlight",
|
||||||
|
],
|
||||||
|
actionTypes: ["poi"]
|
||||||
|
};
|
||||||
|
client.delete(endpoint, { data: json })
|
||||||
|
.then(async res => {
|
||||||
|
assert.strictEqual(res.status, 200);
|
||||||
|
const result = await checkLockCategories(videoID);
|
||||||
|
assert.strictEqual(result.length, 0);
|
||||||
|
done();
|
||||||
|
})
|
||||||
|
.catch(err => done(err));
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should be able to delete poi type category by type poi", (done) => {
|
||||||
|
const videoID = "delete-record-poi";
|
||||||
|
const json = {
|
||||||
|
videoID,
|
||||||
|
userID: lockVIPUser,
|
||||||
|
categories: [
|
||||||
|
"poi_highlight",
|
||||||
|
],
|
||||||
|
actionTypes: ["poi"]
|
||||||
|
};
|
||||||
|
client.delete(endpoint, { data: json })
|
||||||
|
.then(async res => {
|
||||||
|
assert.strictEqual(res.status, 200);
|
||||||
|
const result = await checkLockCategories(videoID);
|
||||||
|
assert.strictEqual(result.length, 0);
|
||||||
|
done();
|
||||||
|
})
|
||||||
|
.catch(err => done(err));
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user