* Refactor long press * Lint fix * Queue UI, refactor PlayQueue to use ContentNode * Add queue notification hint * Play at index * Play queue with highlight * Priority * Comment --------- Co-authored-by: github-action linter <githubaction@githubaction.com>
25 lines
749 B
Plaintext
25 lines
749 B
Plaintext
import "pkg:/source/utils/RingBuffer.bs"
|
|
|
|
function Init()
|
|
' We keep in memory the last videos we watched, to avoid a loop
|
|
' Sometimes recommended videos point to each other, and we're stuck watching
|
|
' The same 2 videos over and over again
|
|
|
|
' TODO:P1 get rid of `watchedVideos` and use the PlayQueue instead
|
|
m.watchedVideos = new RingBuffer(100)
|
|
end function
|
|
|
|
function watchedVideosContain(videoId as string) as boolean
|
|
return m.watchedVideos.Contains(videoId)
|
|
end function
|
|
|
|
function watchedVideosAdd(videoId as string)
|
|
if not watchedVideosContain(videoId)
|
|
m.watchedVideos.Push(videoId)
|
|
end if
|
|
end function
|
|
|
|
function watchedVideosClear(unused as dynamic)
|
|
m.watchedVideos = new RingBuffer(100)
|
|
end function
|