mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-17 03:44:20 +03:00
25 lines
609 B
TypeScript
25 lines
609 B
TypeScript
import {handleGetSegments} from './getSkipSegments';
|
|
import {Request, Response} from 'express';
|
|
|
|
export function oldGetVideoSponsorTimes(req: Request, res: Response) {
|
|
let segments = handleGetSegments(req, res);
|
|
|
|
if (segments) {
|
|
// Convert to old outputs
|
|
let sponsorTimes = [];
|
|
let UUIDs = [];
|
|
|
|
for (const segment of segments) {
|
|
sponsorTimes.push(segment.segment);
|
|
UUIDs.push(segment.UUID);
|
|
}
|
|
|
|
res.send({
|
|
sponsorTimes,
|
|
UUIDs,
|
|
});
|
|
}
|
|
|
|
// Error has already been handled in the other method
|
|
}
|