mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-26 17:38:28 +03:00
Renamed old get method
This commit is contained in:
26
src/routes/oldGetVideoSponsorTimes.js
Normal file
26
src/routes/oldGetVideoSponsorTimes.js
Normal file
@@ -0,0 +1,26 @@
|
||||
var getSkipSegments = require("./getSkipSegments.js")
|
||||
|
||||
|
||||
module.exports = function (req, res) {
|
||||
let videoID = req.query.videoID;
|
||||
|
||||
let segments = getSkipSegments.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
|
||||
}
|
||||
Reference in New Issue
Block a user