Fresh start (#110)

* Fresh start

* Create an xml include plugin (#111)

* Restructure and add testing (#114)

* rooibos setup

* Restructure and add testing

* docs

* Restore manifestpipi

* Description in tools

* A bit of docs

* Auto bind feature (#115)

* Auto bind feature

* Fix children merge

* bs plugin fix

* Feature/app controller (#120)

* Initial layout

* Restructuring and plugin work

* A couple of tweaks in binding stuff

* tweaks

* basic stack

* Add basic app controller

* Support json5/yaml in playlet config files (#123)

* Support json5 in playlet config files

* Add yaml to the mix

* Delete old lib project

* plugin fix

* plugin tweak

* verbose logging

* Revert "verbose logging"

This reverts commit 25867f4226703d83102519a0d48d1cc46a9876de.

* One idea to fix the include plugin

* Fix instability in plugins

* Feature/navbar (#126)

* Navbar

* typo

* comment

* Single content node, and tests

* Remove unused field

* tweaks

* update dependencies command

* tweak formatting

* Add web app screen

* Set id in created screens

* Search screen

* Tests

* Show playlists and channels in search results

* Move screen stuff to app controller

* Home screen (wip)

* Add preferences node

* README.md copyedits (#130)

* README.md: Fix typos

* README.md: Standardize capitalization and punctuation

* Update docs/README.md

---------

Co-authored-by: Brahim Hadriche <brahim.hadriche@gmail.com>

* Web server: round 1 (#131)

* web server object

* Logging

* Web server round 1

* Lint fix

* Small tweaks

---------

Co-authored-by: github-action linter <githubaction@githubaction.com>

* Logging to file

* Leftover

* Add logs file to web server

* Fix for timeout

* Disable keepalive connection

* add openapi spec file

* Lint fix

* add prefs version in api

* Add ecp api definition

* Lint fix

* Settings rework (#135)

* Settings rework

* Standard OnFocusChange event

* Video player stuff (#136)

* Video player stuff

* Restructure things so that focus is better handled

* Lint fix

---------

Co-authored-by: github-action linter <githubaction@githubaction.com>

* Exit dialog

* A bunch of changes

* New http client

* Set TODO priorities

* picture in picture

* mark video watched

* Video player stuff mostly there

* update spec file

* Sponsorblock

* FuncName

* SponsorBlock notifications

* Lint fix

* misc

* remove basic auth feature flag (until we start using it)

* Play queue part 1

* type fix

* handle unicode in request body

* SponsorBlock chapter label

* modal base

* remove a hack

* Invidious settings

* web server reduce timeout

* Test for captions

* Lint fix

* remove rpc stuff

* small change

* Solve focus management

* a couple of fixes

* Remove a bunch of todos

* feed error handling wip

* Lint fix

* navigation in instance settings

* home screen pagination support

* Refactor feed to support pagination on search page

* cell loading animation

* Tweak caching

* delete test screen

* playlist support part 1

* Basic playlist view

* Restore playlist/channel handler

* Refactor some content node stuff, and add an auth popup dialog

* A bad implementation of a playqueue

* Lint fix

* playlist cast fix

* Feature/web app catch up (#139)

* playlist cast fix

* Move things around

* support playlists in web app

* update api

* Bump deps

* Downgrade todo

---------

Co-authored-by: Bryce Harrington <bryce@bryceharrington.org>
Co-authored-by: github-action linter <githubaction@githubaction.com>
This commit is contained in:
authored and GitHub committed 2023-09-07 17:18:25 -04:00
1 parent 79f74141c5
commit 43166fb43b
349 files changed
+12784 -7660

No files matched your search

@@ -0,0 +1,147 @@
' Bind all nodes that registered for auto-binding
' Should be called once from a root node
' Can be called later to rebind nodes that were added after the first call
function AutoBindSceneGraph() as void
if not m.global.hasField("AutoBindNodes")
m.global.addField("AutoBindNodes", "nodearray", false)
end if
nodes = m.global.AutoBindNodes
m.global.AutoBindNodes = []
for each node in nodes
node@.BindNodeFieldsAndProps(invalid)
end for
for each node in nodes
node@.BindScopeFields(invalid)
end for
for each node in nodes
node.binding_done = true
end for
end function
' Bind the node fields, to be called with interface function
function BindNodeFieldsAndProps(unused as dynamic) as void
node = m.top
bindings = node.bindings
if bindings = invalid
return
end if
if bindings.fields <> invalid
for each fieldId in bindings.fields
if node.getField(fieldId) <> invalid
continue for
end if
reference = FindNodeFromPath(node, bindings.fields[fieldId])
if reference <> invalid
node[fieldId] = reference
end if
end for
end if
if bindings.childProps <> invalid
for each nodeId in bindings.childProps
child = node.findNode(nodeId)
if child = invalid
continue for
end if
childProps = bindings.childProps[nodeId]
for each childPropId in childProps
if child.getField(childPropId) <> invalid
continue for
end if
reference = FindNodeFromPath(child, childProps[childPropId])
if reference <> invalid
child[childPropId] = reference
end if
end for
end for
end if
end function
function FindNodeFromPath(root as object, path as string) as object
node = root
if path.StartsWith("/")
node = node.getScene()
path = path.Mid(1)
end if
pathParts = path.Tokenize("/")
for i = 0 to pathParts.Count() - 1
if node = invalid
return invalid
end if
if pathParts[i] = "."
continue for
end if
if pathParts[i] = ".."
node = node.getParent()
continue for
end if
node = node.findNode(pathParts[i])
end for
if root.isSameNode(node)
' if a node is referencing itself, it's probably a mistake
return invalid
end if
return node
end function
' Create scoped fields (m.fieldName) for all fields in this node
' To be called after BindNodeFieldsAndProps
function BindScopeFields(unused as dynamic)
types = m.top.getFieldTypes()
for each key in types
if m.DoesExist(key)
continue for
end if
if types[key] <> "node"
continue for
end if
node = m.top.getField(key)
m[key] = node
end for
end function
' Bind a single node. This for nodes created dynamically, and all its dependencies are expected to be bound already
function BindNode(unused as dynamic)
RemoveNodeFromGlobalAutoBind()
BindNodeFieldsAndProps(invalid)
BindScopeFields(invalid)
m.top.binding_done = true
end function
function RemoveNodeFromGlobalAutoBind() as void
if not m.global.hasField("AutoBindNodes")
return
end if
nodes = m.global.AutoBindNodes
for i = 0 to nodes.Count() - 1
if m.top.isSameNode(nodes[i])
nodes.Delete(i)
m.global.AutoBindNodes = nodes
return
end if
end for
end function
function OnBindingSetRegisterAutoBind()
if not m.global.hasField("AutoBindNodes")
m.global.addField("AutoBindNodes", "nodearray", false)
end if
nodes = m.global.AutoBindNodes
newNodes = [m.top]
newNodes.append(nodes)
m.global.AutoBindNodes = newNodes
end function
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<component name="AutoBind" extends="Group">
<interface>
<field id="bindings" type="assocarray" onChange="OnBindingSetRegisterAutoBind" />
<field id="binding_done" type="boolean" onChange="OnNodeReady" />
<function name="BindNodeFieldsAndProps" />
<function name="BindScopeFields" />
<function name="BindNode" />
</interface>
</component>
@@ -0,0 +1,3 @@
function Init()
InitializeBindings() ' auto-generated!
end function'//# sourceMappingURL=./AutoBindNode1.bs.map
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8" ?>
<component name="AutoBindNode1" extends="Group">
<interface>
<field id="reference1" type="node" />
<field id="reference2" type="node" />
<field id="bindings" type="assocarray" onChange="OnBindingSetRegisterAutoBind" />
<field id="binding_done" type="boolean" onChange="OnNodeReady" />
<function name="BindNodeFieldsAndProps" />
<function name="BindScopeFields" />
<function name="BindNode" />
</interface>
<script type="text/brightscript" uri="pkg:/components/parts/AutoBind/AutoBind.part.brs" />
<script type="text/brightscript" uri="pkg:/components/parts/AutoBind/tests/AutoBindNode1_bindings.brs" />
<script type="text/brightscript" uri="pkg:/components/parts/AutoBind/tests/AutoBindNode1.brs" />
<script type="text/brightscript" uri="pkg:/source/roku_modules/bslib/bslib.brs" />
<children>
<AutoBindNode2 id="AutoBindNode2" />
</children>
</component>
<!--//# sourceMappingURL=./AutoBindNode1.xml.map -->
@@ -0,0 +1,3 @@
function Init()
InitializeBindings() ' auto-generated!
end function'//# sourceMappingURL=./AutoBindNode1Container.bs.map
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8" ?>
<component name="AutoBindNode1Container" extends="Group">
<interface>
<field id="bindings" type="assocarray" onChange="OnBindingSetRegisterAutoBind" />
<field id="binding_done" type="boolean" onChange="OnNodeReady" />
<function name="BindNodeFieldsAndProps" />
<function name="BindScopeFields" />
<function name="BindNode" />
</interface>
<script type="text/brightscript" uri="pkg:/components/parts/AutoBind/AutoBind.part.brs" />
<script type="text/brightscript" uri="pkg:/components/parts/AutoBind/tests/AutoBindNode1Container_bindings.brs" />
<script type="text/brightscript" uri="pkg:/components/parts/AutoBind/tests/AutoBindNode1Container.brs" />
<script type="text/brightscript" uri="pkg:/source/roku_modules/bslib/bslib.brs" />
<children>
<AutoBindNode1 id="AutoBindNode1" reference2=".." />
</children>
</component>
<!--//# sourceMappingURL=./AutoBindNode1Container.xml.map -->
@@ -0,0 +1,11 @@
' This method is auto-generated!
function InitializeBindings()
m.top.bindings = {
fields: {
},
childProps: {
}
}
end function'//# sourceMappingURL=./AutoBindNode1Container_bindings.bs.map
@@ -0,0 +1,11 @@
' This method is auto-generated!
function InitializeBindings()
m.top.bindings = {
fields: {
"reference1": "./AutoBindNode2"
},
childProps: {
}
}
end function'//# sourceMappingURL=./AutoBindNode1_bindings.bs.map
@@ -0,0 +1,3 @@
function Init()
InitializeBindings() ' auto-generated!
end function'//# sourceMappingURL=./AutoBindNode2.bs.map
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8" ?>
<component name="AutoBindNode2" extends="Group">
<interface>
<field id="parent" type="node" />
<field id="some_other_field" type="node" />
<field id="bindings" type="assocarray" onChange="OnBindingSetRegisterAutoBind" />
<field id="binding_done" type="boolean" onChange="OnNodeReady" />
<function name="BindNodeFieldsAndProps" />
<function name="BindScopeFields" />
<function name="BindNode" />
</interface>
<script type="text/brightscript" uri="pkg:/components/parts/AutoBind/AutoBind.part.brs" />
<script type="text/brightscript" uri="pkg:/components/parts/AutoBind/tests/AutoBindNode2_bindings.brs" />
<script type="text/brightscript" uri="pkg:/components/parts/AutoBind/tests/AutoBindNode2.brs" />
<script type="text/brightscript" uri="pkg:/source/roku_modules/bslib/bslib.brs" />
</component>
<!--//# sourceMappingURL=./AutoBindNode2.xml.map -->
@@ -0,0 +1,12 @@
' This method is auto-generated!
function InitializeBindings()
m.top.bindings = {
fields: {
"parent": "..",
"some_other_field": "../base2"
},
childProps: {
}
}
end function'//# sourceMappingURL=./AutoBindNode2_bindings.bs.map
@@ -0,0 +1,3 @@
function Init()
end function
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<component name="AutoBindNode1" extends="Group" includes="AutoBind">
<interface>
<field id="reference1" type="node" bind="./AutoBindNode2" />
<field id="reference2" type="node" />
</interface>
<children>
<AutoBindNode2 id="AutoBindNode2" />
</children>
</component>
@@ -0,0 +1,3 @@
function Init()
end function
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<component name="AutoBindNode1Container" extends="Group" includes="AutoBind">
<children>
<AutoBindNode1 id="AutoBindNode1" reference2=".." />
</children>
</component>
@@ -0,0 +1,3 @@
function Init()
end function
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<component name="AutoBindNode2" extends="Group" includes="AutoBind">
<interface>
<field id="parent" type="node" bind=".." />
<field id="some_other_field" type="node" bind="../base2" />
</interface>
</component>
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<component name="Focus" extends="Group">
<interface>
<field id="focus" type="boolean" alwaysNotify="true" onChange="OnFocusChange" />
</interface>
</component>