mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2026-03-15 15:02:52 +03:00
Merge pull request #8 from ajayyy/experimental
Fixed NaN check not correct
This commit is contained in:
4
index.js
4
index.js
@@ -109,7 +109,7 @@ app.get('/api/postVideoSponsorTimes', function (req, res) {
|
||||
startTime = parseFloat(startTime);
|
||||
endTime = parseFloat(endTime);
|
||||
|
||||
if (startTime == NaN || endTime == NaN) {
|
||||
if (isNaN(startTime) || isNaN(endTime)) {
|
||||
//invalid request
|
||||
res.sendStatus(400);
|
||||
return;
|
||||
@@ -224,8 +224,6 @@ app.get('/api/voteOnSponsorTime', function (req, res) {
|
||||
//oldIncrementAmount will be zero is row is null
|
||||
db.prepare("UPDATE sponsorTimes SET votes = votes + ? WHERE UUID = ?").run(incrementAmount - oldIncrementAmount, UUID);
|
||||
|
||||
//update the votes table
|
||||
|
||||
//added to db
|
||||
res.sendStatus(200);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user