mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-12 06:27:14 +03:00
Add "Export segments as URL" option the unsubmitted videos section
This commit is contained in:
@@ -73,4 +73,15 @@ export function importTimes(data: string, videoDuration: number): SponsorTime[]
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
export function exportTimesAsHashParam(segments: SponsorTime[]): string {
|
||||
const hashparamSegments = segments.map(segment => ({
|
||||
actionType: segment.actionType,
|
||||
category: segment.category,
|
||||
segment: segment.segment,
|
||||
...(segment.description ? {description: segment.description} : {}) // don't include the description param if empty
|
||||
}));
|
||||
|
||||
return `#segments=${JSON.stringify(hashparamSegments)}`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user