early 400 on skipSegments

This commit is contained in:
Michael C
2021-07-07 17:36:52 -04:00
parent 42e7c23ee2
commit 5e58efb07f
2 changed files with 5 additions and 1 deletions

View File

@@ -275,6 +275,10 @@ async function chooseSegments(segments: DBSegment[], max: number): Promise<DBSeg
*/
async function handleGetSegments(req: Request, res: Response): Promise<Segment[] | false> {
const videoID = req.query.videoID as VideoID;
if (!videoID) {
res.status(400).send("videoID not specified");
return false;
}
// Default to sponsor
// If using params instead of JSON, only one category can be pulled
const categories: Category[] = req.query.categories