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