Compare commits

...
11 Commits
Author SHA1 Message Date
Brahim Hadriche 436078bdf8 Release 0.20.1 (#305) 2024-02-23 18:24:00 -05:00
Brahim Hadriche 20120538e4 Small perf optm 2024-02-23 17:04:33 -05:00
Brahim Hadriche eec4101d29 Fix for repeated 2024-02-23 12:44:55 -05:00
Brahim Hadriche b135ba2a0a Log connect and disconnect events 2024-02-22 23:40:40 -05:00
Brahim Hadriche 9c9f24cb39 rollback rooibos 2024-02-22 19:37:17 -05:00
Brahim Hadriche 6aeb4bc8b9 Changelog 2024-02-22 19:16:55 -05:00
Brahim Hadriche 4beb7fbf3c humor 2024-02-22 19:16:23 -05:00
Brahim Hadriche 4f3512023f Move devices array to lounge api class 2024-02-22 18:58:47 -05:00
Brahim Hadriche f38115171b Error handling for registry script 2024-02-22 17:11:51 -05:00
Brahim Hadriche 7456917cec fix rale tracker warnings 2024-02-22 13:30:51 -05:00
Brahim Hadriche 4482d3333f Update info and screenshots 2024-02-21 19:52:40 -05:00
24 changed files with 104 additions and 75 deletions

No files matched your search

+6
View File
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [0.20.1] - 2024-02-23
### Fixed
- `Device connected` notification showing repeatedly
## [0.20.0] - 2024-02-21 ## [0.20.0] - 2024-02-21
### Added ### Added
+6 -6
View File
@@ -42,16 +42,16 @@ More under [Screenshots](./docs/screenshots/README.md)
- 🕵️ No Tracking - 🕵️ No Tracking
- 🛡️ Privacy driven (uses Invidious backend) - 🛡️ Privacy driven (uses Invidious backend)
- ⚔️ SponsorBlock integration (skips undesirable sections in videos) - ⚔️ SponsorBlock integration (skips undesirable sections in videos)
- 📱 Browse, search, and cast from phone using the web app - 📱 Browse, search, and cast from phone using the YouTube app or the browser
- 🔮 Picture-in-picture mode - 🔮 Picture-in-picture mode
- ⚡ Fast! [Check out how we compare with the official YouTube app](https://youtu.be/qmSvA-QQW20) - ⚡ Fast! [Check out how we compare with the official YouTube app](https://youtu.be/qmSvA-QQW20)
### Cast from phone ### Cast from phone
1. Open "Web app" tab in Playlet - Open "Remote" tab in Playlet
1. Scan QR Code with Phone - Scan QR Code with Phone, and use the browser; OR
1. Browse or search videos - Use the YouTube app to connect using the same Wi-Fi; OR
1. Click the video and choose the "Play on TV" option - Use the `Link with TV code` to connect
### Picture-in-picture ### Picture-in-picture
@@ -63,7 +63,7 @@ More under [Screenshots](./docs/screenshots/README.md)
1. Open settings in Playlet 1. Open settings in Playlet
1. Select Invidious -> Instance 1. Select Invidious -> Instance
1. Set a custom instance, or choose a public one hosted by volunteers (from https://api.invidious.io/) 1. Set a custom instance, or choose a public one hosted by volunteers (from [api.invidious.io](https://api.invidious.io/))
1. Optionally, Select `Test instance` to make sure it works 1. Optionally, Select `Test instance` to make sure it works
1. Hit save 1. Hit save
+1 -1
View File
@@ -2,7 +2,7 @@ openapi: 3.0.0
info: info:
title: Playlet Web API title: Playlet Web API
version: 0.20.0 version: 0.20.1
description: description:
Playlet Web API is a RESTful API for controlling the Playlet app on Playlet Web API is a RESTful API for controlling the Playlet app on
Roku devices. The API is intended to be used by the Playlet web app, but can Roku devices. The API is intended to be used by the Playlet web app, but can
+3 -3
View File
@@ -18,9 +18,9 @@
| --------------------------- | ------------------------------------------------ | --------------------------------------------- | | --------------------------- | ------------------------------------------------ | --------------------------------------------- |
| ![Settings](./settings.jpg) | ![Invidious instances](./invidious-settings.jpg) | ![Invidious testing](./invidious-testing.jpg) | | ![Settings](./settings.jpg) | ![Invidious instances](./invidious-settings.jpg) | ![Invidious testing](./invidious-testing.jpg) |
| Link to web app | App info | | Remote | App info |
| ----------------------------------- | --------------------------- | | ----------------------- | --------------------------- |
| ![Link to web app](./webapp-qr.jpg) | ![App info](./app-info.jpg) | | ![Remote](./remote.jpg) | ![App info](./app-info.jpg) |
## Playlet web app ## Playlet web app
Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

+6 -6
View File
@@ -1,12 +1,12 @@
{ {
"name": "playlet", "name": "playlet",
"version": "0.20.0", "version": "0.20.1",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "playlet", "name": "playlet",
"version": "0.20.0", "version": "0.20.1",
"hasInstallScript": true, "hasInstallScript": true,
"devDependencies": { "devDependencies": {
"@rokucommunity/bslint": "^0.8.17", "@rokucommunity/bslint": "^0.8.17",
@@ -29,7 +29,7 @@
"json5": "^2.2.3", "json5": "^2.2.3",
"mailparser": "^3.6.7", "mailparser": "^3.6.7",
"roku-deploy": "^3.11.2", "roku-deploy": "^3.11.2",
"rooibos-roku": "^5.11.0", "rooibos-roku": "5.10.0",
"semver": "^7.6.0", "semver": "^7.6.0",
"shelljs": "^0.8.5", "shelljs": "^0.8.5",
"ts-node": "^10.9.2", "ts-node": "^10.9.2",
@@ -3921,9 +3921,9 @@
} }
}, },
"node_modules/rooibos-roku": { "node_modules/rooibos-roku": {
"version": "5.11.0", "version": "5.10.0",
"resolved": "https://registry.npmjs.org/rooibos-roku/-/rooibos-roku-5.11.0.tgz", "resolved": "https://registry.npmjs.org/rooibos-roku/-/rooibos-roku-5.10.0.tgz",
"integrity": "sha512-qxTYwsyp6Ihb6B8tmFm+24DE/s2gMCxagvdABElGWgqL834M+kZtmwrQXvSrMkM+0gkmQfIDuw1M4v484gycYQ==", "integrity": "sha512-Idiv3nWQOEr5V8z8oHcIovjcoBffgqRtTQ5B6K+x/cGAouKxyVJp0fsZ80xQvUul9IwHQ0XIPUYbNWCR3RQ3sA==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"source-map": "^0.7.3", "source-map": "^0.7.3",
+2 -2
View File
@@ -1,6 +1,6 @@
{ {
"name": "playlet", "name": "playlet",
"version": "0.20.0", "version": "0.20.1",
"description": "Unofficial YouTube client for Roku", "description": "Unofficial YouTube client for Roku",
"devDependencies": { "devDependencies": {
"@rokucommunity/bslint": "^0.8.17", "@rokucommunity/bslint": "^0.8.17",
@@ -23,7 +23,7 @@
"json5": "^2.2.3", "json5": "^2.2.3",
"mailparser": "^3.6.7", "mailparser": "^3.6.7",
"roku-deploy": "^3.11.2", "roku-deploy": "^3.11.2",
"rooibos-roku": "^5.11.0", "rooibos-roku": "5.10.0",
"semver": "^7.6.0", "semver": "^7.6.0",
"shelljs": "^0.8.5", "shelljs": "^0.8.5",
"ts-node": "^10.9.2", "ts-node": "^10.9.2",
+2 -2
View File
@@ -1,12 +1,12 @@
{ {
"name": "playlet-app", "name": "playlet-app",
"version": "0.20.0", "version": "0.20.1",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "playlet-app", "name": "playlet-app",
"version": "0.20.0" "version": "0.20.1"
} }
} }
} }
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "playlet-app", "name": "playlet-app",
"version": "0.20.0", "version": "0.20.1",
"description": "Unofficial YouTube client for Roku", "description": "Unofficial YouTube client for Roku",
"scripts": { "scripts": {
"prebuild": "rm -rf build/playlet-app", "prebuild": "rm -rf build/playlet-app",
@@ -20,6 +20,11 @@ function GetLoadingMessage() as string
"Don't forget to like and subscribe...", "Don't forget to like and subscribe...",
"Shoveling coal into the server...", "Shoveling coal into the server...",
"Counting down from infinity...", "Counting down from infinity...",
"Unfortunately, the internet is closed today...",
"Unfortunately, we have no ads to show you...",
"Looking for the remote...",
"Finding that song that goes 'La la lala la'...",
"Waiting for the spinny thing to finish...",
] ]
end if end if
index = GetRandom(0, messages.count() - 1) index = GetRandom(0, messages.count() - 1)
+1 -1
View File
@@ -3,7 +3,7 @@ title=Playlet
# Do not update version manually, it is auto updated from package.json # Do not update version manually, it is auto updated from package.json
major_version=0 major_version=0
minor_version=20 minor_version=20
build_version=00000 build_version=00001
ui_resolutions=hd ui_resolutions=hd
+2 -2
View File
@@ -1,12 +1,12 @@
{ {
"name": "playlet-lib", "name": "playlet-lib",
"version": "0.20.0", "version": "0.20.1",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "playlet-lib", "name": "playlet-lib",
"version": "0.20.0" "version": "0.20.1"
} }
} }
} }
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "playlet-lib", "name": "playlet-lib",
"version": "0.20.0", "version": "0.20.1",
"description": "Unofficial YouTube client for Roku", "description": "Unofficial YouTube client for Roku",
"scripts": { "scripts": {
"prebuild": "rm -rf build/playlet-lib", "prebuild": "rm -rf build/playlet-lib",
@@ -57,7 +57,10 @@ namespace Invidious
end function end function
function GetInstance() as string function GetInstance() as string
instance = m.node.preferences["invidious.instance"] if m.preferences = invalid
m.preferences = m.node.preferences
end if
instance = m.preferences["invidious.instance"]
if not StringUtils.IsNullOrEmpty(instance) if not StringUtils.IsNullOrEmpty(instance)
return instance return instance
end if end if
@@ -27,6 +27,7 @@ class LoungeApi
public loungeToken public loungeToken
public sessionId public sessionId
public gSessionId public gSessionId
public devices
private ofs private ofs
private lastProcessedCommandIndex = -1 private lastProcessedCommandIndex = -1
@@ -46,6 +47,7 @@ class LoungeApi
m.ofs = 0 m.ofs = 0
m.poller = invalid m.poller = invalid
m.outgoingMessagesRequests = {} m.outgoingMessagesRequests = {}
m.devices = {}
commandHandlers = {} commandHandlers = {}
commandHandlers[COMMAND_TYPE_NOOP] = m.HandleIgnoreCommand commandHandlers[COMMAND_TYPE_NOOP] = m.HandleIgnoreCommand
@@ -336,35 +338,35 @@ class LoungeApi
return return
end if end if
devicesDict = {}
for each device in devices for each device in devices
devicesDict[device.id] = device if m.devices.DoesExist(device.id)
device.lastConnectEventType = m.devices[device.id].lastConnectEventType
end if
m.devices[device.id] = device
end for end for
m.loungeServiceNode.devices = devicesDict
end function end function
function HandleRemoteConnected(commandId as integer, commandType as string, commandArgs as object, messagesToSend as object) as void function HandleRemoteConnected(commandId as integer, commandType as string, commandArgs as object, messagesToSend as object) as void
LogInfo(commandType) LogInfo(commandType, FormatJson(commandArgs))
newDevice = commandArgs newDevice = commandArgs
id = newDevice.id id = newDevice.id
if StringUtils.IsNullOrEmpty(id) if StringUtils.IsNullOrEmpty(id)
return return
end if end if
devices = m.loungeServiceNode.devices if m.devices.DoesExist(id)
if devices = invalid device = m.devices[id]
devices = {}
end if
if devices.DoesExist(id)
device = devices[id]
device.Append(newDevice) device.Append(newDevice)
newDevice = device newDevice = device
end if end if
devices[id] = newDevice m.devices[id] = newDevice
m.loungeServiceNode.devices = devices
if ValidString(newDevice.lastConnectEventType) = commandType
return
end if
newDevice.lastConnectEventType = commandType
userName = newDevice.user userName = newDevice.user
deviceName = newDevice.name deviceName = newDevice.name
@@ -374,21 +376,18 @@ class LoungeApi
end function end function
function HandleRemoteDisconnected(commandId as integer, commandType as string, commandArgs as object, messagesToSend as object) as void function HandleRemoteDisconnected(commandId as integer, commandType as string, commandArgs as object, messagesToSend as object) as void
LogInfo(commandType) LogInfo(commandType, FormatJson(commandArgs))
device = commandArgs newDevice = commandArgs
id = device.id id = newDevice.id
if StringUtils.IsNullOrEmpty(id) if StringUtils.IsNullOrEmpty(id)
return return
end if end if
devices = m.loungeServiceNode.devices if not m.devices.DoesExist(id)
if devices = invalid return
devices = {}
end if end if
if devices.Delete(id)
m.loungeServiceNode.devices = devices m.devices[id].lastConnectEventType = commandType
end if
' TODO:P1 disconnect notification
end function end function
function HandleSetVolume(commandId as integer, commandType as string, commandArgs as object, messagesToSend as object) as void function HandleSetVolume(commandId as integer, commandType as string, commandArgs as object, messagesToSend as object) as void
@@ -6,8 +6,6 @@
<field id="screenId" type="string" /> <field id="screenId" type="string" />
<field id="loungeToken" type="string" /> <field id="loungeToken" type="string" />
<field id="devices" type="assocarray" />
<field id="join" type="boolean" alwaysNotify="true" /> <field id="join" type="boolean" alwaysNotify="true" />
<field id="outgoingMessages" type="array" alwaysNotify="true" /> <field id="outgoingMessages" type="array" alwaysNotify="true" />
@@ -17,4 +17,9 @@
"Don't forget to like and subscribe...", "Don't forget to like and subscribe...",
"Shoveling coal into the server...", "Shoveling coal into the server...",
"Counting down from infinity...", "Counting down from infinity...",
"Unfortunately, the internet is closed today...",
"Unfortunately, we have no ads to show you...",
"Looking for the remote...",
"Finding that song that goes 'La la lala la'...",
"Waiting for the spinny thing to finish...",
] ]
+1 -1
View File
@@ -3,7 +3,7 @@ title=PlayletLib
# Do not update version manually, it is auto updated from package.json # Do not update version manually, it is auto updated from package.json
major_version=0 major_version=0
minor_version=20 minor_version=20
build_version=00000 build_version=00001
ui_resolutions=hd ui_resolutions=hd
+2 -2
View File
@@ -1,12 +1,12 @@
{ {
"name": "playlet-web", "name": "playlet-web",
"version": "0.20.0", "version": "0.20.1",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "playlet-web", "name": "playlet-web",
"version": "0.20.0", "version": "0.20.1",
"devDependencies": { "devDependencies": {
"@sveltejs/vite-plugin-svelte": "^3.0.2", "@sveltejs/vite-plugin-svelte": "^3.0.2",
"@tailwindcss/typography": "^0.5.10", "@tailwindcss/typography": "^0.5.10",
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "playlet-web", "name": "playlet-web",
"version": "0.20.0", "version": "0.20.1",
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",
+17 -17
View File
@@ -293,7 +293,7 @@ end sub
' RALE_Logger__GetTime - Returns current time ' RALE_Logger__GetTime - Returns current time
' @param {string} message - log message ' @param {string} message - log message
' @return {string} - current time in format: "[hours]:[minutes]:[seconds].[miliseconds]" ' @return {string} - current time in format: "[hours]:[minutes]:[seconds].[miliseconds]"
function RALE_Logger__GetTime(message as String, level as Integer) function RALE_Logger__GetTime(_message as String, _level as Integer)
m.dt.Mark() m.dt.Mark()
h = RALE_Logger__getZeroNumber(m.dt.getHours()) h = RALE_Logger__getZeroNumber(m.dt.getHours())
@@ -311,7 +311,7 @@ end function
' RALE_Logger__GetDate - Returns current date ' RALE_Logger__GetDate - Returns current date
' @param {string} message - log message ' @param {string} message - log message
' @return {string} - current date in format: "[year]-[month]-[day]" ' @return {string} - current date in format: "[year]-[month]-[day]"
function RALE_Logger__GetDate(message as String, level as Integer) function RALE_Logger__GetDate(_message as String, _level as Integer)
m.dt.Mark() m.dt.Mark()
y = str(m.dt.getYear()).trim() y = str(m.dt.getYear()).trim()
mm = RALE_Logger__getZeroNumber(m.dt.getMonth()) mm = RALE_Logger__getZeroNumber(m.dt.getMonth())
@@ -322,14 +322,14 @@ end function
' RALE_Logger__GetLevel - Returns current verbosity level ' RALE_Logger__GetLevel - Returns current verbosity level
' @param {string} message - log message ' @param {string} message - log message
' @return {integer} - verbosity level ' @return {integer} - verbosity level
function RALE_Logger__GetLevel(message as String, level as Integer) function RALE_Logger__GetLevel(_message as String, level as Integer)
return m.verbosityList[level] return m.verbosityList[level]
end function end function
' RALE_Logger__GetMessage - Returns log message (needed for formating log message) ' RALE_Logger__GetMessage - Returns log message (needed for formating log message)
' @param {string} message - log message ' @param {string} message - log message
' @return {string} - log message ' @return {string} - log message
function RALE_Logger__GetMessage(message as String, level as Integer) function RALE_Logger__GetMessage(message as String, _level as Integer)
return message return message
end function end function
@@ -658,7 +658,7 @@ End Function
' @param {object} handlersMap - map that contains all RALE commands handlers ' @param {object} handlersMap - map that contains all RALE commands handlers
' @param {object} config - configuration constants ' @param {object} config - configuration constants
' @return {string} - connection status ' @return {string} - connection status
Sub SocketConnection_StartConnection(addr, messagePort, port, buffer, handlersMap, config) as String Sub SocketConnection_StartConnection(addr, messagePort, port, _buffer, handlersMap, config) as String
connections = {} connections = {}
appManager = createObject("roAppManager") appManager = createObject("roAppManager")
screensaverTimer = CreateObject("roTimespan") screensaverTimer = CreateObject("roTimespan")
@@ -923,7 +923,7 @@ End Sub
' UIThread_showSelectorView - RALE "showSelectorView" command handler. Shows Selector (Live) View ' UIThread_showSelectorView - RALE "showSelectorView" command handler. Shows Selector (Live) View
' @param {object} args - command arguments ' @param {object} args - command arguments
Sub UIThread_showSelectorView(args) as Object Sub UIThread_showSelectorView(_args) as Object
m.showSelectorView = true m.showSelectorView = true
setSelectorView(m.currentNode, type(m.currentNode), m.currentPath) setSelectorView(m.currentNode, type(m.currentNode), m.currentPath)
m.logger.debug("Selector View was disabled") m.logger.debug("Selector View was disabled")
@@ -931,7 +931,7 @@ End Sub
' UIThread_hideSelectorView - RALE "hideSelectorView" command handler. Hides Selector (Live) View ' UIThread_hideSelectorView - RALE "hideSelectorView" command handler. Hides Selector (Live) View
' @param {object} args - command arguments ' @param {object} args - command arguments
Sub UIThread_hideSelectorView(args) as Object Sub UIThread_hideSelectorView(_args) as Object
m.showSelectorView = false m.showSelectorView = false
setSelectorView(m.currentNode, type(m.currentNode), m.currentPath) setSelectorView(m.currentNode, type(m.currentNode), m.currentPath)
m.logger.debug("Selector View was enabled") m.logger.debug("Selector View was enabled")
@@ -978,7 +978,7 @@ End Sub
' UIThread_updateNode - RALE "updateNode" command handler. Updates selected node ' UIThread_updateNode - RALE "updateNode" command handler. Updates selected node
' @param {object} args - command arguments ' @param {object} args - command arguments
' @return {object} - response of command. Contains node path and data (id, type, fields, layout etc.) ' @return {object} - response of command. Contains node path and data (id, type, fields, layout etc.)
Sub UIThread_updateNode(args) as Object Sub UIThread_updateNode(_args) as Object
return { return {
path: m.currentPath, path: m.currentPath,
node: getNodeData(m.currentNode, m.currentPath, Invalid) node: getNodeData(m.currentNode, m.currentPath, Invalid)
@@ -1198,7 +1198,7 @@ Sub UIThread_removeField(args) as Object
ownerPath.append(m.currentPath) ownerPath.append(m.currentPath)
ownerPath.pop() ownerPath.pop()
owner = setInParentNode(ownerPath, inOwnerField, node) _owner = setInParentNode(ownerPath, inOwnerField, node)
end if end if
m.logger.debug("Field '" + FW_AsString(field) + "' of selected node was removed") m.logger.debug("Field '" + FW_AsString(field) + "' of selected node was removed")
@@ -1227,7 +1227,7 @@ End Sub
' UIThread_selectFocusedNode - RALE "selectFocusedNode" command handler. Select focused node ' UIThread_selectFocusedNode - RALE "selectFocusedNode" command handler. Select focused node
' @param {object} args - command arguments ' @param {object} args - command arguments
' @return {object} - response of command. Contains node path and data (id, type, fields, layout etc.) ' @return {object} - response of command. Contains node path and data (id, type, fields, layout etc.)
Sub UIThread_selectFocusedNode(args) as Object Sub UIThread_selectFocusedNode(_args) as Object
root = m.top.getScene() root = m.top.getScene()
node = getFocusedNodeObj(root) node = getFocusedNodeObj(root)
if m.currentNode.IsSameNode(node) then if m.currentNode.IsSameNode(node) then
@@ -1333,7 +1333,7 @@ Sub UIThread_removeRulerLine(args) as Object
End Sub End Sub
' UIThread_removeRulerLine - TBD ' UIThread_removeRulerLine - TBD
Sub UIThread_removeAllRulerLines(args) as Object Sub UIThread_removeAllRulerLines(_args) as Object
m.guides.removeAllLines() m.guides.removeAllLines()
return { success: true } return { success: true }
End Sub End Sub
@@ -1343,12 +1343,12 @@ End Sub
'======================= '=======================
' UIThread_getRegistrySections - TBD ' UIThread_getRegistrySections - TBD
Sub UIThread_getRegistrySections(args) as Object Sub UIThread_getRegistrySections(_args) as Object
return getRegistrySections() return getRegistrySections()
End Sub End Sub
' UIThread_addRegistrySection - TBD ' UIThread_addRegistrySection - TBD
Sub UIThread_clearRegistry(args) as Object Sub UIThread_clearRegistry(_args) as Object
return clearRegistry() return clearRegistry()
End Sub End Sub
@@ -1515,7 +1515,7 @@ Sub getFieldList(node) as Object
fieldList = {} fieldList = {}
result = 0 _result = 0
if type(fields) = "roArray" then if type(fields) = "roArray" then
count = fields.count() - 1 count = fields.count() - 1
for i = 0 to count for i = 0 to count
@@ -1636,7 +1636,7 @@ Sub getNodeById(rootNode, id) as Object
return storage.node return storage.node
End Sub End Sub
Sub getNodeByIdCallback(node, index, parentObj, childObj, storage) as Boolean Sub getNodeByIdCallback(node, _index, _parentObj, _childObj, storage) as Boolean
if node.id = storage.id then if node.id = storage.id then
storage.node = node storage.node = node
@@ -1670,7 +1670,7 @@ Sub getNodeByName(rootNode, name) as Object
return storage.node return storage.node
End Sub End Sub
Sub getNodeByNameCallback(node, index, parentObj, childObj, storage) as Boolean Sub getNodeByNameCallback(node, _index, _parentObj, _childObj, storage) as Boolean
if node.subtype() = storage.name then if node.subtype() = storage.name then
storage.node = node storage.node = node
@@ -1916,7 +1916,7 @@ Function clearRegistry() as Object
return { success: true } return { success: true }
End Function End Function
Sub clearRegistryCallback(section, sectionName, storage) as Object Sub clearRegistryCallback(_section, sectionName, _storage) as Object
return removeRegistrySection(sectionName) return removeRegistrySection(sectionName)
End Sub End Sub
+15 -2
View File
@@ -38,19 +38,28 @@ const getEnvVars = require('./get-env-vars');
} }
} }
await fetch(playletServer, { const response = await fetch(playletServer, {
method: 'POST', method: 'POST',
headers: { headers: {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
}, },
body: JSON.stringify(registry), body: JSON.stringify(registry),
}); });
if (!response.ok) {
throw new Error(`Failed to write registry: ${response.status} ${response.statusText}`);
}
} }
else if (output) { else if (output) {
if (fs.existsSync(output)) { if (fs.existsSync(output)) {
throw new Error(`File "${output}" already exists`); throw new Error(`File "${output}" already exists`);
} }
const response = await fetch(playletServer); const response = await fetch(playletServer);
if (!response.ok) {
throw new Error(`Failed to read registry: ${response.status} ${response.statusText}`);
}
const registry = await response.json(); const registry = await response.json();
for (const section in registry) { for (const section in registry) {
@@ -64,9 +73,13 @@ const getEnvVars = require('./get-env-vars');
fs.writeFileSync(output, JSON.stringify(registry, null, 4)); fs.writeFileSync(output, JSON.stringify(registry, null, 4));
} }
else if (clear) { else if (clear) {
await fetch(playletServer, { const response = await fetch(playletServer, {
method: 'DELETE', method: 'DELETE',
}); });
if (!response.ok) {
throw new Error(`Failed to clear registry: ${response.status} ${response.statusText}`);
}
} }
else { else {
console.error('No action specified'); console.error('No action specified');