validation rule for callFunc operator

This commit is contained in:
Brahim Hadriche committed 2023-12-10 22:54:00 -05:00
1 parent 51966cb33f
commit 5982b5a75f
33 files changed
+64 -55

No files matched your search

@@ -186,20 +186,20 @@ function OnVideoPlayerStateChange() as void
if state = "finished"
if content = invalid
m.container@.watchedVideosClear(invalid)
m.container@.watchedVideosClear()
VideoUtils.CloseVideo()
return
end if
metadata = content.metadata
if metadata = invalid
m.container@.watchedVideosClear(invalid)
m.container@.watchedVideosClear()
VideoUtils.CloseVideo()
return
end if
if not PlayNext(metadata.recommendedVideos)
m.container@.watchedVideosClear(invalid)
m.container@.watchedVideosClear()
VideoUtils.CloseVideo()
end if
end if
@@ -226,7 +226,7 @@ function OnVideoPlayerStateChange() as void
end function
function PlayNext(recommendedVideos as object) as boolean
if m.playQueue@.PlayNextItem(invalid)
if m.playQueue@.PlayNextItem()
return true
end if
@@ -253,7 +253,7 @@ function PlayNextRecommendedVideo(recommendedVideos as object) as boolean
end if
if not m.container@.watchedVideosContain(videoId)
LogInfo(`Playing next recommended video (${videoId})`)
instance = m.invidious@.GetCurrentInstance(invalid)
instance = m.invidious@.GetCurrentInstance()
node = InvidiousContent.ToVideoContentNode(invalid, metadata, instance)
m.playQueue@.Play(node, -1)
return true
@@ -277,7 +277,7 @@ function OnkeyEvent(key as string, press as boolean) as boolean
end if
if key = "back"
m.container@.watchedVideosClear(invalid)
m.container@.watchedVideosClear()
VideoUtils.CloseVideo()
return true
end if
@@ -13,14 +13,14 @@ namespace VideoUtils
LogError("VideoContainer not found! Attempting to restore focus to top screen...")
appController = m.top.getScene().findNode("AppController")
if appController <> invalid
appController@.FocusTopScreen(invalid)
appController@.FocusTopScreen()
end if
DialogUtils.ShowDialog(`VideoContainer not found!\nPlease try again. If the problem persist, contact Playlet authors.`, "Error playing video")
return
end if
videoPlayer = container.createChild("videoPlayer")
videoPlayer.id = "VideoPlayer"
videoPlayer@.BindNode(invalid)
videoPlayer@.BindNode()
videoPlayer@.PlayWithContent(contentNode)
@@ -39,10 +39,10 @@ namespace VideoUtils
if videoPlayer = invalid
return
end if
videoPlayer@.Close(invalid)
videoPlayer@.Close()
if setFocus
videoPlayer.appController@.FocusTopScreen(invalid)
videoPlayer.appController@.FocusTopScreen()
end if
end function
@@ -76,7 +76,7 @@ namespace VideoUtils
if videoContainer.fullscreen
NodeSetFocus(videoPlayer, true)
else
videoPlayer.appController@.FocusTopScreen(invalid)
videoPlayer.appController@.FocusTopScreen()
end if
return true
end function