(Regression) Fix issue where auto-play keeps playing the same videos in a loop

This commit is contained in:
Brahim Hadriche committed 2023-12-15 21:27:41 -05:00
1 parent 49be599c32
commit 2ba2115da7
6 files changed
+32 -34

No files matched your search

@@ -186,20 +186,20 @@ function OnVideoPlayerStateChange() as void
if state = "finished"
if content = invalid
m.container@.watchedVideosClear()
m.playQueue@.watchedVideosClear()
VideoUtils.CloseVideo()
return
end if
metadata = content.metadata
if metadata = invalid
m.container@.watchedVideosClear()
m.playQueue@.watchedVideosClear()
VideoUtils.CloseVideo()
return
end if
if not PlayNext(metadata.recommendedVideos)
m.container@.watchedVideosClear()
m.playQueue@.watchedVideosClear()
VideoUtils.CloseVideo()
end if
end if
@@ -251,7 +251,7 @@ function PlayNextRecommendedVideo(recommendedVideos as object) as boolean
if videoId = invalid
continue for
end if
if not m.container@.watchedVideosContain(videoId)
if not m.playQueue@.watchedVideosContain(videoId)
LogInfo(`Playing next recommended video (${videoId})`)
instance = m.invidious@.GetCurrentInstance()
node = InvidiousContent.ToVideoContentNode(invalid, metadata, instance)
@@ -277,7 +277,7 @@ function OnkeyEvent(key as string, press as boolean) as boolean
end if
if key = "back"
m.container@.watchedVideosClear()
m.playQueue@.watchedVideosClear()
VideoUtils.CloseVideo()
return true
end if