mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-12 22:47:12 +03:00
Added support for receiving a userID
This commit is contained in:
5
index.js
5
index.js
@@ -53,8 +53,9 @@ app.get('/api/postVideoSponsorTimes', function (req, res) {
|
||||
let videoID = req.query.videoID;
|
||||
let startTime = req.query.startTime;
|
||||
let endTime = req.query.endTime;
|
||||
let userID = req.query.userID;
|
||||
|
||||
if (typeof videoID != 'string' || startTime == undefined || endTime == undefined) {
|
||||
if (typeof videoID != 'string' || startTime == undefined || endTime == undefined || userID == undefined) {
|
||||
//invalid request
|
||||
res.sendStatus(400);
|
||||
return;
|
||||
@@ -65,7 +66,7 @@ app.get('/api/postVideoSponsorTimes', function (req, res) {
|
||||
|
||||
let UUID = uuidv1();
|
||||
|
||||
db.prepare("INSERT INTO sponsorTimes VALUES(?, ?, ?, ?)").run(videoID, startTime, endTime, UUID);
|
||||
db.prepare("INSERT INTO sponsorTimes VALUES(?, ?, ?, ?, ?)").run(videoID, startTime, endTime, UUID, userID);
|
||||
|
||||
res.sendStatus(200);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user