Queue UI (#199)
* 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>
This commit is contained in:
1 parent
e0709452be
commit
3559a3fff6
24 files changed
+523
-64
No files matched your search
@@ -4,6 +4,8 @@ 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
|
||||
|
||||
|
||||
@@ -221,6 +221,7 @@ function PlayNext(recommendedVideos as object) as boolean
|
||||
return PlayNextRecommendedVideo(recommendedVideos)
|
||||
end function
|
||||
|
||||
' TODO:P2 move this to the play queue
|
||||
function PlayNextRecommendedVideo(recommendedVideos as object) as boolean
|
||||
if m.preferences["playback.autoplay"] <> true
|
||||
return false
|
||||
@@ -240,8 +241,9 @@ function PlayNextRecommendedVideo(recommendedVideos as object) as boolean
|
||||
end if
|
||||
if not m.container@.watchedVideosContain(videoId)
|
||||
LogInfo(`Playing next recommended video (${videoId})`)
|
||||
node = InvidiousContent.ToVideoContentNode(invalid, metadata, invalid)
|
||||
VideoUtils.PlayVideo(node)
|
||||
instance = m.invidious@.GetCurrentInstance(invalid)
|
||||
node = InvidiousContent.ToVideoContentNode(invalid, metadata, instance)
|
||||
m.playQueue@.Play(node, -1)
|
||||
return true
|
||||
end if
|
||||
end for
|
||||
|
||||
Reference in new issue
Block a user