diff --git a/config/bsconfig.base.json b/config/bsconfig.base.json index f3673df9..2cb54a01 100644 --- a/config/bsconfig.base.json +++ b/config/bsconfig.base.json @@ -20,6 +20,12 @@ "regex": "\\.observeField(scoped)?\\s*\\(\\s*\"\\w+\"\\s*,\\s*\"\\w+\"\\s*\\)", "regexFlags": "ig", "message": "observeField(\"field\", \"callback\") is not allowed. Use observeField(\"field\", FuncName(callback)) instead." + }, + { + "code": "NO_INVALID_CALLFUNC_ARG", + "regex": "@\\.\\w+\\(invalid\\)", + "regexFlags": "ig", + "message": "the arg invalid in @.func(invalid) is not needed. Just use @.func() instead." } ], "files": [ diff --git a/docs/plugins.md b/docs/plugins.md index 7af113f3..bd4da6b4 100644 --- a/docs/plugins.md +++ b/docs/plugins.md @@ -428,7 +428,7 @@ myNode = CreateObject("roSGNode", "MyComponent") ' Add it to the right parent myParentNode.appendChild(myNode) ' Trigger the binding manually -myNode@.BindNode(invalid) +myNode@.BindNode() ``` calling `BindNode` will trigger all the binding steps just for this node. But it is expected that all its dependencies are already in the scene and can be found. @@ -512,9 +512,11 @@ The logger plugin does some code transformation to log calls, which can add call ### How The logger plugin searches for calls to the predefined functions `LogError`, `LogWarn`, `LogInfo` and `LogDebug`. Once found, it does the following (we take `LogError` as an example): + - It replaces calls of `LogError` with `LogErrorX` where X is the number of arguments. - For example, it replaces `LogError("Cannot complete operation:", error)` with `LogError2("Cannot complete operation:", error)` - Based on usage, it generates `LogErrorX` functions used. Example: + ``` function LogError2(arg0, arg1) as void logger = m.global.logger @@ -524,11 +526,12 @@ function LogError2(arg0, arg1) as void m.global.logger.logLine = "[ERROR]" + ToString(arg0) + " " + ToString(arg1) end function ``` + - Finally, it adds the caller file and line number to the args. - `LogError("Cannot complete operation:", error)` is replaced with `LogError(CALLER, "Cannot complete operation:", error)` - `CALLER` would be the full path to the source .bs file and line number, for easier debugging - In release mode, `CALLER` would be only the file name and line number, without the full path. This is so that dev directory does not get "leaked" in releases. - + This is implemented to make it easy to identify where logs came from, and to generate log functions with the right number of parameters based on usage. This way we do not need all combination of functions (`LogError`, `LogWarn`, `LogInfo` and `LogDebug` multiplied by number of parameters, `LogError1`, `LogError2`, `LogError3`, and so on). Since brightscript does not support function templates or function overloading, it is either this method, or use optional parameters (but then we would have to check which parameter was passed, and which was is using the default value.) and end up with a log function with logs of if's else'es. To understand more about what's being generated, download `playlet-lib.zip` from [releases](https://github.com/iBicha/playlet/releases), extract, and inspect the file `source/utils/Logging.brs`. You will see it contains log functions in the form `LogVerbX`, that are generated based on usage. diff --git a/playlet-lib/src/components/AppController/AppController.bs b/playlet-lib/src/components/AppController/AppController.bs index 8f33caec..3ac1d722 100644 --- a/playlet-lib/src/components/AppController/AppController.bs +++ b/playlet-lib/src/components/AppController/AppController.bs @@ -60,7 +60,7 @@ function ShowRootScreen(screenName as string) as void ' insert child at 0 to make sure it is behind the navbar m.root.insertChild(screen, 0) if screen.hasField("binding_done") - screen@.BindNode(invalid) + screen@.BindNode() end if end if screen = m.screens[screenName] diff --git a/playlet-lib/src/components/ChannelView/ChannelUtils.bs b/playlet-lib/src/components/ChannelView/ChannelUtils.bs index c40dac49..2f3e6450 100644 --- a/playlet-lib/src/components/ChannelView/ChannelUtils.bs +++ b/playlet-lib/src/components/ChannelView/ChannelUtils.bs @@ -5,7 +5,7 @@ namespace ChannelUtils appController = m.appController end if appController@.PushScreen(channelView) - channelView@.BindNode(invalid) + channelView@.BindNode() channelView.content = contentNode end function end namespace diff --git a/playlet-lib/src/components/ChannelView/ChannelView.bs b/playlet-lib/src/components/ChannelView/ChannelView.bs index 1a84247f..a537cfad 100644 --- a/playlet-lib/src/components/ChannelView/ChannelView.bs +++ b/playlet-lib/src/components/ChannelView/ChannelView.bs @@ -29,7 +29,7 @@ function Init() end function function OnNodeready() - m.rowList@.BindNode(invalid) + m.rowList@.BindNode() SetNavigation(m.rowList, "up", m.subscribeButton) SetNavigation(m.subscribeButton, "down", m.rowList) @@ -115,7 +115,7 @@ function OnkeyEvent(key as string, press as boolean) as boolean end function function Close() - m.appController@.PopScreen(invalid) + m.appController@.PopScreen() m.top.dispose = true end function diff --git a/playlet-lib/src/components/ContextMenu/ContextMenu.bs b/playlet-lib/src/components/ContextMenu/ContextMenu.bs index cdf8f74b..d5224a34 100644 --- a/playlet-lib/src/components/ContextMenu/ContextMenu.bs +++ b/playlet-lib/src/components/ContextMenu/ContextMenu.bs @@ -167,5 +167,5 @@ function OnkeyEvent(key as string, press as boolean) as boolean end function function Close() - m.top.appController@.PopScreen(invalid) + m.top.appController@.PopScreen() end function diff --git a/playlet-lib/src/components/ContextMenu/ContextMenuUtils.bs b/playlet-lib/src/components/ContextMenu/ContextMenuUtils.bs index aa03afb6..26c7eb33 100644 --- a/playlet-lib/src/components/ContextMenu/ContextMenuUtils.bs +++ b/playlet-lib/src/components/ContextMenu/ContextMenuUtils.bs @@ -19,7 +19,7 @@ namespace ContextMenuUtils ContextMenuUtils.SetItem(contextMenu, item) contextMenu.options = options - contextMenu@.Show(invalid) + contextMenu@.Show() return contextMenu end function diff --git a/playlet-lib/src/components/Dialog/LoginDialog.bs b/playlet-lib/src/components/Dialog/LoginDialog.bs index 88b8c155..68d5f41e 100644 --- a/playlet-lib/src/components/Dialog/LoginDialog.bs +++ b/playlet-lib/src/components/Dialog/LoginDialog.bs @@ -12,7 +12,7 @@ function Init() end function function OnNodeReady() - address = m.webserver@.GetServerAddress(invalid) + address = m.webserver@.GetServerAddress() isValidAddress = not StringUtils.IsNullOrEmpty(address) if isValidAddress m.top.url = `${address}/invidious/login` diff --git a/playlet-lib/src/components/MainScene.bs b/playlet-lib/src/components/MainScene.bs index c262bb72..83141e35 100644 --- a/playlet-lib/src/components/MainScene.bs +++ b/playlet-lib/src/components/MainScene.bs @@ -21,5 +21,5 @@ end function function StartWebServer() m.webServer = m.top.findNode("WebServer") - m.webServer@.StartServer(invalid) + m.webServer@.StartServer() end function diff --git a/playlet-lib/src/components/PlayQueue/PlayQueueView.bs b/playlet-lib/src/components/PlayQueue/PlayQueueView.bs index 80ebf239..4a34b698 100644 --- a/playlet-lib/src/components/PlayQueue/PlayQueueView.bs +++ b/playlet-lib/src/components/PlayQueue/PlayQueueView.bs @@ -61,11 +61,11 @@ function OnkeyEvent(key as string, press as boolean) as boolean end function function Close() - m.top.appController@.PopScreen(invalid) + m.top.appController@.PopScreen() end function function OnClearButtonSelected() - m.top.playQueue@.Clear(invalid) + m.top.playQueue@.Clear() end function function OnItemSelected() as void diff --git a/playlet-lib/src/components/PlayQueue/PlayQueueViewUtils.bs b/playlet-lib/src/components/PlayQueue/PlayQueueViewUtils.bs index 84916817..5e8bbc88 100644 --- a/playlet-lib/src/components/PlayQueue/PlayQueueViewUtils.bs +++ b/playlet-lib/src/components/PlayQueue/PlayQueueViewUtils.bs @@ -16,7 +16,7 @@ namespace PlayQueueViewUtils playQueueView.jumpToItem = index end if - playQueueView@.Show(invalid) + playQueueView@.Show() return playQueueView end function diff --git a/playlet-lib/src/components/PlaylistView/PlaylistUtils.bs b/playlet-lib/src/components/PlaylistView/PlaylistUtils.bs index a3b31e11..85b563a3 100644 --- a/playlet-lib/src/components/PlaylistView/PlaylistUtils.bs +++ b/playlet-lib/src/components/PlaylistView/PlaylistUtils.bs @@ -5,7 +5,7 @@ namespace PlaylistUtils appController = m.appController end if appController@.PushScreen(playlistView) - playlistView@.BindNode(invalid) + playlistView@.BindNode() playlistView.content = contentNode end function end namespace diff --git a/playlet-lib/src/components/PlaylistView/PlaylistView.bs b/playlet-lib/src/components/PlaylistView/PlaylistView.bs index 0d2452aa..0ddb51e5 100644 --- a/playlet-lib/src/components/PlaylistView/PlaylistView.bs +++ b/playlet-lib/src/components/PlaylistView/PlaylistView.bs @@ -94,7 +94,7 @@ function Close() m.playlistLoadTask = invalid end if - m.appController@.PopScreen(invalid) + m.appController@.PopScreen() end function function OnItemFocused() diff --git a/playlet-lib/src/components/Screens/AppInfoScreen/AppInfoScreen.bs b/playlet-lib/src/components/Screens/AppInfoScreen/AppInfoScreen.bs index ad37aa0d..5c81aa02 100644 --- a/playlet-lib/src/components/Screens/AppInfoScreen/AppInfoScreen.bs +++ b/playlet-lib/src/components/Screens/AppInfoScreen/AppInfoScreen.bs @@ -32,7 +32,7 @@ function Init() end function function OnNodeReady() - m.appInfo = m.applicationInfo@.GetAppInfo(invalid) + m.appInfo = m.applicationInfo@.GetAppInfo() UpdateKeyValueList() diff --git a/playlet-lib/src/components/Screens/BookmarksScreen/BookmarksScreen.bs b/playlet-lib/src/components/Screens/BookmarksScreen/BookmarksScreen.bs index 0bfa40e0..a24e7abd 100644 --- a/playlet-lib/src/components/Screens/BookmarksScreen/BookmarksScreen.bs +++ b/playlet-lib/src/components/Screens/BookmarksScreen/BookmarksScreen.bs @@ -17,7 +17,7 @@ function OnNodeReady() SetNavigation(invalid, "back", m.navBar) SetNavigation(invalid, "left", m.navBar) - m.rowList@.BindNode(invalid) + m.rowList@.BindNode() OnBookmarksChange() m.bookmarks.ObserveField("contentChange", FuncName(OnBookmarksChange)) diff --git a/playlet-lib/src/components/Screens/HomeScreen/HomeScreen.bs b/playlet-lib/src/components/Screens/HomeScreen/HomeScreen.bs index 8eb37d5b..7016fc03 100644 --- a/playlet-lib/src/components/Screens/HomeScreen/HomeScreen.bs +++ b/playlet-lib/src/components/Screens/HomeScreen/HomeScreen.bs @@ -13,7 +13,7 @@ function OnNodeReady() SetNavigation(invalid, "back", m.navBar) SetNavigation(invalid, "left", m.navBar) - m.rowList@.BindNode(invalid) + m.rowList@.BindNode() m.rowList.feeds = ParseJson(ReadAsciiFile(m.top.feedFile)) end function diff --git a/playlet-lib/src/components/Screens/SearchScreen/SearchFilters/SearchFilters.bs b/playlet-lib/src/components/Screens/SearchScreen/SearchFilters/SearchFilters.bs index 9487b457..378eba19 100644 --- a/playlet-lib/src/components/Screens/SearchScreen/SearchFilters/SearchFilters.bs +++ b/playlet-lib/src/components/Screens/SearchScreen/SearchFilters/SearchFilters.bs @@ -266,5 +266,5 @@ function OnkeyEvent(key as string, press as boolean) as boolean end function function Close() - m.appController@.PopScreen(invalid) + m.appController@.PopScreen() end function diff --git a/playlet-lib/src/components/Screens/SearchScreen/SearchScreen.bs b/playlet-lib/src/components/Screens/SearchScreen/SearchScreen.bs index 7fb7fe57..a759d397 100644 --- a/playlet-lib/src/components/Screens/SearchScreen/SearchScreen.bs +++ b/playlet-lib/src/components/Screens/SearchScreen/SearchScreen.bs @@ -36,7 +36,7 @@ function Init() end function function OnNodeReady() - m.rowlist@.BindNode(invalid) + m.rowlist@.BindNode() m.keyboard.ObserveField("text", FuncName(OnTextChange)) m.suggestions.ObserveField("buttonFocused", FuncName(OnSearchButtonFocused)) m.suggestions.ObserveField("buttonSelected", FuncName(OnSearchButtonSelected)) @@ -151,7 +151,7 @@ function OnFiltersButtonSelected() searchFilters = CreateObject("roSGNode", "SearchFilters") m.appController@.PushScreen(searchFilters) searchFilters.searchScreen = m.top - searchFilters@.BindNode(invalid) + searchFilters@.BindNode() end function function OnSearchButtonSelected() diff --git a/playlet-lib/src/components/Screens/SettingsScreen/InvidiousInstance/InvidiousInstanceControl.bs b/playlet-lib/src/components/Screens/SettingsScreen/InvidiousInstance/InvidiousInstanceControl.bs index 9a992ca1..1e9f002a 100644 --- a/playlet-lib/src/components/Screens/SettingsScreen/InvidiousInstance/InvidiousInstanceControl.bs +++ b/playlet-lib/src/components/Screens/SettingsScreen/InvidiousInstance/InvidiousInstanceControl.bs @@ -54,7 +54,7 @@ end function function OpenInvidiousInstanceSettings() settings = CreateObject("roSGNode", "InvidiousInstanceSettings") m.appController@.PushScreen(settings) - settings@.BindNode(invalid) + settings@.BindNode() settings.text = m.top.value settings.observeField("save", FuncName(OnSaveInvidiousInstance)) end function diff --git a/playlet-lib/src/components/Screens/SettingsScreen/InvidiousInstance/InvidiousInstanceSettings.bs b/playlet-lib/src/components/Screens/SettingsScreen/InvidiousInstance/InvidiousInstanceSettings.bs index d3de3e4f..340bf329 100644 --- a/playlet-lib/src/components/Screens/SettingsScreen/InvidiousInstance/InvidiousInstanceSettings.bs +++ b/playlet-lib/src/components/Screens/SettingsScreen/InvidiousInstance/InvidiousInstanceSettings.bs @@ -70,7 +70,7 @@ end function function OnTestButtonSelected() testing = CreateObject("roSGNode", "InvidiousInstanceTesting") m.appController@.PushScreen(testing) - testing@.BindNode(invalid) + testing@.BindNode() testing.instance = m.top.text testing.run = true end function @@ -103,5 +103,5 @@ function OnSaveButtonSelected() end function function Close() - m.appController@.PopScreen(invalid) + m.appController@.PopScreen() end function diff --git a/playlet-lib/src/components/Screens/SettingsScreen/InvidiousInstance/InvidiousInstanceTesting/InvidiousInstanceTesting.bs b/playlet-lib/src/components/Screens/SettingsScreen/InvidiousInstance/InvidiousInstanceTesting/InvidiousInstanceTesting.bs index 98f28a96..689a598c 100644 --- a/playlet-lib/src/components/Screens/SettingsScreen/InvidiousInstance/InvidiousInstanceTesting/InvidiousInstanceTesting.bs +++ b/playlet-lib/src/components/Screens/SettingsScreen/InvidiousInstance/InvidiousInstanceTesting/InvidiousInstanceTesting.bs @@ -47,7 +47,7 @@ function Close() m.testingTask.cancel = true end if - m.appController@.PopScreen(invalid) + m.appController@.PopScreen() end function function RunTestsTask() diff --git a/playlet-lib/src/components/Screens/SettingsScreen/SettingsScreen.bs b/playlet-lib/src/components/Screens/SettingsScreen/SettingsScreen.bs index 73c2280a..d78a4ae4 100644 --- a/playlet-lib/src/components/Screens/SettingsScreen/SettingsScreen.bs +++ b/playlet-lib/src/components/Screens/SettingsScreen/SettingsScreen.bs @@ -137,7 +137,7 @@ function CreateControl(item as object, container as object, startX as integer, s control.id = `preference.${item.key}` control.translation = [startX, startY] if control.hasField("binding_done") - control@.BindNode(invalid) + control@.BindNode() end if control@.BindPreference(m.preferences, item.key) diff --git a/playlet-lib/src/components/Screens/WebAppScreen/WebAppScreen.bs b/playlet-lib/src/components/Screens/WebAppScreen/WebAppScreen.bs index 2579b75b..f846a7e3 100644 --- a/playlet-lib/src/components/Screens/WebAppScreen/WebAppScreen.bs +++ b/playlet-lib/src/components/Screens/WebAppScreen/WebAppScreen.bs @@ -6,7 +6,7 @@ function Init() end function function OnNodeReady() - address = m.webserver@.GetServerAddress(invalid) + address = m.webserver@.GetServerAddress() isValidAddress = not StringUtils.IsNullOrEmpty(address) if isValidAddress m.top.url = address diff --git a/playlet-lib/src/components/Services/Invidious/InvidiousService.bs b/playlet-lib/src/components/Services/Invidious/InvidiousService.bs index c8a546a6..0055cf35 100644 --- a/playlet-lib/src/components/Services/Invidious/InvidiousService.bs +++ b/playlet-lib/src/components/Services/Invidious/InvidiousService.bs @@ -56,7 +56,7 @@ namespace Invidious function DefaultQueryParams() as object return { - region: m.node.applicationInfo@.GetUserCountryCode(invalid) + region: m.node.applicationInfo@.GetUserCountryCode() } end function @@ -228,7 +228,7 @@ namespace Invidious if queryParam.default <> invalid if IsString(queryParam.type) and queryParam.type = "#ISO3166" if queryParam.default = "GetUserCountryCode" - request.QueryParam(queryParamKey, m.node.applicationInfo@.GetUserCountryCode(invalid)) + request.QueryParam(queryParamKey, m.node.applicationInfo@.GetUserCountryCode()) else request.QueryParam(queryParamKey, queryParam.default) end if diff --git a/playlet-lib/src/components/VideoFeed/VideoRowList.bs b/playlet-lib/src/components/VideoFeed/VideoRowList.bs index b5af0fa3..dd4e25e8 100644 --- a/playlet-lib/src/components/VideoFeed/VideoRowList.bs +++ b/playlet-lib/src/components/VideoFeed/VideoRowList.bs @@ -111,7 +111,7 @@ function OnRowItemSelected(index as object) as void else if rowItem.type = "action" if rowItem.action = "LoginDialog" dialog = CreateObject("roSGNode", "LoginDialog") - dialog@.BindNode(invalid) + dialog@.BindNode() m.top.getScene().dialog = dialog end if end if diff --git a/playlet-lib/src/components/VideoPlayer/VideoPlayer.bs b/playlet-lib/src/components/VideoPlayer/VideoPlayer.bs index 5281bf9d..2c722619 100644 --- a/playlet-lib/src/components/VideoPlayer/VideoPlayer.bs +++ b/playlet-lib/src/components/VideoPlayer/VideoPlayer.bs @@ -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 diff --git a/playlet-lib/src/components/VideoPlayer/VideoUtils.bs b/playlet-lib/src/components/VideoPlayer/VideoUtils.bs index 60351498..656d56ae 100644 --- a/playlet-lib/src/components/VideoPlayer/VideoUtils.bs +++ b/playlet-lib/src/components/VideoPlayer/VideoUtils.bs @@ -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 diff --git a/playlet-lib/src/components/Web/PlayletWebServer/Middleware/InvidiousRouter.bs b/playlet-lib/src/components/Web/PlayletWebServer/Middleware/InvidiousRouter.bs index 3f934d7f..a2b176b1 100644 --- a/playlet-lib/src/components/Web/PlayletWebServer/Middleware/InvidiousRouter.bs +++ b/playlet-lib/src/components/Web/PlayletWebServer/Middleware/InvidiousRouter.bs @@ -12,7 +12,7 @@ namespace Http response = context.response invidiousNode = context.server.task.invidious - authLink = invidiousNode@.GetAuthorizeTokenLink(invalid) + authLink = invidiousNode@.GetAuthorizeTokenLink() response.Redirect(authLink) return true end function) diff --git a/playlet-lib/src/components/Web/PlayletWebServer/Middleware/PlayQueueRouter.bs b/playlet-lib/src/components/Web/PlayletWebServer/Middleware/PlayQueueRouter.bs index de6ca00a..b7ed50e7 100644 --- a/playlet-lib/src/components/Web/PlayletWebServer/Middleware/PlayQueueRouter.bs +++ b/playlet-lib/src/components/Web/PlayletWebServer/Middleware/PlayQueueRouter.bs @@ -14,7 +14,7 @@ namespace Http task = context.server.task playQueue = task.playQueue - queue = playQueue@.GetQueue(invalid) + queue = playQueue@.GetQueue() response.Json(queue) return true end function) @@ -42,7 +42,7 @@ namespace Http contentNode = InvidiousContent.ToRowCellContentNode(payload, invalid) playQueue@.AddToQueue(contentNode) - queue = playQueue@.GetQueue(invalid) + queue = playQueue@.GetQueue() response.Json(queue) return true end function) @@ -95,7 +95,7 @@ namespace Http return true end if - playQueue@.Clear(invalid) + playQueue@.Clear() response.Default(204, "OK") return true end function) diff --git a/playlet-lib/src/components/Web/PlayletWebServer/Middleware/PreferencesRouter.bs b/playlet-lib/src/components/Web/PlayletWebServer/Middleware/PreferencesRouter.bs index 23ed1d0a..db33f003 100644 --- a/playlet-lib/src/components/Web/PlayletWebServer/Middleware/PreferencesRouter.bs +++ b/playlet-lib/src/components/Web/PlayletWebServer/Middleware/PreferencesRouter.bs @@ -16,7 +16,7 @@ namespace Http return true end if - userPrefs = preferences@.GetUserPreferences(invalid) + userPrefs = preferences@.GetUserPreferences() response.Json(userPrefs) return true end function) @@ -55,7 +55,7 @@ namespace Http return true end if - preferences@.ClearUserPreferences(invalid) + preferences@.ClearUserPreferences() response.Default(204, "OK") return true end function) diff --git a/playlet-lib/src/components/Web/PlayletWebServer/Middleware/StateApiRouter.bs b/playlet-lib/src/components/Web/PlayletWebServer/Middleware/StateApiRouter.bs index 2b6f0296..6fc9bc0b 100644 --- a/playlet-lib/src/components/Web/PlayletWebServer/Middleware/StateApiRouter.bs +++ b/playlet-lib/src/components/Web/PlayletWebServer/Middleware/StateApiRouter.bs @@ -27,7 +27,7 @@ namespace Http state = {} if ArrayUtils.IndexOfString(keys, "app") <> -1 - appInfo = applicationInfoNode@.GetAppInfo(invalid) + appInfo = applicationInfoNode@.GetAppInfo() if appInfo.lib_version_latest = "N/A" ' If the lib_version_latest field is not available, we can give it a few seconds @@ -44,15 +44,15 @@ namespace Http end if if ArrayUtils.IndexOfString(keys, "device") <> -1 - state["device"] = applicationInfoNode@.GetDeviceInfo(invalid) + state["device"] = applicationInfoNode@.GetDeviceInfo() end if if ArrayUtils.IndexOfString(keys, "invidious") <> -1 authToken = invidiousNode.authToken state["invidious"] = { - current_instance: invidiousNode@.GetCurrentInstance(invalid), + current_instance: invidiousNode@.GetCurrentInstance(), ' backup_instances: InvidiousSettings.GetBackupInstances(), - auth_url: invidiousNode@.GetAuthorizeTokenLink(invalid), + auth_url: invidiousNode@.GetAuthorizeTokenLink(), logged_in: authToken <> invalid, logged_in_instance: authToken <> invalid ? authToken.instance : invalid, logged_in_username: authToken <> invalid ? authToken.username : invalid @@ -60,7 +60,7 @@ namespace Http end if if ArrayUtils.IndexOfString(keys, "preferences") <> -1 - state["preferences"] = preferencesNode@.GetUserPreferences(invalid) + state["preferences"] = preferencesNode@.GetUserPreferences() end if response.Json(state) diff --git a/playlet-lib/src/components/parts/AutoBind/AutoBind.part.bs b/playlet-lib/src/components/parts/AutoBind/AutoBind.part.bs index c1b9fc5d..2516fe67 100644 --- a/playlet-lib/src/components/parts/AutoBind/AutoBind.part.bs +++ b/playlet-lib/src/components/parts/AutoBind/AutoBind.part.bs @@ -10,11 +10,11 @@ function AutoBindSceneGraph() as void m.global.AutoBindNodes = [] for each node in nodes - node@.BindNodeFieldsAndProps(invalid) + node@.BindNodeFieldsAndProps() end for for each node in nodes - node@.BindScopeFields(invalid) + node@.BindScopeFields() end for for each node in nodes diff --git a/playlet-lib/src/source/services/ApplicationInfo.bs b/playlet-lib/src/source/services/ApplicationInfo.bs index 3a49a07c..36d9577d 100644 --- a/playlet-lib/src/source/services/ApplicationInfo.bs +++ b/playlet-lib/src/source/services/ApplicationInfo.bs @@ -54,7 +54,7 @@ class ApplicationInfo if not StringUtils.IsNullOrEmpty(m.node.lib_version_latest) m.appInfo["lib_version_latest"] = m.node.lib_version_latest else - m.node@.GetLatestPlayletLibVersion(invalid) + m.node@.GetLatestPlayletLibVersion() end if end if