* Refactor and fix player * Rename functions, fix video loading indicator * Hide loading indicator on exit
21 lines
532 B
Plaintext
21 lines
532 B
Plaintext
import "pkg:/source/services/SponsorBlock.bs"
|
|
|
|
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
|