diff --git a/src/routes/getSkipSegments.ts b/src/routes/getSkipSegments.ts index 54e74e2..65ab4f1 100644 --- a/src/routes/getSkipSegments.ts +++ b/src/routes/getSkipSegments.ts @@ -53,6 +53,7 @@ async function getSegmentsByVideoID(req: Request, videoID: string, categories: C try { categories = categories.filter((category) => !/[^a-z|_|-]/.test(category)); + if (categories.length === 0) return null; const segmentsByCategory: SBRecord = (await db .prepare( @@ -88,6 +89,7 @@ async function getSegmentsByHash(req: Request, hashedVideoIDPrefix: VideoIDHash, type SegmentWithHashPerVideoID = SBRecord}>; categories = categories.filter((category) => !(/[^a-z|_|-]/.test(category))); + if (categories.length === 0) return null; const segmentPerVideoID: SegmentWithHashPerVideoID = (await db .prepare(