feat: enhance extension API (#1413)

This commit is contained in:
Levi authored and GitHub committed 2026-07-14 20:52:21 +08:00
1 parent 9fb3758203
commit fdfc6902a7
10 files changed
+96 -46

No files matched your search

+4 -5
View File
@@ -41,18 +41,17 @@ gopeed.events.onError(async function (ctx) {
if (!req || !req.rawUrl || !req.url || !req.url.includes('/__blob/')) {
return;
}
req.labels = req.labels || {};
if (req.labels.rebuilt === 'true') {
return;
}
try {
req.url = createRangeBlobUrl(req.rawUrl);
req.labels.started = 'true';
req.labels.rebuilt = 'true';
ctx.task.setUrl(createRangeBlobUrl(req.rawUrl));
req.putLabel('started', 'true');
req.putLabel('rebuilt', 'true');
ctx.task.continue();
} catch (error) {
req.labels.rebuildError = String(error);
req.putLabel('rebuildError', String(error));
throw error;
}
});