[Part 1] Innertube (#502)
* innertube structure * Basic search results parsing * Lint fix * Fix ctt * adjust parser, parse trending pages * Lint fix * channel wip * channel parsing - wip * OAuth support * cancellation utils * Lint fix * Home feed with tv client * Lint fix * add some browse endpoints * oauth adjust * refactor * Add nodes * More parsing * oauth refactor * playlist * WIP: built-in instance * WIP: Channels now kinda load * Channel view * workaround for playlist pagination * default instance and display name * video thumbnails * changelog * privacy --------- Co-authored-by: github-action linter <githubaction@githubaction.com>
This commit is contained in:
1 parent
a9c8ee6eb6
commit
9f3eee900f
23 files changed
+2019
-521
No files matched your search
@@ -0,0 +1,47 @@
|
||||
import "pkg:/source/utils/Types.bs"
|
||||
|
||||
namespace CancellationUtils
|
||||
|
||||
function IsCancelled(cancellation as dynamic) as boolean
|
||||
if cancellation = invalid or cancellation.node = invalid or cancellation.field = invalid
|
||||
return false
|
||||
end if
|
||||
|
||||
return cancellation.node[cancellation.field] = cancellation.value
|
||||
end function
|
||||
|
||||
function ObserveCancellationScoped(cancellation as dynamic, messagePort as dynamic) as void
|
||||
if cancellation = invalid or cancellation.node = invalid or cancellation.field = invalid
|
||||
return
|
||||
end if
|
||||
|
||||
cancellation.node.ObserveFieldScoped(cancellation.field, messagePort)
|
||||
end function
|
||||
|
||||
function UnobserveCancellationScoped(cancellation as dynamic) as void
|
||||
if cancellation = invalid or cancellation.node = invalid or cancellation.field = invalid
|
||||
return
|
||||
end if
|
||||
|
||||
cancellation.node.UnobserveFieldScoped(cancellation.field)
|
||||
end function
|
||||
|
||||
function IsCancellationEvent(cancellation as dynamic, message as dynamic) as boolean
|
||||
messageType = type(message)
|
||||
if messageType <> "roSGNodeEvent"
|
||||
return false
|
||||
end if
|
||||
|
||||
if cancellation = invalid or cancellation.node = invalid or cancellation.field = invalid
|
||||
return false
|
||||
end if
|
||||
|
||||
node = message.getRoSGNode()
|
||||
if node = invalid or not node.isSameNode(cancellation.node)
|
||||
return false
|
||||
end if
|
||||
|
||||
return cancellation.field = message.getField() and cancellation.value = message.getData()
|
||||
end function
|
||||
|
||||
end namespace
|
||||
Reference in new issue
Block a user