mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-11 22:17:14 +03:00
Fix type issues
This commit is contained in:
@@ -72,7 +72,7 @@ function getSegmentsByVideoID(req: Request, videoID: string, categories: Categor
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function getSegmentsByHash(req: Request, hashedVideoIDPrefix: VideoIDHash, categories: Category[]): Record<VideoID, VideoData> {
|
function getSegmentsByHash(req: Request, hashedVideoIDPrefix: VideoIDHash, categories: Category[]): SBRecord<VideoID, VideoData> {
|
||||||
const cache: SegmentCache = {shadowHiddenSegmentIPs: {}};
|
const cache: SegmentCache = {shadowHiddenSegmentIPs: {}};
|
||||||
const segments: SBRecord<VideoID, VideoData> = {};
|
const segments: SBRecord<VideoID, VideoData> = {};
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import {Request, Response} from 'express';
|
|||||||
import { Category, VideoIDHash } from '../types/segments.model';
|
import { Category, VideoIDHash } from '../types/segments.model';
|
||||||
|
|
||||||
export async function getSkipSegmentsByHash(req: Request, res: Response) {
|
export async function getSkipSegmentsByHash(req: Request, res: Response) {
|
||||||
let hashPrefix: VideoIDHash = req.params.prefix;
|
let hashPrefix = req.params.prefix as VideoIDHash;
|
||||||
if (!hashPrefixTester(req.params.prefix)) {
|
if (!hashPrefixTester(req.params.prefix)) {
|
||||||
res.status(400).send("Hash prefix does not match format requirements."); // Exit early on faulty prefix
|
res.status(400).send("Hash prefix does not match format requirements."); // Exit early on faulty prefix
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user