mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2024-11-10 09:07:47 +01:00
Return new created segments on success
This commit is contained in:
parent
f358605f70
commit
da3a5fe787
1 changed files with 7 additions and 1 deletions
|
@ -391,6 +391,7 @@ export async function postSkipSegments(req: Request, res: Response) {
|
|||
}
|
||||
// Will be filled when submitting
|
||||
const UUIDs = [];
|
||||
const newSegments = [];
|
||||
|
||||
try {
|
||||
//get current time
|
||||
|
@ -511,6 +512,11 @@ export async function postSkipSegments(req: Request, res: Response) {
|
|||
}
|
||||
|
||||
UUIDs.push(UUID);
|
||||
newSegments.push({
|
||||
UUID: UUID,
|
||||
category: segmentInfo.category,
|
||||
segment: segmentInfo.segment,
|
||||
});
|
||||
}
|
||||
} catch (err) {
|
||||
Logger.error(err);
|
||||
|
@ -520,7 +526,7 @@ export async function postSkipSegments(req: Request, res: Response) {
|
|||
return;
|
||||
}
|
||||
|
||||
res.sendStatus(200);
|
||||
res.json(newSegments);
|
||||
|
||||
for (let i = 0; i < segments.length; i++) {
|
||||
sendWebhooks(userID, videoID, UUIDs[i], segments[i]);
|
||||
|
|
Loading…
Reference in a new issue