mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-14 07:27:01 +03:00
25 lines
636 B
TypeScript
25 lines
636 B
TypeScript
import {handleGetSegments} from './getSkipSegments';
|
|
import {Request, Response} from 'express';
|
|
|
|
export async function oldGetVideoSponsorTimes(req: Request, res: Response): Promise<void> {
|
|
let segments = await 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
|
|
}
|