Files
playlet-piped/src/components/VideoPlayer/SponsorBlockTask.bs
T
Brahim Hadriche 64cf7b54a0 Sponsorblock progressbar (#18)
* Generate sponsorblock bar

* Sponsorblock chapter label

* Add comment

* Fix typo

* Changelog
2022-11-30 19:41:07 -05:00

26 lines
599 B
Plaintext

import "pkg:/source/services/SponsorBlock.bs"
function Init()
m.top.functionName = "TaskMain"
end function
function TaskMain()
input = m.top.getField("input")
videoId = input.videoId
skipSegments = SponsorBlock.GetSkipSegmentsForVideo(videoId)
barPath = invalid
if skipSegments <> invalid
barPath = `tmp:/sponsorblock_bar_${videoId}.png`
SponsorBlock.GenerateProgressBarBackground(skipSegments, barPath)
end if
m.top.setField("output", {
videoId: videoId,
skipSegments: skipSegments,
barPath: barPath
})
end function