mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-12 22:47:12 +03:00
Made it send 404 when nothing is found
This commit is contained in:
12
index.js
12
index.js
@@ -37,10 +37,14 @@ app.get('/api/getVideoSponsorTimes', function (req, res) {
|
||||
sponsorTimes[i][1] = rows[i].endTime;
|
||||
}
|
||||
|
||||
//send result
|
||||
res.send({
|
||||
sponsorTimes: sponsorTimes
|
||||
})
|
||||
if (sponsorTimes == []) {
|
||||
res.sendStatus(404);
|
||||
} else {
|
||||
//send result
|
||||
res.send({
|
||||
sponsorTimes: sponsorTimes
|
||||
})
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user