Mark video watched (#59)

* Mark video watched

* Lint fix

* return type

* fix return type

* Changelog

---------

Co-authored-by: github-action linter <githubaction@githubaction.com>
This commit is contained in:
Brahim Hadricheandgithub-action linter authored and GitHub committed 2023-04-05 17:58:24 -04:00
1 parent 53f9249b9f
commit 82162d52c1
4 files changed
+40 -2

No files matched your search

@@ -0,0 +1,11 @@
import "pkg:/source/services/Invidious.bs"
@asynctask
function MarkVideoWatchedTask(input as object) as object
videoId = input.videoId
success = Invidious.MarkVideoWatched(videoId)
return {
success: success
}
end function
@@ -1,6 +1,8 @@
import "pkg:/source/asyncTask/asyncTask.bs"
import "pkg:/source/services/Invidious.bs"
import "pkg:/components/Dialog/DialogUtils.bs"
import "pkg:/components/SponsorBlockNotification/SponsorBlockNotificationManager.bs"
import "pkg:/components/VideoPlayer/MarkVideoWatchedTask.bs"
function PlayVideo(videoId as string, args = invalid as object)
sender = args?.sender
@@ -35,6 +37,8 @@ function PlayVideo(videoId as string, args = invalid as object)
if videoContainer.fullscreen
videoContainer.videoPlayer.SetFocus(true)
end if
StartAsyncTask(MarkVideoWatchedTask, { videoId: videoId })
end function
function CloseVideo(setFocus = true as boolean)