Compare commits

..
65 Commits
Author SHA1 Message Date
Brahim Hadriche 5b452d527e Release v0.22.3 (#355) 2024-03-31 21:50:23 -04:00
Brahim Hadriche 900881e649 remove annoucement - bug is fixed 2024-03-31 21:40:03 -04:00
Brahim Hadriche 2a2cdd8652 Release v0.22.2 (#354) 2024-03-31 14:12:06 -04:00
Brahim Hadriche 15d06c0432 Push transpiled files 2024-03-31 14:09:08 -04:00
Brahim Hadriche ad99fbbf03 Update announcement 2024-03-31 14:08:25 -04:00
Brahim Hadriche d6005115a2 Release v0.22.1 (#353) 2024-03-30 19:43:31 -04:00
Brahim Hadriche c36745c6aa Transpiled files 2024-03-30 19:37:34 -04:00
Brahim Hadriche 595bd87970 Add outage announcement 2024-03-30 19:34:42 -04:00
fcf0334667 [chore] update dependencies (#352)
* update dependencies

* Update lint exceptions for colors

---------

Co-authored-by: iBicha <iBicha@users.noreply.github.com>
Co-authored-by: Brahim Hadriche <brahim.hadriche@gmail.com>
2024-03-29 22:13:56 -04:00
Brahim Hadriche a0b6175858 lounge log command index 2024-03-29 19:50:03 -04:00
Brahim Hadriche 99be2071d1 Simplify timed dialog 2024-03-29 12:48:03 -04:00
Brahim Hadriche 305ddaa737 Add some timestamps to logs 2024-03-29 11:30:54 -04:00
Brahim Hadriche 20816d09f7 Fix/lounge lost session (#351)
* Maybe a fix

* Update CHANGELOG.md

* status reset
2024-03-28 18:38:14 -04:00
Brahim Hadriche 839f49888f todo 2024-03-28 17:28:54 -04:00
Brahim Hadriche b67587df2b TimedDialog bug fix 2024-03-28 17:06:25 -04:00
Brahim Hadriche e5062c34d7 No history sync in tools 2024-03-27 12:39:33 -04:00
Brahim Hadriche 29f5373492 remove duplicate translation 2024-03-25 22:18:36 -04:00
Weblate (bot)andBrahim Hadriche f17e93936c Translated using Weblate (French (Canada)) (#344)
Currently translated at 100.0% (310 of 310 strings)

Translation: Playlet/Playlet
Translate-URL: https://hosted.weblate.org/projects/playlet/playlet/fr_CA/

Co-authored-by: Brahim Hadriche <brahim.hadriche@gmail.com>
2024-03-25 22:15:11 -04:00
Brahim Hadriche c69ab716f5 small refactor modals 2024-03-25 17:29:35 -04:00
Brahim Hadriche bd389473e5 Adjust spacing in settings 2024-03-25 16:45:44 -04:00
Brahim Hadriche cfa7662f2e Update CHANGELOG.md 2024-03-24 23:26:05 -04:00
Brahim Hadriche 609c4622fd Bookmarks to feed refactor 2024-03-24 23:23:23 -04:00
Brahim Hadriche 45262c6394 tweak to registry tool 2024-03-24 21:51:32 -04:00
Brahim Hadriche 7ce3b2636c Release v0.22.0 (#341) 2024-03-24 21:32:22 -04:00
Brahim Hadriche a75ce42373 Adjust queue clear button 2024-03-24 21:12:02 -04:00
Brahim Hadriche fd8b61ad44 Add support for channel releases (#340) 2024-03-24 15:30:43 -04:00
Brahim Hadriche 3391e3d787 Fix search sort filters (#338) 2024-03-24 14:37:40 -04:00
Brahim Hadriche 862fea74e7 Update screenshots 2024-03-24 12:38:23 -04:00
Brahim Hadriche de4f64d38f Small tweak 2024-03-24 12:34:09 -04:00
Brahim Hadriche aab99b2a2e Small fix for lounge api 2024-03-23 23:38:11 -04:00
Brahim Hadriche 51eb7bdfa2 Translation files 2024-03-23 18:34:13 -04:00
Brahim Hadriche 3d52d00bde Update README.md 2024-03-23 18:29:01 -04:00
Brahim Hadriche bd26e727c1 Playlet is now available in English and French 2024-03-23 18:02:57 -04:00
Brahim Hadriche 3b622f65f3 Localize loading messages 2024-03-23 17:14:55 -04:00
Brahim Hadriche 615439650e Locale for context menu (#337) 2024-03-23 14:30:32 -04:00
Brahim Hadriche 25330a6494 More translation work 2024-03-23 00:19:15 -04:00
github-actions[bot]andiBicha 37e429f648 update dependencies (#336)
Co-authored-by: iBicha <iBicha@users.noreply.github.com>
2024-03-22 21:50:19 -04:00
Brahim Hadriche 6e6ea94544 Bug fix 2024-03-22 21:49:16 -04:00
Brahim Hadricheandgithub-action linter 42dadec020 locale for web app (#334)
* locale for web app

* more translations

* Rename profiles service to avoid locale conflict

* More translation work

* Lint fix

---------

Co-authored-by: github-action linter <githubaction@githubaction.com>
2024-03-22 17:43:03 -04:00
Brahim Hadriche 019fde1e67 localize sort options 2024-03-21 21:02:26 -04:00
Brahim Hadriche fb0b1b8894 queue locale 2024-03-20 17:42:46 -04:00
Brahim Hadriche 66df27cf0b locale of publish date fix 2024-03-20 13:19:36 -04:00
Brahim Hadriche feb968a72e Notifications locale 2024-03-20 00:36:38 -04:00
Brahim Hadriche 9061275d6f Missed one 2024-03-19 23:28:32 -04:00
Brahim Hadriche 059167ac56 Changelog 2024-03-19 23:17:39 -04:00
Brahim Hadriche 7330b321a5 Localization part 3 (#333)
* TODO

* TODO

* Add some translations

* Remote screen and settings

* Video player and http client
2024-03-19 23:16:39 -04:00
Brahim Hadriche 9a7db6aab2 Localization part 2 (#332)
* More localization work

* instance testing translation

* Row cell translations

* safety check
2024-03-18 22:53:08 -04:00
Brahim Hadriche 48993dd9f5 Split locale enum, add duplicate values validation 2024-03-18 09:21:42 -04:00
Brahim Hadriche 7d9817994c Localization test (#331)
* Localization test

* More translations

* More translations

* Setup the tooling and validation for the localization

* More translations

* Docs
2024-03-17 22:22:53 -04:00
Brahim Hadriche 403ed94e97 Remove invalid properties 2024-03-17 00:13:00 -04:00
Brahim Hadriche 67252cd5d5 Add network throttling for debugging 2024-03-16 13:49:33 -04:00
Brahim Hadriche e4efc6832f Broadcast safe colors (#330)
* Broadcast safe colors

* changelog
2024-03-16 13:17:17 -04:00
github-actions[bot]andiBicha 13138740fb update dependencies (#329)
Co-authored-by: iBicha <iBicha@users.noreply.github.com>
2024-03-15 21:53:03 -04:00
Brahim Hadriche b37b89bffc Adjust icons 2024-03-13 17:19:28 -04:00
Brahim Hadriche 888f7da214 Buttons, mostly 2024-03-13 13:34:59 -04:00
Brahim Hadricheandgithub-action linter 750e24f724 ButtonEx (#319)
* Finish buttons

* optional animation

* Lint fix

* Remove test stuff

* Lint fix

* Use button

---------

Co-authored-by: github-action linter <githubaction@githubaction.com>
2024-03-12 18:00:07 -04:00
Brahim Hadriche bfd4f3e298 Sort channel videos and playlists (#328)
* Sort channel videos and playlists

* changelog
2024-03-12 16:59:50 -04:00
Brahim Hadriche 7b7801d7a5 Sort channel videos and playlists (#327) 2024-03-12 16:42:03 -04:00
Brahim Hadriche ffb84d1c89 [chore] deps and versions (java version) 2024-03-11 15:48:37 -04:00
Brahim Hadriche d29e51c7f2 [chore] deps and versions 2024-03-11 15:48:03 -04:00
Brahim Hadriche b72a6d4614 Use bold letters for the device display name 2024-03-10 12:19:59 -04:00
Brahim Hadriche 289b845876 Add cancellation support to instance testing 2024-03-10 11:48:11 -04:00
Brahim Hadriche 910d57795a Release v0.21.2 (#324) 2024-03-10 11:14:57 -04:00
Brahim Hadriche ef733d8d88 Fix deep linking 2024-03-10 11:06:16 -04:00
Brahim Hadriche 6ad42f3fcd update metadata 2024-03-09 23:11:28 -05:00
229 changed files with 6063 additions and 1422 deletions

No files matched your search

+3 -3
View File
@@ -24,10 +24,10 @@ jobs:
git config --local user.email "githubaction@githubaction.com" git config --local user.email "githubaction@githubaction.com"
git config --local user.name "github-action linter" git config --local user.name "github-action linter"
- name: Use Node.js 18.x - name: Use Node.js 20.x
uses: actions/setup-node@v3 uses: actions/setup-node@v4
with: with:
node-version: 18.x node-version: 20.x
cache: "npm" cache: "npm"
- name: Install dependencies - name: Install dependencies
+6 -6
View File
@@ -17,10 +17,10 @@ jobs:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Use Node.js 18.x - name: Use Node.js 20.x
uses: actions/setup-node@v3 uses: actions/setup-node@v4
with: with:
node-version: 18.x node-version: 20.x
cache: "npm" cache: "npm"
- name: Install dependencies - name: Install dependencies
@@ -32,11 +32,11 @@ jobs:
- name: Build Playlet - name: Build Playlet
run: npm run build:release:ci run: npm run build:release:ci
- name: Use Java 17 - name: Use Java 21
uses: actions/setup-java@v3 uses: actions/setup-java@v4
with: with:
distribution: "temurin" distribution: "temurin"
java-version: "17" java-version: "21"
- name: Download the Static Channel Analysis CLI - name: Download the Static Channel Analysis CLI
run: | run: |
+3 -3
View File
@@ -24,10 +24,10 @@ jobs:
git config --local user.name "github-action wiki updater" git config --local user.name "github-action wiki updater"
working-directory: ./playlet.wiki working-directory: ./playlet.wiki
- name: Use Node.js 18.x - name: Use Node.js 20.x
uses: actions/setup-node@v3 uses: actions/setup-node@v4
with: with:
node-version: 18.x node-version: 20.x
cache: "npm" cache: "npm"
- name: Install dependencies - name: Install dependencies
+3 -3
View File
@@ -12,10 +12,10 @@ jobs:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Use Node.js 18.x - name: Use Node.js 20.x
uses: actions/setup-node@v3 uses: actions/setup-node@v4
with: with:
node-version: 18.x node-version: 20.x
cache: "npm" cache: "npm"
- name: Install dependencies - name: Install dependencies
+3
View File
@@ -1,4 +1,7 @@
{ {
"files.associations": {
"**/locale/**/*.ts": "xml"
},
"brightscript.output.clearConsoleOnChannelStart": false, "brightscript.output.clearConsoleOnChannelStart": false,
"brightscript.bsdk": "node_modules/brighterscript", "brightscript.bsdk": "node_modules/brighterscript",
"editor.formatOnSave": true, "editor.formatOnSave": true,
+49 -2
View File
@@ -5,6 +5,53 @@ 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.1.0/), The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.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.22.3] - 2024-03-31
### Changed
- Removed announcement
## [0.22.2] - 2024-03-31
### Changed
- Updated announcement
## [0.22.1] - 2024-03-30
### Added
- Announcement dialog to indicate outage
### Fixed
- [Attempt] A bug where the lounge would randomly lose the session id, making it unable to cast, and spam the same error over and over
- Dialog with timer now stops as expected if any button is pressed
## [0.22.0] - 2024-03-24
### Added
- Context menu sort options for channel videos and playlists
- Localization support and French translations
- Channel releases
### Changed
- Colors to be more broadcast safe
### Fixed
- A bug where instance testing is not immediately cancelled when the testing page is closed
- A bug in the web app where "upcoming" videos show up as "live"
- Search sort filters
## [0.21.2] - 2024-03-10
### Fixed
- Deeplinking required for certification
## [0.21.1] - 2024-03-09 ## [0.21.1] - 2024-03-09
### Added ### Added
@@ -33,7 +80,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added ### Added
- Small improvement in the context menu of the Playlist view - Small improvement in the context menu of the Playlist view
- Videos can be paused and resumed using the `Ok` remote button - Videos can be paused and resumed using the `OK` remote button
### Fixed ### Fixed
@@ -135,7 +182,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- If you like to add these two feeds to your bookmarks: - If you like to add these two feeds to your bookmarks:
- Search for `Funny` (or `News`) - Search for `Funny` (or `News`)
- Set the `Sort by` filter to `Upload date` - Set the `Sort by` filter to `Upload date`
- Press and hold the `Ok` button while a video from the search result is selected - Press and hold the `OK` button while a video from the search result is selected
- Choose the `Add to "Search - Funny"` option - Choose the `Add to "Search - Funny"` option
## [0.18.0] - 2023-12-28 ## [0.18.0] - 2023-12-28
+3
View File
@@ -9,6 +9,9 @@
<img alt="Current Release" src="https://img.shields.io/github/release/iBicha/playlet.svg"/> <img alt="Current Release" src="https://img.shields.io/github/release/iBicha/playlet.svg"/>
<img alt="Total Downloads" src="https://img.shields.io/github/downloads/iBicha/playlet/latest/playlet-lib.zip.svg"/> <img alt="Total Downloads" src="https://img.shields.io/github/downloads/iBicha/playlet/latest/playlet-lib.zip.svg"/>
</a> </a>
<a href="https://hosted.weblate.org/engage/playlet/">
<img src="https://hosted.weblate.org/widget/playlet/svg-badge.svg" alt="Translation status" />
</a>
<a href="/LICENSE"> <a href="/LICENSE">
<img alt="AGPL-3.0 license" src="https://img.shields.io/github/license/iBicha/playlet.svg"/> <img alt="AGPL-3.0 license" src="https://img.shields.io/github/license/iBicha/playlet.svg"/>
</a> </a>
+9 -1
View File
@@ -46,6 +46,12 @@
"regex": "\\?[\\.|\\[|\\(|@]", "regex": "\\?[\\.|\\[|\\(|@]",
"regexFlags": "ig", "regexFlags": "ig",
"message": "No optional chaning (var1?.property). Do a type check instead." "message": "No optional chaning (var1?.property). Do a type check instead."
},
{
"code": "NO_TRANSLATE_STRING_LITERAL",
"regex": "\\bTr\\s*\\(\\s*\"[^\\\"]*\"\\s*\\)",
"regexFlags": "ig",
"message": "Tr(\"String\") is not allowed. Use Tr(Locale.Key) instead."
} }
], ],
"files": [ "files": [
@@ -56,6 +62,7 @@
"!**/*.psd", "!**/*.psd",
"!**/*.svg", "!**/*.svg",
"!**/*.svg.meta.json5", "!**/*.svg.meta.json5",
"locale/**",
"config/**", "config/**",
"lib/**", "lib/**",
"www/**", "www/**",
@@ -79,7 +86,8 @@
"../tools/bs-plugins/logger-plugin.ts", "../tools/bs-plugins/logger-plugin.ts",
"../tools/bs-plugins/image-gen-plugin.ts", "../tools/bs-plugins/image-gen-plugin.ts",
"../tools/bs-plugins/type-gen-plugin.ts", "../tools/bs-plugins/type-gen-plugin.ts",
"../tools/bs-plugins/web-server-plugin.ts" "../tools/bs-plugins/web-server-plugin.ts",
"../tools/bs-plugins/locale-validation-plugin.ts"
], ],
"retainStagingDir": true, "retainStagingDir": true,
"require": [ "require": [
+3 -1
View File
@@ -8,6 +8,7 @@
"!**/*.psd", "!**/*.psd",
"!**/*.svg", "!**/*.svg",
"!**/*.svg.meta.json5", "!**/*.svg.meta.json5",
"locale/**",
"config/**", "config/**",
"lib/**", "lib/**",
"www/**", "www/**",
@@ -29,7 +30,8 @@
"../tools/bs-plugins/logger-plugin.ts", "../tools/bs-plugins/logger-plugin.ts",
"../tools/bs-plugins/image-gen-plugin.ts", "../tools/bs-plugins/image-gen-plugin.ts",
"../tools/bs-plugins/type-gen-plugin.ts", "../tools/bs-plugins/type-gen-plugin.ts",
"../tools/bs-plugins/web-server-plugin.ts" "../tools/bs-plugins/web-server-plugin.ts",
"../tools/bs-plugins/locale-validation-plugin.ts"
], ],
"rooibos": { "rooibos": {
"logLevel": 2, "logLevel": 2,
+3 -1
View File
@@ -2,7 +2,7 @@ openapi: 3.0.0
info: info:
title: Playlet Web API title: Playlet Web API
version: 0.21.1 version: 0.22.3
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
@@ -572,6 +572,8 @@ components:
type: string type: string
friendly_name: friendly_name:
type: string type: string
current_locale:
type: string
invidious: invidious:
type: object type: object
properties: properties:
+21
View File
@@ -12,6 +12,7 @@
- [Logger](#logger) - [Logger](#logger)
- [Type Gen](#type-gen) - [Type Gen](#type-gen)
- [Web Server](#web-server) - [Web Server](#web-server)
- [Locale validation](#locale-validation)
Playlet implements a few [Brighterscript Plugins](https://github.com/rokucommunity/brighterscript/blob/master/docs/plugins.md). The plugins inject themselves in the compilation process, allowing the modification of bs scripts, xml components, and even assets or the app manifest. Let's start with a simple one: Playlet implements a few [Brighterscript Plugins](https://github.com/rokucommunity/brighterscript/blob/master/docs/plugins.md). The plugins inject themselves in the compilation process, allowing the modification of bs scripts, xml components, and even assets or the app manifest. Let's start with a simple one:
@@ -602,3 +603,23 @@ There one special annotation, and one special route:
- `*` matches all paths - `*` matches all paths
So `@all(*)` would be a middleware that will be matched with any request. So `@all(*)` would be a middleware that will be matched with any request.
## Locale validation
**[Source](/tools/bs-plugins/locale-validation-plugin.ts)**
### Why
Roku's built-in localization system has some undesired side effects: for example, it might translate node ids, which would break the relationship between the nodes.
This plugin enforces some rules to ensure translation files are kept up to date with code implementation.
See the next section for the validation rules.
### How
The plugin checks for the following:
- Translated words and sentenses are defined in an enum annotated with `@locale`
- All the values in the `@locale` enums must be provided in the English (`en_US`) translation. This is because `en_US` is the fallback translation when the current localte translations are not complete.
- `en_US` must have matching source and translation values, so it can act as a fallback translation.
- All `source` translations from all languages must be present in the `@locale` enums. This is to prevent renaming the values in the code without updating translation files.
- Translation `source` keys can't be used except for certain fields such as `"text"` and `"title"`. This is to prevent the accidental localization of non-display fields, such as node ids.
+10 -6
View File
@@ -14,13 +14,17 @@
| ------------------------- | --------------------------- | | ------------------------- | --------------------------- |
| ![Channel](./channel.jpg) | ![Playlist](./playlist.jpg) | | ![Channel](./channel.jpg) | ![Playlist](./playlist.jpg) |
| Settings | Invidious instances | Invidious testing | | Profiles | Settings |
| --------------------------- | ------------------------------------------------ | --------------------------------------------- | | --------------------------- | --------------------------- |
| ![Settings](./settings.jpg) | ![Invidious instances](./invidious-settings.jpg) | ![Invidious testing](./invidious-testing.jpg) | | ![Profiles](./profiles.jpg) | ![Settings](./settings.jpg) |
| Remote | App info | | Invidious instances | Invidious testing |
| ----------------------- | --------------------------- | | ------------------------------------------------ | --------------------------------------------- |
| ![Remote](./remote.jpg) | ![App info](./app-info.jpg) | | ![Invidious instances](./invidious-settings.jpg) | ![Invidious testing](./invidious-testing.jpg) |
| Remote | Info |
| ----------------------- | ------------------- |
| ![Remote](./remote.jpg) | ![Info](./info.jpg) |
## Playlet web app ## Playlet web app
Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 KiB

After

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 123 KiB

After

Width:  |  Height:  |  Size: 122 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 124 KiB

After

Width:  |  Height:  |  Size: 109 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 74 KiB

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 67 KiB

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 83 KiB

After

Width:  |  Height:  |  Size: 87 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 43 KiB

+400 -94
View File
@@ -1,44 +1,45 @@
{ {
"name": "playlet", "name": "playlet",
"version": "0.21.1", "version": "0.22.3",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "playlet", "name": "playlet",
"version": "0.21.1", "version": "0.22.3",
"hasInstallScript": true, "hasInstallScript": true,
"devDependencies": { "devDependencies": {
"@rokucommunity/bslint": "^0.8.19", "@rokucommunity/bslint": "^0.8.20",
"@types/crypto-js": "^4.2.2", "@types/crypto-js": "^4.2.2",
"@types/fs-extra": "^11.0.4", "@types/fs-extra": "^11.0.4",
"@types/node": "^20.11.25", "@types/node": "^20.11.30",
"@types/xml2js": "^0.4.14", "@types/xml2js": "^0.4.14",
"argparse": "^2.0.1", "argparse": "^2.0.1",
"brighterscript": "0.65.25", "brighterscript": "0.65.27",
"brighterscript-formatter": "^1.7.0", "brighterscript-formatter": "^1.7.1",
"convert-svg-to-png": "^0.6.4", "convert-svg-to-png": "^0.6.4",
"cross-fetch": "^4.0.0", "cross-fetch": "^4.0.0",
"crypto-js": "^4.2.0", "crypto-js": "^4.2.0",
"dotenv": "^16.4.5", "dotenv": "^16.4.5",
"express": "^4.18.3", "express": "^4.19.2",
"fs-extra": "^11.2.0", "fs-extra": "^11.2.0",
"glob": "^10.3.10", "glob": "^10.3.12",
"imap": "^0.8.19", "imap": "^0.8.19",
"ip": "^2.0.1", "ip": "^2.0.1",
"json5": "^2.2.3", "json5": "^2.2.3",
"mailparser": "^3.6.9", "mailparser": "^3.6.9",
"roku-deploy": "^3.12.0", "roku-deploy": "^3.12.0",
"rooibos-roku": "5.10.0", "rooibos-roku": "5.12.0",
"rounded-rect-9patch": "^1.0.1",
"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",
"typescript": "^5.4.2", "typescript": "^5.4.3",
"xml2js": "^0.6.2", "xml2js": "^0.6.2",
"yaml": "^2.4.1" "yaml": "^2.4.1"
}, },
"engines": { "engines": {
"node": "18" "node": "20"
} }
}, },
"node_modules/@cspotcode/source-map-support": { "node_modules/@cspotcode/source-map-support": {
@@ -276,9 +277,9 @@
"dev": true "dev": true
}, },
"node_modules/@rokucommunity/bslint": { "node_modules/@rokucommunity/bslint": {
"version": "0.8.19", "version": "0.8.20",
"resolved": "https://registry.npmjs.org/@rokucommunity/bslint/-/bslint-0.8.19.tgz", "resolved": "https://registry.npmjs.org/@rokucommunity/bslint/-/bslint-0.8.20.tgz",
"integrity": "sha512-2vQasjH5nZdgJJzxAOwYzA8gtjvvO5MtxfqjK10shE1G8XmLpqguT5qHzLz+HxvdRbFZ7OSOOyBAqQHgZRpO1Q==", "integrity": "sha512-yMPtlpFOtK4Cxy2SwYqPKjSVcgP6lHwgi4vdqWivjBvdWbi2P848n57JZFDmnwoY2smSl9lcRN2sU3iKmrzAsA==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"fs-extra": "^10.0.0", "fs-extra": "^10.0.0",
@@ -369,10 +370,16 @@
"@types/node": "*" "@types/node": "*"
} }
}, },
"node_modules/@types/mime-types": {
"version": "2.1.4",
"resolved": "https://registry.npmjs.org/@types/mime-types/-/mime-types-2.1.4.tgz",
"integrity": "sha512-lfU4b34HOri+kAY5UheuFMWPDOI+OPceBSHZKp69gEyTL/mmJ4cnU6Y/rlme3UL3GyOn6Y42hyIEw0/q8sWx5w==",
"dev": true
},
"node_modules/@types/node": { "node_modules/@types/node": {
"version": "20.11.25", "version": "20.11.30",
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.25.tgz", "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.30.tgz",
"integrity": "sha512-TBHyJxk2b7HceLVGFcpAUjsa5zIdsPWlR6XHfyGzd0SFu+/NFgQgMAl96MSDZgQDvJAvV6BKsFOrt6zIL09JDw==", "integrity": "sha512-dHM6ZxwlmuZaRmUPfv1p+KrdD1Dci04FbdEm/9wEMouFqxYoFl5aMkt0VMAUtYRQDyYvD41WJLukhq/ha3YuTw==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"undici-types": "~5.26.4" "undici-types": "~5.26.4"
@@ -579,12 +586,27 @@
"node": ">=0.8" "node": ">=0.8"
} }
}, },
"node_modules/async-limiter": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz",
"integrity": "sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ==",
"dev": true
},
"node_modules/asynckit": { "node_modules/asynckit": {
"version": "0.4.0", "version": "0.4.0",
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
"integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==",
"dev": true "dev": true
}, },
"node_modules/at-least-node": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz",
"integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==",
"dev": true,
"engines": {
"node": ">= 4.0.0"
}
},
"node_modules/aws-sign2": { "node_modules/aws-sign2": {
"version": "0.7.0", "version": "0.7.0",
"resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz",
@@ -728,9 +750,9 @@
} }
}, },
"node_modules/brighterscript": { "node_modules/brighterscript": {
"version": "0.65.25", "version": "0.65.27",
"resolved": "https://registry.npmjs.org/brighterscript/-/brighterscript-0.65.25.tgz", "resolved": "https://registry.npmjs.org/brighterscript/-/brighterscript-0.65.27.tgz",
"integrity": "sha512-sezfScxcXZfzEJ702HCMjfPsIH/x3mfLAFDObGU+xAC2E8m/zxrPOHKlD9Qpmdvd7/j4TgsujhiRQ1tnk8BzGA==", "integrity": "sha512-G56OIzdh8D9GHPSt2LfmJ3amr4hkPXleECRTPWWI3fDvj9L7p7Vhk/g5HG/ClCkjTG/QwuYv7giNsMW8fB8VJA==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@rokucommunity/bslib": "^0.1.1", "@rokucommunity/bslib": "^0.1.1",
@@ -758,10 +780,10 @@
"roku-deploy": "^3.12.0", "roku-deploy": "^3.12.0",
"serialize-error": "^7.0.1", "serialize-error": "^7.0.1",
"source-map": "^0.7.4", "source-map": "^0.7.4",
"vscode-languageserver": "7.0.0", "vscode-languageserver": "^9.0.1",
"vscode-languageserver-protocol": "3.16.0", "vscode-languageserver-protocol": "^3.17.5",
"vscode-languageserver-textdocument": "^1.0.1", "vscode-languageserver-textdocument": "^1.0.11",
"vscode-uri": "^2.1.1", "vscode-uri": "^3.0.8",
"xml2js": "^0.5.0", "xml2js": "^0.5.0",
"yargs": "^16.2.0" "yargs": "^16.2.0"
}, },
@@ -770,12 +792,12 @@
} }
}, },
"node_modules/brighterscript-formatter": { "node_modules/brighterscript-formatter": {
"version": "1.7.0", "version": "1.7.1",
"resolved": "https://registry.npmjs.org/brighterscript-formatter/-/brighterscript-formatter-1.7.0.tgz", "resolved": "https://registry.npmjs.org/brighterscript-formatter/-/brighterscript-formatter-1.7.1.tgz",
"integrity": "sha512-LKnUeAgNX3eKqK0J1Z55YteRlR/+DFuCbMf6/5DHdlCI7VVkOf+EWErruSfuol6+T2eImM0LY79CLT854VTE5g==", "integrity": "sha512-P5ovoRUsiYJYk0lO0X5iWtYWMOI3g0bpnVDefnh6spkYsKnz6YhG0r9zMdsvlUk2mYzkqK/pA7LTGlTbiVUa0Q==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"brighterscript": "^0.65.25", "brighterscript": "^0.65.27",
"glob-all": "^3.3.0", "glob-all": "^3.3.0",
"jsonc-parser": "^3.0.0", "jsonc-parser": "^3.0.0",
"source-map": "^0.7.3", "source-map": "^0.7.3",
@@ -1076,6 +1098,12 @@
"node": "*" "node": "*"
} }
}, },
"node_modules/buffer-from": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz",
"integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==",
"dev": true
},
"node_modules/bytes": { "node_modules/bytes": {
"version": "3.1.2", "version": "3.1.2",
"resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz",
@@ -1275,6 +1303,21 @@
"integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==",
"dev": true "dev": true
}, },
"node_modules/concat-stream": {
"version": "1.6.2",
"resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz",
"integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==",
"dev": true,
"engines": [
"node >= 0.8"
],
"dependencies": {
"buffer-from": "^1.0.0",
"inherits": "^2.0.3",
"readable-stream": "^2.2.2",
"typedarray": "^0.0.6"
}
},
"node_modules/content-disposition": { "node_modules/content-disposition": {
"version": "0.5.4", "version": "0.5.4",
"resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz",
@@ -1464,9 +1507,9 @@
} }
}, },
"node_modules/cookie": { "node_modules/cookie": {
"version": "0.5.0", "version": "0.6.0",
"resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz", "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz",
"integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==", "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==",
"dev": true, "dev": true,
"engines": { "engines": {
"node": ">= 0.6" "node": ">= 0.6"
@@ -1893,9 +1936,9 @@
"dev": true "dev": true
}, },
"node_modules/express": { "node_modules/express": {
"version": "4.18.3", "version": "4.19.2",
"resolved": "https://registry.npmjs.org/express/-/express-4.18.3.tgz", "resolved": "https://registry.npmjs.org/express/-/express-4.19.2.tgz",
"integrity": "sha512-6VyCijWQ+9O7WuVMTRBTl+cjNNIzD5cY5mQ1WM8r/LEkI2u8EYpOotESNwzNlyCn3g+dmjKYI6BmNneSr/FSRw==", "integrity": "sha512-5T6nhjsT+EOMzuck8JjBHARTHfMht0POzlA60WV2pMD3gyXw2LZnZ+ueGdNxG+0calOJcWKbpFcuzLZ91YWq9Q==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"accepts": "~1.3.8", "accepts": "~1.3.8",
@@ -1903,7 +1946,7 @@
"body-parser": "1.20.2", "body-parser": "1.20.2",
"content-disposition": "0.5.4", "content-disposition": "0.5.4",
"content-type": "~1.0.4", "content-type": "~1.0.4",
"cookie": "0.5.0", "cookie": "0.6.0",
"cookie-signature": "1.0.6", "cookie-signature": "1.0.6",
"debug": "2.6.9", "debug": "2.6.9",
"depd": "2.0.0", "depd": "2.0.0",
@@ -2259,16 +2302,16 @@
} }
}, },
"node_modules/glob": { "node_modules/glob": {
"version": "10.3.10", "version": "10.3.12",
"resolved": "https://registry.npmjs.org/glob/-/glob-10.3.10.tgz", "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.12.tgz",
"integrity": "sha512-fa46+tv1Ak0UPK1TOy/pZrIybNNt4HCv7SDzwyfiOZkvZLEbjsZkJBPtDHVshZjbecAoAGSC20MjLDG/qr679g==", "integrity": "sha512-TCNv8vJ+xz4QiqTpfOJA7HvYv+tNIRHKfUWw/q+v2jdgN4ebz+KY9tGx5J4rHP0o84mNP+ApH66HRX8us3Khqg==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"foreground-child": "^3.1.0", "foreground-child": "^3.1.0",
"jackspeak": "^2.3.5", "jackspeak": "^2.3.6",
"minimatch": "^9.0.1", "minimatch": "^9.0.1",
"minipass": "^5.0.0 || ^6.0.2 || ^7.0.0", "minipass": "^7.0.4",
"path-scurry": "^1.10.1" "path-scurry": "^1.10.2"
}, },
"bin": { "bin": {
"glob": "dist/esm/bin.mjs" "glob": "dist/esm/bin.mjs"
@@ -2349,15 +2392,6 @@
"url": "https://github.com/sponsors/isaacs" "url": "https://github.com/sponsors/isaacs"
} }
}, },
"node_modules/glob/node_modules/minipass": {
"version": "7.0.2",
"resolved": "https://registry.npmjs.org/minipass/-/minipass-7.0.2.tgz",
"integrity": "sha512-eL79dXrE1q9dBbDCLg7xfn/vl7MS4F1gvJAgjJrQli/jbQWdUttuVawphqpffoIYfRdq78LHx6GP4bU/EQ2ATA==",
"dev": true,
"engines": {
"node": ">=16 || 14 >=14.17"
}
},
"node_modules/gopd": { "node_modules/gopd": {
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz",
@@ -2376,6 +2410,36 @@
"integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==",
"dev": true "dev": true
}, },
"node_modules/handlebars": {
"version": "4.7.8",
"resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.8.tgz",
"integrity": "sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ==",
"dev": true,
"dependencies": {
"minimist": "^1.2.5",
"neo-async": "^2.6.2",
"source-map": "^0.6.1",
"wordwrap": "^1.0.0"
},
"bin": {
"handlebars": "bin/handlebars"
},
"engines": {
"node": ">=0.4.7"
},
"optionalDependencies": {
"uglify-js": "^3.1.4"
}
},
"node_modules/handlebars/node_modules/source-map": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
"dev": true,
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/har-schema": { "node_modules/har-schema": {
"version": "2.0.0", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz",
@@ -3176,6 +3240,36 @@
"node": "*" "node": "*"
} }
}, },
"node_modules/minimist": {
"version": "1.2.8",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz",
"integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==",
"dev": true,
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/minipass": {
"version": "7.0.4",
"resolved": "https://registry.npmjs.org/minipass/-/minipass-7.0.4.tgz",
"integrity": "sha512-jYofLM5Dam9279rdkWzqHozUo4ybjdZmCsDHePy5V/PbBcVMiSZR97gmAy45aqi8CK1lG2ECd356FU86avfwUQ==",
"dev": true,
"engines": {
"node": ">=16 || 14 >=14.17"
}
},
"node_modules/mkdirp": {
"version": "0.5.6",
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz",
"integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==",
"dev": true,
"dependencies": {
"minimist": "^1.2.6"
},
"bin": {
"mkdirp": "bin/cmd.js"
}
},
"node_modules/mkdirp-classic": { "node_modules/mkdirp-classic": {
"version": "0.5.3", "version": "0.5.3",
"resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz", "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz",
@@ -3206,6 +3300,12 @@
"node": ">= 0.6" "node": ">= 0.6"
} }
}, },
"node_modules/neo-async": {
"version": "2.6.2",
"resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz",
"integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==",
"dev": true
},
"node_modules/node-fetch": { "node_modules/node-fetch": {
"version": "2.6.12", "version": "2.6.12",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.12.tgz", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.12.tgz",
@@ -3226,6 +3326,167 @@
} }
} }
}, },
"node_modules/node-html-to-image": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/node-html-to-image/-/node-html-to-image-1.2.0.tgz",
"integrity": "sha512-Z+YvvY2PSc9xULWd2NtqfO4x9rNzEiNOjA1QjOdB/BShVA7ULMJ3YKaFbn0wVuFqYJ6WSaY7ruw9frcJpXQNVQ==",
"dev": true,
"dependencies": {
"handlebars": "^4.5.3",
"puppeteer": "^2.0.0"
}
},
"node_modules/node-html-to-image/node_modules/agent-base": {
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/agent-base/-/agent-base-5.1.1.tgz",
"integrity": "sha512-TMeqbNl2fMW0nMjTEPOwe3J/PRFP4vqeoNuQMG0HlMrtm5QxKqdvAkZ1pRBQ/ulIyDD5Yq0nJ7YbdD8ey0TO3g==",
"dev": true,
"engines": {
"node": ">= 6.0.0"
}
},
"node_modules/node-html-to-image/node_modules/debug": {
"version": "4.3.4",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz",
"integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==",
"dev": true,
"dependencies": {
"ms": "2.1.2"
},
"engines": {
"node": ">=6.0"
},
"peerDependenciesMeta": {
"supports-color": {
"optional": true
}
}
},
"node_modules/node-html-to-image/node_modules/extract-zip": {
"version": "1.7.0",
"resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-1.7.0.tgz",
"integrity": "sha512-xoh5G1W/PB0/27lXgMQyIhP5DSY/LhoCsOyZgb+6iMmRtCwVBo55uKaMoEYrDCKQhWvqEip5ZPKAc6eFNyf/MA==",
"dev": true,
"dependencies": {
"concat-stream": "^1.6.2",
"debug": "^2.6.9",
"mkdirp": "^0.5.4",
"yauzl": "^2.10.0"
},
"bin": {
"extract-zip": "cli.js"
}
},
"node_modules/node-html-to-image/node_modules/extract-zip/node_modules/debug": {
"version": "2.6.9",
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
"integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
"dev": true,
"dependencies": {
"ms": "2.0.0"
}
},
"node_modules/node-html-to-image/node_modules/extract-zip/node_modules/ms": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
"integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==",
"dev": true
},
"node_modules/node-html-to-image/node_modules/glob": {
"version": "7.2.3",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz",
"integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==",
"dev": true,
"dependencies": {
"fs.realpath": "^1.0.0",
"inflight": "^1.0.4",
"inherits": "2",
"minimatch": "^3.1.1",
"once": "^1.3.0",
"path-is-absolute": "^1.0.0"
},
"engines": {
"node": "*"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/node-html-to-image/node_modules/https-proxy-agent": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-4.0.0.tgz",
"integrity": "sha512-zoDhWrkR3of1l9QAL8/scJZyLu8j/gBkcwcaQOZh7Gyh/+uJQzGVETdgT30akuwkpL8HTRfssqI3BZuV18teDg==",
"dev": true,
"dependencies": {
"agent-base": "5",
"debug": "4"
},
"engines": {
"node": ">= 6.0.0"
}
},
"node_modules/node-html-to-image/node_modules/mime": {
"version": "2.6.0",
"resolved": "https://registry.npmjs.org/mime/-/mime-2.6.0.tgz",
"integrity": "sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg==",
"dev": true,
"bin": {
"mime": "cli.js"
},
"engines": {
"node": ">=4.0.0"
}
},
"node_modules/node-html-to-image/node_modules/ms": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==",
"dev": true
},
"node_modules/node-html-to-image/node_modules/puppeteer": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-2.1.1.tgz",
"integrity": "sha512-LWzaDVQkk1EPiuYeTOj+CZRIjda4k2s5w4MK4xoH2+kgWV/SDlkYHmxatDdtYrciHUKSXTsGgPgPP8ILVdBsxg==",
"deprecated": "< 21.5.0 is no longer supported",
"dev": true,
"hasInstallScript": true,
"dependencies": {
"@types/mime-types": "^2.1.0",
"debug": "^4.1.0",
"extract-zip": "^1.6.6",
"https-proxy-agent": "^4.0.0",
"mime": "^2.0.3",
"mime-types": "^2.1.25",
"progress": "^2.0.1",
"proxy-from-env": "^1.0.0",
"rimraf": "^2.6.1",
"ws": "^6.1.0"
},
"engines": {
"node": ">=8.16.0"
}
},
"node_modules/node-html-to-image/node_modules/rimraf": {
"version": "2.7.1",
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz",
"integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==",
"dev": true,
"dependencies": {
"glob": "^7.1.3"
},
"bin": {
"rimraf": "bin.js"
}
},
"node_modules/node-html-to-image/node_modules/ws": {
"version": "6.2.2",
"resolved": "https://registry.npmjs.org/ws/-/ws-6.2.2.tgz",
"integrity": "sha512-zmhltoSR8u1cnDsD43TX59mzoMZsLKqUweyYBAIvTngR3shc0W6aOZylZmq/7hqyVxPdi+5Ud2QInblgyE72fw==",
"dev": true,
"dependencies": {
"async-limiter": "~1.0.0"
}
},
"node_modules/nodemailer": { "node_modules/nodemailer": {
"version": "6.9.11", "version": "6.9.11",
"resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-6.9.11.tgz", "resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-6.9.11.tgz",
@@ -3470,12 +3731,12 @@
"dev": true "dev": true
}, },
"node_modules/path-scurry": { "node_modules/path-scurry": {
"version": "1.10.1", "version": "1.10.2",
"resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.10.1.tgz", "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.10.2.tgz",
"integrity": "sha512-MkhCqzzBEpPvxxQ71Md0b1Kk51W01lrYvlMzSUaIzNsODdd7mqhiimSZlr+VegAz5Z6Vzt9Xg2ttE//XBhH3EQ==", "integrity": "sha512-7xTavNy5RQXnsjANvVvMkEjvloOinkAjv/Z6Ildz9v2RinZ4SBKTWFOVRbaF8p0vpHnyjV/UwNDdKuUv6M5qcA==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"lru-cache": "^9.1.1 || ^10.0.0", "lru-cache": "^10.2.0",
"minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0"
}, },
"engines": { "engines": {
@@ -3486,23 +3747,14 @@
} }
}, },
"node_modules/path-scurry/node_modules/lru-cache": { "node_modules/path-scurry/node_modules/lru-cache": {
"version": "10.0.0", "version": "10.2.0",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.0.0.tgz", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.2.0.tgz",
"integrity": "sha512-svTf/fzsKHffP42sujkO/Rjs37BCIsQVRCeNYIm9WN8rgT7ffoUnRtZCqU+6BqcSBdv8gwJeTz8knJpgACeQMw==", "integrity": "sha512-2bIM8x+VAf6JT4bKAljS1qUWgMsqZRPGJS6FSahIMPVvctcNhyVp7AJu7quxOW9jwkryBReKZY5tY5JYv2n/7Q==",
"dev": true, "dev": true,
"engines": { "engines": {
"node": "14 || >=16.14" "node": "14 || >=16.14"
} }
}, },
"node_modules/path-scurry/node_modules/minipass": {
"version": "7.0.2",
"resolved": "https://registry.npmjs.org/minipass/-/minipass-7.0.2.tgz",
"integrity": "sha512-eL79dXrE1q9dBbDCLg7xfn/vl7MS4F1gvJAgjJrQli/jbQWdUttuVawphqpffoIYfRdq78LHx6GP4bU/EQ2ATA==",
"dev": true,
"engines": {
"node": ">=16 || 14 >=14.17"
}
},
"node_modules/path-to-regexp": { "node_modules/path-to-regexp": {
"version": "0.1.7", "version": "0.1.7",
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz",
@@ -4021,9 +4273,9 @@
} }
}, },
"node_modules/rooibos-roku": { "node_modules/rooibos-roku": {
"version": "5.10.0", "version": "5.12.0",
"resolved": "https://registry.npmjs.org/rooibos-roku/-/rooibos-roku-5.10.0.tgz", "resolved": "https://registry.npmjs.org/rooibos-roku/-/rooibos-roku-5.12.0.tgz",
"integrity": "sha512-Idiv3nWQOEr5V8z8oHcIovjcoBffgqRtTQ5B6K+x/cGAouKxyVJp0fsZ80xQvUul9IwHQ0XIPUYbNWCR3RQ3sA==", "integrity": "sha512-fJofEoaD2fNGK7zurdwSBVIQQAbc0jo0Q8TKbJbip0FGPt+inMerFhsWyp7dgXiUaw4mX+S95g74NgHbll9O/g==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"source-map": "^0.7.3", "source-map": "^0.7.3",
@@ -4069,6 +4321,35 @@
"integrity": "sha512-+a9MPUQrNGRrGU630OGbYVQ+11iOIovjCkqxajPa9w57Sd5ruK8WQNsslzpa0x/QJqC8kRc2DUxWjIFwoNm4ZQ==", "integrity": "sha512-+a9MPUQrNGRrGU630OGbYVQ+11iOIovjCkqxajPa9w57Sd5ruK8WQNsslzpa0x/QJqC8kRc2DUxWjIFwoNm4ZQ==",
"dev": true "dev": true
}, },
"node_modules/rounded-rect-9patch": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/rounded-rect-9patch/-/rounded-rect-9patch-1.0.1.tgz",
"integrity": "sha512-5sNv0pg8+QRd9DgnzD7alGJt/9UnJs+5xv4dLAT6CKfT6h4WMcGcyTIWoRuJminJ3T/4yo7tFwnJ8cOPGiBWMw==",
"dev": true,
"dependencies": {
"fs-extra": "^9.0.0",
"minimist": "^1.2.5",
"node-html-to-image": "^1.2.0"
},
"bin": {
"rounded-rect-9patch": "cli.js"
}
},
"node_modules/rounded-rect-9patch/node_modules/fs-extra": {
"version": "9.1.0",
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz",
"integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==",
"dev": true,
"dependencies": {
"at-least-node": "^1.0.0",
"graceful-fs": "^4.2.0",
"jsonfile": "^6.0.1",
"universalify": "^2.0.0"
},
"engines": {
"node": ">=10"
}
},
"node_modules/run-parallel": { "node_modules/run-parallel": {
"version": "1.2.0", "version": "1.2.0",
"resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz",
@@ -4646,10 +4927,16 @@
"node": ">= 0.6" "node": ">= 0.6"
} }
}, },
"node_modules/typedarray": {
"version": "0.0.6",
"resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz",
"integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==",
"dev": true
},
"node_modules/typescript": { "node_modules/typescript": {
"version": "5.4.2", "version": "5.4.3",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.2.tgz", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.3.tgz",
"integrity": "sha512-+2/g0Fds1ERlP6JsakQQDXjZdZMM+rqpamFZJEKh4kwTIn3iDkgKtby0CeNd5ATNZ4Ry1ax15TMx0W2V+miizQ==", "integrity": "sha512-KrPd3PKaCLr78MalgiwJnA25Nm8HAmdwN3mYUYZgG/wizIo9EainNVQI9/yDavtVFRN2h3k8uf3GLHuhDMgEHg==",
"dev": true, "dev": true,
"bin": { "bin": {
"tsc": "bin/tsc", "tsc": "bin/tsc",
@@ -4665,6 +4952,19 @@
"integrity": "sha512-DffL94LsNOccVn4hyfRe5rdKa273swqeA5DJpMOeFmEn1wCDc7nAbbB0gXlgBCL7TNzeTv6G7XVWzan7iJtfig==", "integrity": "sha512-DffL94LsNOccVn4hyfRe5rdKa273swqeA5DJpMOeFmEn1wCDc7nAbbB0gXlgBCL7TNzeTv6G7XVWzan7iJtfig==",
"dev": true "dev": true
}, },
"node_modules/uglify-js": {
"version": "3.17.4",
"resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.17.4.tgz",
"integrity": "sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g==",
"dev": true,
"optional": true,
"bin": {
"uglifyjs": "bin/uglifyjs"
},
"engines": {
"node": ">=0.8.0"
}
},
"node_modules/unbzip2-stream": { "node_modules/unbzip2-stream": {
"version": "1.4.3", "version": "1.4.3",
"resolved": "https://registry.npmjs.org/unbzip2-stream/-/unbzip2-stream-1.4.3.tgz", "resolved": "https://registry.npmjs.org/unbzip2-stream/-/unbzip2-stream-1.4.3.tgz",
@@ -4802,52 +5102,52 @@
"dev": true "dev": true
}, },
"node_modules/vscode-jsonrpc": { "node_modules/vscode-jsonrpc": {
"version": "6.0.0", "version": "8.2.0",
"resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-6.0.0.tgz", "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-8.2.0.tgz",
"integrity": "sha512-wnJA4BnEjOSyFMvjZdpiOwhSq9uDoK8e/kpRJDTaMYzwlkrhG1fwDIZI94CLsLzlCK5cIbMMtFlJlfR57Lavmg==", "integrity": "sha512-C+r0eKJUIfiDIfwJhria30+TYWPtuHJXHtI7J0YlOmKAo7ogxP20T0zxB7HZQIFhIyvoBPwWskjxrvAtfjyZfA==",
"dev": true, "dev": true,
"engines": { "engines": {
"node": ">=8.0.0 || >=10.0.0" "node": ">=14.0.0"
} }
}, },
"node_modules/vscode-languageserver": { "node_modules/vscode-languageserver": {
"version": "7.0.0", "version": "9.0.1",
"resolved": "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-7.0.0.tgz", "resolved": "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-9.0.1.tgz",
"integrity": "sha512-60HTx5ID+fLRcgdHfmz0LDZAXYEV68fzwG0JWwEPBode9NuMYTIxuYXPg4ngO8i8+Ou0lM7y6GzaYWbiDL0drw==", "integrity": "sha512-woByF3PDpkHFUreUa7Hos7+pUWdeWMXRd26+ZX2A8cFx6v/JPTtd4/uN0/jB6XQHYaOlHbio03NTHCqrgG5n7g==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"vscode-languageserver-protocol": "3.16.0" "vscode-languageserver-protocol": "3.17.5"
}, },
"bin": { "bin": {
"installServerIntoExtension": "bin/installServerIntoExtension" "installServerIntoExtension": "bin/installServerIntoExtension"
} }
}, },
"node_modules/vscode-languageserver-protocol": { "node_modules/vscode-languageserver-protocol": {
"version": "3.16.0", "version": "3.17.5",
"resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.16.0.tgz", "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.5.tgz",
"integrity": "sha512-sdeUoAawceQdgIfTI+sdcwkiK2KU+2cbEYA0agzM2uqaUy2UpnnGHtWTHVEtS0ES4zHU0eMFRGN+oQgDxlD66A==", "integrity": "sha512-mb1bvRJN8SVznADSGWM9u/b07H7Ecg0I3OgXDuLdn307rl/J3A9YD6/eYOssqhecL27hK1IPZAsaqh00i/Jljg==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"vscode-jsonrpc": "6.0.0", "vscode-jsonrpc": "8.2.0",
"vscode-languageserver-types": "3.16.0" "vscode-languageserver-types": "3.17.5"
} }
}, },
"node_modules/vscode-languageserver-textdocument": { "node_modules/vscode-languageserver-textdocument": {
"version": "1.0.8", "version": "1.0.11",
"resolved": "https://registry.npmjs.org/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.8.tgz", "resolved": "https://registry.npmjs.org/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.11.tgz",
"integrity": "sha512-1bonkGqQs5/fxGT5UchTgjGVnfysL0O8v1AYMBjqTbWQTFn721zaPGDYFkOKtfDgFiSgXM3KwaG3FMGfW4Ed9Q==", "integrity": "sha512-X+8T3GoiwTVlJbicx/sIAF+yuJAqz8VvwJyoMVhwEMoEKE/fkDmrqUgDMyBECcM2A2frVZIUj5HI/ErRXCfOeA==",
"dev": true "dev": true
}, },
"node_modules/vscode-languageserver-types": { "node_modules/vscode-languageserver-types": {
"version": "3.16.0", "version": "3.17.5",
"resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.16.0.tgz", "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.5.tgz",
"integrity": "sha512-k8luDIWJWyenLc5ToFQQMaSrqCHiLwyKPHKPQZ5zz21vM+vIVUSvsRpcbiECH4WR88K2XZqc4ScRcZ7nk/jbeA==", "integrity": "sha512-Ld1VelNuX9pdF39h2Hgaeb5hEZM2Z3jUrrMgWQAu82jMtZp7p3vJT3BzToKtZI7NgQssZje5o0zryOrhQvzQAg==",
"dev": true "dev": true
}, },
"node_modules/vscode-uri": { "node_modules/vscode-uri": {
"version": "2.1.2", "version": "3.0.8",
"resolved": "https://registry.npmjs.org/vscode-uri/-/vscode-uri-2.1.2.tgz", "resolved": "https://registry.npmjs.org/vscode-uri/-/vscode-uri-3.0.8.tgz",
"integrity": "sha512-8TEXQxlldWAuIODdukIb+TR5s+9Ds40eSJrw+1iDDA9IFORPjMELarNQE3myz5XIkWWpdprmJjm1/SxMlWOC8A==", "integrity": "sha512-AyFQ0EVmsOZOlAnxoFOGOq1SQDWAB7C6aqMGS23svWAllfOaxbuFvcT8D1i8z3Gyn8fraVeZNNmN6e9bxxXkKw==",
"dev": true "dev": true
}, },
"node_modules/webidl-conversions": { "node_modules/webidl-conversions": {
@@ -4887,6 +5187,12 @@
"integrity": "sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==", "integrity": "sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==",
"dev": true "dev": true
}, },
"node_modules/wordwrap": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz",
"integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==",
"dev": true
},
"node_modules/wrap-ansi": { "node_modules/wrap-ansi": {
"version": "6.2.0", "version": "6.2.0",
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz",
+11 -10
View File
@@ -1,38 +1,39 @@
{ {
"name": "playlet", "name": "playlet",
"version": "0.21.1", "version": "0.22.3",
"description": "Unofficial YouTube client for Roku", "description": "Unofficial YouTube client for Roku",
"devDependencies": { "devDependencies": {
"@rokucommunity/bslint": "^0.8.19", "@rokucommunity/bslint": "^0.8.20",
"@types/crypto-js": "^4.2.2", "@types/crypto-js": "^4.2.2",
"@types/fs-extra": "^11.0.4", "@types/fs-extra": "^11.0.4",
"@types/node": "^20.11.25", "@types/node": "^20.11.30",
"@types/xml2js": "^0.4.14", "@types/xml2js": "^0.4.14",
"argparse": "^2.0.1", "argparse": "^2.0.1",
"brighterscript": "0.65.25", "brighterscript": "0.65.27",
"brighterscript-formatter": "^1.7.0", "brighterscript-formatter": "^1.7.1",
"convert-svg-to-png": "^0.6.4", "convert-svg-to-png": "^0.6.4",
"cross-fetch": "^4.0.0", "cross-fetch": "^4.0.0",
"crypto-js": "^4.2.0", "crypto-js": "^4.2.0",
"dotenv": "^16.4.5", "dotenv": "^16.4.5",
"express": "^4.18.3", "express": "^4.19.2",
"fs-extra": "^11.2.0", "fs-extra": "^11.2.0",
"glob": "^10.3.10", "glob": "^10.3.12",
"imap": "^0.8.19", "imap": "^0.8.19",
"ip": "^2.0.1", "ip": "^2.0.1",
"json5": "^2.2.3", "json5": "^2.2.3",
"mailparser": "^3.6.9", "mailparser": "^3.6.9",
"roku-deploy": "^3.12.0", "roku-deploy": "^3.12.0",
"rooibos-roku": "5.10.0", "rooibos-roku": "5.12.0",
"rounded-rect-9patch": "^1.0.1",
"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",
"typescript": "^5.4.2", "typescript": "^5.4.3",
"xml2js": "^0.6.2", "xml2js": "^0.6.2",
"yaml": "^2.4.1" "yaml": "^2.4.1"
}, },
"engines": { "engines": {
"node": "18" "node": "20"
}, },
"scripts": { "scripts": {
"dev:web": "cd playlet-web && npm run dev", "dev:web": "cd playlet-web && npm run dev",
+2 -2
View File
@@ -1,12 +1,12 @@
{ {
"name": "playlet-app", "name": "playlet-app",
"version": "0.21.1", "version": "0.22.3",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "playlet-app", "name": "playlet-app",
"version": "0.21.1" "version": "0.22.3"
} }
} }
} }
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "playlet-app", "name": "playlet-app",
"version": "0.21.1", "version": "0.22.3",
"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",
Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.9 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 KiB

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

@@ -3,24 +3,24 @@
outputs: [ outputs: [
{ {
outputFilePath: 'images/channel-poster_fhd.png', outputFilePath: 'images/channel-poster_fhd.png',
outputHash: '50729b5bdd2a7c0fd4a1d502812117d4', outputHash: '49c39d7f33e37a8214bf05d7db016e97',
width: 540, width: 540,
height: 405, height: 405,
background: '#EEEEEE', background: '#EBEBEB',
}, },
{ {
outputFilePath: 'images/channel-poster_hd.png', outputFilePath: 'images/channel-poster_hd.png',
outputHash: '8022dc6fa993ce3194c5aea37d6ea49a', outputHash: '4968cb52fca911be47fa17e61f0af4a5',
width: 290, width: 290,
height: 218, height: 218,
background: '#EEEEEE', background: '#EBEBEB',
}, },
{ {
outputFilePath: 'images/channel-poster_sd.png', outputFilePath: 'images/channel-poster_sd.png',
outputHash: '63b8f12ac155c29b4e85db17a2886817', outputHash: 'e976889af6743044db344219ec44514c',
width: 246, width: 246,
height: 140, height: 140,
background: '#EEEEEE', background: '#EBEBEB',
}, },
], ],
} }
+2 -2
View File
@@ -2,8 +2,8 @@ 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=21 minor_version=22
build_version=00001 build_version=00003
ui_resolutions=hd ui_resolutions=hd
+2 -2
View File
@@ -22,9 +22,9 @@ function DialogSetPalette(msgDialog as object)
DialogBackgroundColor: "#242424FF" DialogBackgroundColor: "#242424FF"
DialogFocusColor: "#CECECEFF" DialogFocusColor: "#CECECEFF"
DialogFocusItemColor: "#202020FF" DialogFocusItemColor: "#202020FF"
DialogSecondaryTextColor: "#DBDBDBFF" DialogSecondaryTextColor: "#EBEBEBFF"
DialogSecondaryItemColor: "#FF1C30FF" DialogSecondaryItemColor: "#FF1C30FF"
DialogTextColor: "#DBDBDBFF" DialogTextColor: "#EBEBEBFF"
} }
msgDialog.palette = palette msgDialog.palette = palette
end function end function
+2 -2
View File
@@ -1,12 +1,12 @@
{ {
"name": "playlet-lib", "name": "playlet-lib",
"version": "0.21.1", "version": "0.22.3",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "playlet-lib", "name": "playlet-lib",
"version": "0.21.1" "version": "0.22.3"
} }
} }
} }
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "playlet-lib", "name": "playlet-lib",
"version": "0.21.1", "version": "0.22.3",
"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",
@@ -3,6 +3,7 @@ import "pkg:/components/Navigation/LongPress.bs"
import "pkg:/components/VideoQueue/VideoQueueUtils.bs" import "pkg:/components/VideoQueue/VideoQueueUtils.bs"
import "pkg:/components/VideoQueue/VideoQueueViewUtils.bs" import "pkg:/components/VideoQueue/VideoQueueViewUtils.bs"
import "pkg:/source/utils/FocusManagement.bs" import "pkg:/source/utils/FocusManagement.bs"
import "pkg:/source/utils/Locale.bs"
import "pkg:/source/utils/Logging.bs" import "pkg:/source/utils/Logging.bs"
import "pkg:/source/utils/StringUtils.bs" import "pkg:/source/utils/StringUtils.bs"
import "pkg:/source/utils/Types.bs" import "pkg:/source/utils/Types.bs"
@@ -125,7 +126,7 @@ function onKeyEvent(key as string, press as boolean) as boolean
return true return true
end if end if
end if end if
dialog = DialogUtils.ShowDialogButtons("Do you want to exit Playlet?", "Exit", ["Exit", "Cancel"]) dialog = DialogUtils.ShowDialogButtons(Tr(Locale.Dialogs.ExitPlayletQuestion), Tr(Locale.Buttons.exit), [Tr(Locale.Buttons.exit), Tr(Locale.Buttons.Cancel)])
dialog.observeField("buttonSelected", FuncName(OnExitDialog), ["buttonSelected"]) dialog.observeField("buttonSelected", FuncName(OnExitDialog), ["buttonSelected"])
return true return true
end if end if
@@ -0,0 +1,146 @@
import "pkg:/source/utils/MathUtils.bs"
import "pkg:/source/utils/Types.bs"
function Init()
m.backgroundNode = m.top.findNode("background")
m.labelNode = m.top.findNode("label")
m.iconNode = m.top.findNode("icon")
m.anchorNode = m.top.findNode("anchor")
m.focusAnimation = m.top.findNode("focusAnimation")
m.normalFont = m.top.findNode("normalFont")
m.boldFont = m.top.findNode("boldFont")
DoLayout()
OnDisabledChange()
m.top.observeField("focusedChild", FuncName(OnFocusedChild))
end function
function DoLayout() as void
minWidth = m.top.minWidth
height = m.top.height
padding = m.top.padding
textVisible = m.top.textVisible
iconVisible = m.top.iconVisible
if not textVisible and not iconVisible
m.top.width = minWidth
return
end if
contentWidth = 0
iconWidth = 0
iconHeight = 0
textWidth = 0
iconTextSpacing = 0
if iconVisible
iconWidth = m.top.iconWidth
iconHeight = m.top.iconHeight
contentWidth += iconWidth
end if
if textVisible
labelRect = m.labelNode.boundingRect()
textWidth = labelRect.width
contentWidth += textWidth
end if
if iconVisible and textVisible
iconTextSpacing = m.top.iconTextSpacing
contentWidth += iconTextSpacing
end if
contentWidth += padding[0] + padding[1]
width = MathUtils.Max(contentWidth, minWidth)
m.top.width = width
if iconVisible
x = (width - contentWidth) / 2 + padding[0]
y = (height - iconHeight) / 2
m.iconNode.translation = [x, y]
end if
if textVisible
x = (width - contentWidth) / 2 + padding[0] + iconWidth + iconTextSpacing
m.labelNode.height = height
m.labelNode.translation = [x, 0]
end if
OnAnchorChange()
end function
function OnAnchorChange()
width = m.top.width
height = m.top.height
anchor = m.top.anchor
m.anchorNode.scaleRotateCenter = [width / 2, height / 2]
m.anchorNode.translation = [-width * anchor[0], -height * anchor[1]]
end function
function OnDisabledChange()
disabled = m.top.disabled
if disabled
if m.top.textVisible
m.labelNode.color = m.top.disabledTextColor
m.labelNode.font = m.normalFont
end if
if m.top.iconVisible
m.iconNode.blendColor = m.top.disabledIconColor
end if
m.backgroundNode.blendColor = m.top.disabledBackgroundColor
else
OnButtonFocused()
end if
m.top.focusable = not disabled
end function
function OnFocusedChild()
m.top.buttonFocused = m.top.hasFocus()
end function
function OnButtonFocused()
buttonFocused = m.top.buttonFocused
textVisible = m.top.textVisible
iconVisible = m.top.iconVisible
if buttonFocused
if textVisible
m.labelNode.color = m.top.focusedTextColor
m.labelNode.font = m.boldFont
end if
if iconVisible
m.iconNode.blendColor = m.top.focusedIconColor
end if
m.backgroundNode.blendColor = m.top.focusedBackgroundColor
m.focusAnimation.control = "start"
else
if textVisible
m.labelNode.color = m.top.textColor
m.labelNode.font = m.normalFont
end if
if iconVisible
m.iconNode.blendColor = m.top.iconColor
end if
m.backgroundNode.blendColor = m.top.backgroundColor
end if
end function
function OnkeyEvent(key as string, press as boolean) as boolean
if not press
return false
end if
if key = "OK"
disabled = m.top.disabled
if not disabled
m.top.buttonSelected = true
end if
return true
end if
return false
end function
@@ -0,0 +1,60 @@
<component name="ButtonEx" extends="Group">
<interface>
<field id="text" type="string" alias="label.text" onChange="DoLayout" />
<field id="textVisible" type="boolean" alias="label.visible" onChange="DoLayout" />
<field id="textColor" type="color" value="#DDDDDD" />
<field id="focusedTextColor" type="color" value="#262626" />
<field id="disabledTextColor" type="color" value="#606060" />
<field id="normalFontSize" type="integer" alias="normalFont.size" onChange="DoLayout" />
<field id="boldFontSize" type="integer" alias="boldFont.size" onChange="DoLayout" />
<field id="iconTextSpacing" type="float" value="10" onChange="DoLayout" />
<field id="iconUri" type="uri" alias="icon.uri" />
<field id="iconVisible" type="boolean" alias="icon.visible" onChange="DoLayout" />
<field id="iconWidth" type="float" alias="icon.width" value="42" onChange="DoLayout" />
<field id="iconHeight" type="float" alias="icon.height" value="42" onChange="DoLayout" />
<field id="iconColor" type="color" value="#DDDDDD" />
<field id="focusedIconColor" type="color" value="#262626" />
<field id="disabledIconColor" type="color" value="#606060" />
<field id="backgroundColor" type="color" value="#3C3C3C" />
<field id="focusedBackgroundColor" type="color" value="#DDDDDD" />
<field id="disabledBackgroundColor" type="color" value="#292929" />
<field id="width" type="float" alias="background.width" onChange="DoLayout" />
<field id="minWidth" type="float" onChange="DoLayout" />
<field id="height" type="float" alias="background.height" onChange="DoLayout" value="58" />
<field id="padding" type="vector2d" value="[20,20]" onChange="DoLayout" />
<field id="anchor" type="vector2d" onChange="OnAnchorChange" />
<field id="disabled" type="boolean" onChange="OnDisabledChange" />
<field id="buttonSelected" type="boolean" alwaysNotify="true" />
<field id="buttonFocused" type="boolean" onChange="OnButtonFocused" />
</interface>
<children>
<Font id="normalFont" uri="font:SystemFontFile" size="24" />
<Font id="boldFont" uri="font:BoldSystemFontFile" size="24" />
<Group id="anchor">
<Poster
id="background"
uri="pkg:/images/button-ex.9.png">
<Poster id="icon" />
<Label
id="label"
horizAlign="center"
vertAlign="center" />
</Poster>
</Group>
<Animation
id="focusAnimation"
optional="true"
duration="0.15">
<Vector2DFieldInterpolator
id="scale"
key="[ 0.0, 0.5, 1.0 ]"
keyValue="[ [ 1.0, 1.0 ], [ 1.05, 1.05 ], [ 1.0, 1.0 ] ]"
fieldToInterp="anchor.scale" />
</Animation>
</children>
</component>
@@ -1,8 +1,11 @@
import "pkg:/components/ContextMenu/ContextMenuUtils.bs"
import "pkg:/components/Dialog/DialogUtils.bs"
import "pkg:/components/Navigation/Navigation.bs" import "pkg:/components/Navigation/Navigation.bs"
import "pkg:/source/AsyncTask/AsyncTask.bs" import "pkg:/source/AsyncTask/AsyncTask.bs"
import "pkg:/source/AsyncTask/Tasks.bs" import "pkg:/source/AsyncTask/Tasks.bs"
import "pkg:/source/utils/DisposableObserve.bs" import "pkg:/source/utils/DisposableObserve.bs"
import "pkg:/source/utils/FocusManagement.bs" import "pkg:/source/utils/FocusManagement.bs"
import "pkg:/source/utils/Locale.bs"
import "pkg:/source/utils/Logging.bs" import "pkg:/source/utils/Logging.bs"
import "pkg:/source/utils/StringUtils.bs" import "pkg:/source/utils/StringUtils.bs"
import "pkg:/source/utils/Types.bs" import "pkg:/source/utils/Types.bs"
@@ -27,6 +30,7 @@ function Init()
m.authorId = "" m.authorId = ""
InitializeTabs() InitializeTabs()
InitializeSortOptions()
end function end function
function OnNodeready() function OnNodeready()
@@ -35,7 +39,7 @@ function OnNodeready()
SetNavigation(m.rowList, "up", m.subscribeButton) SetNavigation(m.rowList, "up", m.subscribeButton)
SetNavigation(m.subscribeButton, "down", m.rowList) SetNavigation(m.subscribeButton, "down", m.rowList)
m.subscribeButton.text = "Subscribe" m.subscribeButton.text = Tr(Locale.Buttons.Subscribe)
DisposableObserveFieldScoped(m.subscribeButton, "buttonSelected", FuncName(OnSubscribeButtonSelected)) DisposableObserveFieldScoped(m.subscribeButton, "buttonSelected", FuncName(OnSubscribeButtonSelected))
SetSubscribeButtonVisibility() SetSubscribeButtonVisibility()
@@ -172,25 +176,51 @@ end function
function InitializeTabs() function InitializeTabs()
m.tabs = { m.tabs = {
videos: function(authorId as string, author as string) as object "videos": function(authorId as string, author as string) as object
return CreateChannelFeed("Latest videos", "channel_videos", authorId, author) return CreateChannelFeed("Videos", "channel_videos", authorId, author)
end function end function
shorts: function(authorId as string, author as string) as object "shorts": function(authorId as string, author as string) as object
return CreateChannelFeed("Shorts", "channel_shorts", authorId, author) return CreateChannelFeed("Shorts", "channel_shorts", authorId, author)
end function end function
streams: function(authorId as string, author as string) as object "streams": function(authorId as string, author as string) as object
return CreateChannelFeed("Live", "channel_streams", authorId, author) return CreateChannelFeed("Live", "channel_streams", authorId, author)
end function end function
podcasts: function(authorId as string, author as string) as object "releases": function(authorId as string, author as string) as object
return CreateChannelFeed("Releases", "channel_releases", authorId, author)
end function
"podcasts": function(authorId as string, author as string) as object
return CreateChannelFeed("Podcasts", "channel_podcasts", authorId, author) return CreateChannelFeed("Podcasts", "channel_podcasts", authorId, author)
end function end function
playlists: function(authorId as string, author as string) as object "playlists": function(authorId as string, author as string) as object
return CreateChannelFeed("Playlists", "channel_playlists", authorId, author) return CreateChannelFeed("Playlists", "channel_playlists", authorId, author)
end function end function
} }
end function end function
function InitializeSortOptions()
m.sortOptions = {
"channel_videos": [{
"id": "newest"
"title": "Latest"
}, {
"id": "popular"
"title": "Popular"
}, {
"id": "oldest"
"title": "Oldest"
}]
"channel_playlists": [{
"id": "newest"
"title": "Date added (newest)"
}, {
"id": "last"
"title": "Last video added"
}]
}
end function
function CreateChannelFeed(title as string, endpoint as string, ucid as string, author as string) as object function CreateChannelFeed(title as string, endpoint as string, ucid as string, author as string) as object
title = Tr(title)
return { return {
title: title title: title
feedSources: [{ feedSources: [{
@@ -209,7 +239,32 @@ function GetContextMenuOptionsForItem(video as object) as object
if StringUtils.IsNullOrEmpty(m.top.authorId) if StringUtils.IsNullOrEmpty(m.top.authorId)
return [] return []
end if end if
return m.bookmarks@.GetMenuForChannel(m.top.content) options = m.bookmarksService@.GetMenuForChannel(m.top.content)
options.Append(GetSortingContextMenuOptionsForItem(video))
return options
end function
function GetSortingContextMenuOptionsForItem(video as object) as object
feedContentNode = video.getParent()
if feedContentNode = invalid or not feedContentNode.hasField("feedSources")
return []
end if
feedSources = feedContentNode.feedSources
if feedSources = invalid or feedSources.Count() = 0
return []
end if
feedSource = feedSources[0]
endpoint = feedSource.endpoint
if not m.sortOptions.DoesExist(endpoint)
return []
end if
title = Tr(Locale.Dialogs.SortFeedBy).replace("%1", `"${feedSource.title}"`)
sortOptions = m.sortOptions[endpoint]
return [ContextMenuUtils.CreateOption(title + "...", m.top, "ShowSortDialog", [title, sortOptions, feedContentNode])]
end function end function
function IsLoggedIn() as boolean function IsLoggedIn() as boolean
@@ -238,10 +293,10 @@ function OnAuthorIdChange()
end function end function
function SetSubscribeButtonVisibility() function SetSubscribeButtonVisibility()
isLogged = IsLoggedIn() isEnabled = IsLoggedIn() and not StringUtils.IsNullOrEmpty(m.top.authorId)
m.subscribeButton.visible = isLogged and not StringUtils.IsNullOrEmpty(m.top.authorId) m.subscribeButton.visible = isEnabled
m.subscribeButton.focusable = m.subscribeButton.visible m.subscribeButton.focusable = isEnabled
if not m.subscribeButton.visible and m.subscribeButton.hasFocus() if not isEnabled and m.subscribeButton.hasFocus()
NodeSetFocus(m.rowList, true) NodeSetFocus(m.rowList, true)
end if end if
end function end function
@@ -249,8 +304,56 @@ end function
function OnSubscriptionChanged() function OnSubscriptionChanged()
isSubbed = IsSubscribed() isSubbed = IsSubscribed()
if isSubbed if isSubbed
m.subscribeButton.text = "Unsubscribe" m.subscribeButton.text = Tr(Locale.Buttons.Unsubscribe)
else else
m.subscribeButton.text = "Subscribe" m.subscribeButton.text = Tr(Locale.Buttons.Subscribe)
end if end if
end function end function
function ShowSortDialog(title as string, sortOptions as object, feedContentNode as object)
buttons = []
for i = 0 to sortOptions.Count() - 1
buttons.Push(Tr(sortOptions[i].title))
end for
dialog = DialogUtils.ShowDialogButtons("", title, buttons)
dialog.addFields({
"feedContentNode": feedContentNode
"sortOptions": sortOptions
})
dialog.observeField("buttonSelected", FuncName(OnSortDialogResult), ["buttonSelected"])
end function
function OnSortDialogResult(event as object) as void
dialog = event.getRoSGNode()
sortOptions = dialog.sortOptions
buttonIndex = event.GetData()
if not IsInt(buttonIndex) or buttonIndex < 0 or buttonIndex >= sortOptions.Count()
return
end if
selected = sortOptions[buttonIndex]
feedContentNode = dialog.feedContentNode
feedSources = feedContentNode.feedSources
if feedSources = invalid or feedSources.Count() = 0
return
end if
selectedFeedSource = feedSources[0]
currentFeeds = m.rowList.feeds
for i = 0 to currentFeeds.Count() - 1
feed = currentFeeds[i]
feedSource = feed.feedSources[0]
if feedSource.id = selectedFeedSource.id
if feedSource.queryParams = invalid
feedSource.queryParams = {}
end if
feedSource.queryParams["sort_by"] = selected.id
m.rowList.feeds = currentFeeds
return
end if
end for
end function
@@ -4,7 +4,8 @@
<field id="authorId" type="string" onChange="OnAuthorIdChange" /> <field id="authorId" type="string" onChange="OnAuthorIdChange" />
<field id="appController" type="node" bind="/AppController" /> <field id="appController" type="node" bind="/AppController" />
<field id="invidious" type="node" bind="/Invidious" /> <field id="invidious" type="node" bind="/Invidious" />
<field id="bookmarks" type="node" bind="/Bookmarks" /> <field id="bookmarksService" type="node" bind="/BookmarksService" />
<function name="ShowSortDialog" />
</interface> </interface>
<children> <children>
<Rectangle <Rectangle
@@ -23,6 +24,7 @@
translation="[115,20]" translation="[115,20]"
width="104" width="104"
height="104" height="104"
blendColor="#DDDDDDFF"
uri="pkg:/images/white-circle.png"> uri="pkg:/images/white-circle.png">
<CirclePoster <CirclePoster
@@ -42,13 +44,12 @@
font="font:SmallestSystemFont" /> font="font:SmallestSystemFont" />
</Poster> </Poster>
<Button <ButtonEx
id="subscribeButton" id="subscribeButton"
iconUri="" iconVisible="false"
focusedIconUri="" anchor="[0.5,0.5]"
showFocusFootprint="true" padding="[30,30]"
minWidth="200" translation="[1050,90]" />
translation="[930,64]" />
<VideoRowList <VideoRowList
itemComponentName="RowCell" itemComponentName="RowCell"
@@ -3,6 +3,7 @@ import "pkg:/components/VideoFeed/FeedLoadState.bs"
import "pkg:/source/AsyncTask/AsyncTask.bs" import "pkg:/source/AsyncTask/AsyncTask.bs"
import "pkg:/source/AsyncTask/Tasks.bs" import "pkg:/source/AsyncTask/Tasks.bs"
import "pkg:/source/utils/ErrorUtils.bs" import "pkg:/source/utils/ErrorUtils.bs"
import "pkg:/source/utils/Locale.bs"
import "pkg:/source/utils/Logging.bs" import "pkg:/source/utils/Logging.bs"
function LoadChannel(invidiousNode as object) as void function LoadChannel(invidiousNode as object) as void
@@ -39,8 +40,8 @@ function OnChannelContentTaskResult(output as object) as void
error = ErrorUtils.Format(error) error = ErrorUtils.Format(error)
LogError(error) LogError(error)
authorId = output.task.input.content.authorId authorId = output.task.input.content.authorId
message = `Failed to load channel ${authorId}\n${error}` message = Tr(Locale.Dialogs.FailedToLoadChannel).Replace("%1", authorId) + `\n${error}`
DialogUtils.ShowDialog(message, "Channel load fail", true) DialogUtils.ShowDialog(message, Tr(Locale.Dialogs.ChannelLoadError), true)
return return
end if end if
end function end function
@@ -3,6 +3,7 @@ import "pkg:/components/VideoFeed/FeedLoadState.bs"
import "pkg:/source/AsyncTask/AsyncTask.bs" import "pkg:/source/AsyncTask/AsyncTask.bs"
import "pkg:/source/AsyncTask/Tasks.bs" import "pkg:/source/AsyncTask/Tasks.bs"
import "pkg:/source/utils/ErrorUtils.bs" import "pkg:/source/utils/ErrorUtils.bs"
import "pkg:/source/utils/Locale.bs"
import "pkg:/source/utils/Logging.bs" import "pkg:/source/utils/Logging.bs"
function LoadPlaylistPage(invidiousNode as object) as void function LoadPlaylistPage(invidiousNode as object) as void
@@ -48,8 +49,8 @@ function OnPlaylistContentTaskResult(output as object) as void
error = ErrorUtils.Format(error) error = ErrorUtils.Format(error)
LogError(error) LogError(error)
playlistId = output.task.input.content.playlistId playlistId = output.task.input.content.playlistId
message = `Failed to load playlist ${playlistId}\n${error}` message = Tr(Locale.Dialogs.FailedToLoadPlaylist).Replace("%1", playlistId) + `\n${error}`
DialogUtils.ShowDialog(message, "Playlist load fail", true) DialogUtils.ShowDialog(message, Tr(Locale.Dialogs.PlaylistLoadError), true)
return return
end if end if
end function end function
@@ -14,7 +14,7 @@ function OnItemHasFocus()
m.top.color = "#262626ff" m.top.color = "#262626ff"
else else
m.top.font = "font:SmallestSystemFont" m.top.font = "font:SmallestSystemFont"
m.top.color = "#DBDBDBFF" m.top.color = "#EBEBEBFF"
end if end if
end function end function
@@ -24,6 +24,6 @@ function OnFocusPercent()
m.top.color = "#262626FF" m.top.color = "#262626FF"
else else
m.top.font = "font:SmallestSystemFont" m.top.font = "font:SmallestSystemFont"
m.top.color = "#DBDBDBFF" m.top.color = "#EBEBEBFF"
end if end if
end function end function
@@ -4,9 +4,9 @@ function SetPalette(dialog as object)
DialogBackgroundColor: "#242424FF" DialogBackgroundColor: "#242424FF"
DialogFocusColor: "#CECECEFF" DialogFocusColor: "#CECECEFF"
DialogFocusItemColor: "#202020FF" DialogFocusItemColor: "#202020FF"
DialogSecondaryTextColor: "#DBDBDBFF" DialogSecondaryTextColor: "#EBEBEBFF"
DialogSecondaryItemColor: "#FF1C30FF" DialogSecondaryItemColor: "#FF1C30FF"
DialogTextColor: "#DBDBDBFF" DialogTextColor: "#EBEBEBFF"
} }
dialog.palette = palette dialog.palette = palette
end function end function
@@ -1,6 +1,8 @@
import "pkg:/source/utils/Locale.bs"
namespace DialogUtils namespace DialogUtils
function ShowDialog(message as dynamic, title as string, large = false as boolean) as object function ShowDialog(message as dynamic, title as string, large = false as boolean) as object
return ShowDialogButtons(message, title, ["Ok"], large) return ShowDialogButtons(message, title, [Tr(Locale.Buttons.OK)], large)
end function end function
function ShowDialogButtons(message as dynamic, title as string, buttons as object, large = false as boolean) as object function ShowDialogButtons(message as dynamic, title as string, buttons as object, large = false as boolean) as object
@@ -47,6 +49,8 @@ namespace DialogUtils
m.top.getScene().dialog = dialog m.top.getScene().dialog = dialog
dialog.focusDefaultButton = true
return dialog return dialog
end function end function
end namespace end namespace
@@ -1,4 +1,5 @@
import "DialogPalette.bs" import "DialogPalette.bs"
import "pkg:/source/utils/Locale.bs"
import "pkg:/source/utils/StringUtils.bs" import "pkg:/source/utils/StringUtils.bs"
import "pkg:/source/utils/Types.bs" import "pkg:/source/utils/Types.bs"
@@ -9,6 +10,9 @@ function Init()
m.top.width = "920" m.top.width = "920"
m.top.observeFieldScoped("buttonSelected", FuncName(Close)) m.top.observeFieldScoped("buttonSelected", FuncName(Close))
scanLabel = m.top.findNode("scanLabel")
scanLabel.text = Tr(Locale.Dialogs.ScanTheQrCode)
end function end function
function OnNodeReady() function OnNodeReady()
@@ -17,7 +21,7 @@ function OnNodeReady()
if isValidAddress if isValidAddress
m.top.url = `${address}/invidious/login` m.top.url = `${address}/invidious/login`
else else
m.urlLabel.text = "No IP address found" m.urlLabel.text = Tr(Locale.Dialogs.IpAddressNotAvailable)
end if end if
m.invidious.observeFieldScoped("authToken", FuncName(OnAuthTokenChange)) m.invidious.observeFieldScoped("authToken", FuncName(OnAuthTokenChange))
@@ -7,8 +7,8 @@
<children> <children>
<StdDlgTitleArea primaryTitle="Login to Invidious" /> <StdDlgTitleArea primaryTitle="Login to Invidious" />
<StdDlgContentArea> <StdDlgContentArea>
<StdDlgTextItem <StdDlgTextItem text="Login to Invidious in order to view Subscriptions, Playlists, and use the Watch history." />
text="Login to Invidious in order to view Subscriptions, Playlists, and use the Watch history.&#xA;&#xA;Please note that an Invidious account is different from a YouTube account." /> <StdDlgTextItem text="Please note that an Invidious account is different from a YouTube account." />
</StdDlgContentArea> </StdDlgContentArea>
<StdDlgButtonArea id="buttonArea"> <StdDlgButtonArea id="buttonArea">
<StdDlgButton text="OK" /> <StdDlgButton text="OK" />
@@ -20,6 +20,7 @@
extendToDialogEdge="false" extendToDialogEdge="false"
showDivider="false"> showDivider="false">
<Label <Label
id="scanLabel"
text="Scan the QR Code" text="Scan the QR Code"
horizAlign="center" horizAlign="center"
wrap="true" width="400"> wrap="true" width="400">
@@ -1,4 +1,5 @@
import "DialogPalette.bs" import "DialogPalette.bs"
import "pkg:/source/utils/FocusManagement.bs"
import "pkg:/source/utils/Logging.bs" import "pkg:/source/utils/Logging.bs"
import "pkg:/source/utils/Types.bs" import "pkg:/source/utils/Types.bs"
@@ -29,6 +30,21 @@ function OnStartCountdown()
m.timer.observeFieldScoped("fire", FuncName(TimerUpdateButtons)) m.timer.observeFieldScoped("fire", FuncName(TimerUpdateButtons))
m.currentCountDown = defaultActionTimeoutSeconds m.currentCountDown = defaultActionTimeoutSeconds
m.timer.control = "start" m.timer.control = "start"
FindButtonComponent()
end function
function OnFocusDefaultButton() as void
FindButtonComponent()
if m.buttonComponents = invalid
return
end if
defaultButtonIndex = m.top.defaultButtonIndex
if m.buttonComponents.Count() <= defaultButtonIndex
return
end if
button = m.buttonComponents[defaultButtonIndex]
NodeSetFocus(button, true)
end function end function
function TimerUpdateButtons() as void function TimerUpdateButtons() as void
@@ -39,13 +55,7 @@ function TimerUpdateButtons() as void
return return
end if end if
FindButtonComponents() SetDefaultButtonText(m.currentCountDown)
if m.buttonComponents = invalid
return
end if
defaultButtonIndex = m.top.defaultButtonIndex
m.buttonComponents[defaultButtonIndex].text = `${m.top.actualButtons[defaultButtonIndex]} (${m.currentCountDown})`
end function end function
function OnButtonSelected() function OnButtonSelected()
@@ -64,13 +74,8 @@ function onKeyEvent(key as string, press as boolean) as boolean
CancelTimer() CancelTimer()
FindButtonComponents() FindButtonComponent()
if m.buttonComponents = invalid SetDefaultButtonText(0)
return false
end if
defaultButtonIndex = m.top.defaultButtonIndex
m.buttonComponents[defaultButtonIndex].text = m.top.actualButtons[defaultButtonIndex]
return false return false
end function end function
@@ -82,7 +87,21 @@ function CancelTimer()
end if end if
end function end function
function FindButtonComponents() as void function SetDefaultButtonText(timeLeft as integer) as void
if m.buttonComponents = invalid
return
end if
defaultButtonIndex = m.top.defaultButtonIndex
if timeLeft > 0
m.buttonComponents[defaultButtonIndex].text = `${m.top.actualButtons[defaultButtonIndex]} (${timeLeft})`
else
m.buttonComponents[defaultButtonIndex].text = m.top.actualButtons[defaultButtonIndex]
end if
end function
function FindButtonComponent() as void
if m.buttonComponents <> invalid if m.buttonComponents <> invalid
return return
end if end if
@@ -6,5 +6,6 @@
<!-- Use actualButtonSelected because buttonSelected is read only and defaults to 0 --> <!-- Use actualButtonSelected because buttonSelected is read only and defaults to 0 -->
<field id="actualButtonSelected" type="integer" value="-1" /> <field id="actualButtonSelected" type="integer" value="-1" />
<field id="startCountdown" type="boolean" alwaysNotify="true" onChange="OnStartCountdown" /> <field id="startCountdown" type="boolean" alwaysNotify="true" onChange="OnStartCountdown" />
<field id="focusDefaultButton" type="boolean" alwaysNotify="true" onChange="OnFocusDefaultButton" />
</interface> </interface>
</component> </component>
+2 -4
View File
@@ -29,10 +29,8 @@ function ProcessArguments(args as object) as void
return return
end if end if
if not StringUtils.IsNullOrEmpty(args.contentId) and args.mediaType = "video" if not StringUtils.IsNullOrEmpty(args.contentId) and StringUtils.IsNullOrEmpty(args.videoId)
if StringUtils.IsNullOrEmpty(args.videoId) args.videoId = args.contentId
args.videoId = args.contentId
end if
end if end if
if args.timestamp <> invalid if args.timestamp <> invalid
+38 -6
View File
@@ -39,6 +39,7 @@ function LoggerLoop()
logsFile = m.top.folder + "/" + m.top.filename logsFile = m.top.folder + "/" + m.top.filename
previousLogsFile = m.top.folder + "/" + m.top.filenamePrevious previousLogsFile = m.top.folder + "/" + m.top.filenamePrevious
filenameStartup = m.top.filenameStartup filenameStartup = m.top.filenameStartup
dateTime = CreateObject("roDateTime")
CreateDirectory(m.top.folder) CreateDirectory(m.top.folder)
DeleteFile(previousLogsFile) DeleteFile(previousLogsFile)
@@ -59,16 +60,16 @@ function LoggerLoop()
if msgType = "roSGNodeEvent" if msgType = "roSGNodeEvent"
field = msg.getField() field = msg.getField()
if field = "logLine" if field = "logLine"
OnLineLog(msg, logsFile, buffer) OnLineLog(msg, dateTime, logsFile, buffer)
else if field = "systemLogEvent" else if field = "systemLogEvent"
OnLineSysLog(msg, logsFile, buffer) OnLineSysLog(msg, dateTime, logsFile, buffer)
end if end if
end if end if
end while end while
end function end function
function OnLineLog(event as object, logsFile as string, buffer as object) function OnLineLog(event as object, dateTime as object, logsFile as string, buffer as object)
line = event.getData() line = FormatTime(dateTime) + event.getData()
' bs:disable-next-line LINT3012 ' bs:disable-next-line LINT3012
print line print line
@@ -76,15 +77,46 @@ function OnLineLog(event as object, logsFile as string, buffer as object)
buffer.AppendFile(logsFile) buffer.AppendFile(logsFile)
end function end function
function OnLineSysLog(event as object, logsFile as string, buffer as object) as void function OnLineSysLog(event as object, dateTime as object, logsFile as string, buffer as object) as void
info = event.getData() info = event.getData()
if info.LogType <> "http.error" if info.LogType <> "http.error"
return return
end if end if
line = "[ERROR][SysLog] " + ToString(info) line = FormatTime(dateTime) + "[ERROR][SysLog] " + ToString(info)
' bs:disable-next-line LINT3012 ' bs:disable-next-line LINT3012
print line print line
buffer.FromAsciiString(line + `\n`) buffer.FromAsciiString(line + `\n`)
buffer.AppendFile(logsFile) buffer.AppendFile(logsFile)
end function end function
' Note: although the timestamp should be captured in the caller, not the logger,
' it is done here to avoid adding overhead to the caller thread.
function FormatTime(dateTime as object) as string
dateTime.Mark()
dateTime.ToLocalTime()
hours = dateTime.GetHours().ToStr()
if hours.Len() = 1
hours = "0" + hours
end if
minutes = dateTime.GetMinutes().ToStr()
if minutes.Len() = 1
minutes = "0" + minutes
end if
seconds = dateTime.GetSeconds().ToStr()
if seconds.Len() = 1
seconds = "0" + seconds
end if
milliseconds = dateTime.GetMilliseconds().ToStr()
if milliseconds.Len() = 1
milliseconds = "00" + milliseconds
else if milliseconds.Len() = 2
milliseconds = "0" + milliseconds
end if
return "[" + hours + ":" + minutes + ":" + seconds + "." + milliseconds + "]"
end function
@@ -40,9 +40,9 @@
<VideoQueue id="VideoQueue" /> <VideoQueue id="VideoQueue" />
<ApplicationInfo id="ApplicationInfo" /> <ApplicationInfo id="ApplicationInfo" />
<Preferences id="Preferences" /> <Preferences id="Preferences" />
<Bookmarks id="Bookmarks" /> <BookmarksService id="BookmarksService" />
<SearchHistory id="SearchHistory" /> <SearchHistory id="SearchHistory" />
<Profiles id="Profiles" /> <ProfilesService id="ProfilesService" />
<Invidious id="Invidious" /> <Invidious id="Invidious" />
<PlayletWebServer id="WebServer" port="8888" /> <PlayletWebServer id="WebServer" port="8888" />
<DialServer id="DialServer" /> <DialServer id="DialServer" />
+5 -5
View File
@@ -66,18 +66,18 @@
<ApplicationInfo id="ApplicationInfo" /> <ApplicationInfo id="ApplicationInfo" />
<Preferences id="Preferences" /> <Preferences id="Preferences" />
<Bookmarks id="Bookmarks" /> <BookmarksService id="BookmarksService" />
<SearchHistory id="SearchHistory" <SearchHistory id="SearchHistory"
preferences="bind:../Preferences" /> preferences="bind:../Preferences" />
<Profiles id="Profiles" <ProfilesService id="ProfilesService"
invidious="bind:../Invidious" /> invidious="bind:../Invidious" />
<Invidious id="Invidious" <Invidious id="Invidious"
webServer="bind:../WebServer" webServer="bind:../WebServer"
applicationInfo="bind:../ApplicationInfo" applicationInfo="bind:../ApplicationInfo"
preferences="bind:../Preferences" preferences="bind:../Preferences"
profiles="bind:../Profiles" /> profilesService="bind:../ProfilesService" />
<!-- Tasks --> <!-- Tasks -->
<PlayletWebServer id="WebServer" <PlayletWebServer id="WebServer"
@@ -85,10 +85,10 @@
appController="bind:/AppController" appController="bind:/AppController"
applicationInfo="bind:../ApplicationInfo" applicationInfo="bind:../ApplicationInfo"
invidious="bind:../Invidious" invidious="bind:../Invidious"
profiles="bind:../Profiles" profilesService="bind:../ProfilesService"
preferences="bind:../Preferences" preferences="bind:../Preferences"
videoQueue="bind:../VideoQueue" videoQueue="bind:../VideoQueue"
bookmarks="bind:../Bookmarks" bookmarksService="bind:../BookmarksService"
loungeService="bind:../LoungeService" /> loungeService="bind:../LoungeService" />
<DialServer id="DialServer" <DialServer id="DialServer"
webServer="bind:../WebServer" webServer="bind:../WebServer"
@@ -24,23 +24,23 @@ function InitializeBindings()
"SearchHistory": { "SearchHistory": {
"preferences": "../Preferences" "preferences": "../Preferences"
}, },
"Profiles": { "ProfilesService": {
"invidious": "../Invidious" "invidious": "../Invidious"
}, },
"Invidious": { "Invidious": {
"webServer": "../WebServer", "webServer": "../WebServer",
"applicationInfo": "../ApplicationInfo", "applicationInfo": "../ApplicationInfo",
"preferences": "../Preferences", "preferences": "../Preferences",
"profiles": "../Profiles" "profilesService": "../ProfilesService"
}, },
"WebServer": { "WebServer": {
"appController": "/AppController", "appController": "/AppController",
"applicationInfo": "../ApplicationInfo", "applicationInfo": "../ApplicationInfo",
"invidious": "../Invidious", "invidious": "../Invidious",
"profiles": "../Profiles", "profilesService": "../ProfilesService",
"preferences": "../Preferences", "preferences": "../Preferences",
"videoQueue": "../VideoQueue", "videoQueue": "../VideoQueue",
"bookmarks": "../Bookmarks", "bookmarksService": "../BookmarksService",
"loungeService": "../LoungeService" "loungeService": "../LoungeService"
}, },
"DialServer": { "DialServer": {
+1 -1
View File
@@ -36,7 +36,7 @@ function PopulateButtons() as void
button.width = 90 button.width = 90
button.icon = item.icon button.icon = item.icon
button.text = item.text button.text = Tr(item.text)
button.padding = item.padding button.padding = item.padding
buttons.push(button) buttons.push(button)
@@ -20,10 +20,10 @@ function Init()
m.top.observeField("width", FuncName(onWidthChanged)) m.top.observeField("width", FuncName(onWidthChanged))
m.top.observeField("padding", FuncName(onPaddingChanged)) m.top.observeField("padding", FuncName(onPaddingChanged))
profiles = m.top.getScene().findNode("Profiles") profilesService = m.top.getScene().findNode("ProfilesService")
if profiles <> invalid if profilesService <> invalid
m.profiles = profiles m.profilesService = profilesService
profiles.observeField("currentProfile", FuncName(OnCurrentProfile)) profilesService.observeField("currentProfile", FuncName(OnCurrentProfile))
OnCurrentProfile() OnCurrentProfile()
end if end if
end function end function
@@ -91,7 +91,7 @@ function onPaddingChanged()
end function end function
function OnCurrentProfile() as void function OnCurrentProfile() as void
currentProfile = m.profiles.currentProfile currentProfile = m.profilesService.currentProfile
if currentProfile = invalid if currentProfile = invalid
m.circlePoster.visible = false m.circlePoster.visible = false
m.buttonIcon.visible = true m.buttonIcon.visible = true
@@ -15,12 +15,13 @@
id="circlePoster" id="circlePoster"
width="40" width="40"
height="40" height="40"
blendColor="#DDDDDDFF"
uri="pkg:/images/white-circle.png"> uri="pkg:/images/white-circle.png">
<Poster <Poster
id="circlePosterInner" id="circlePosterInner"
width="36" width="36"
height="36" height="36"
blendColor="#9696c8" blendColor="#9696C8"
uri="pkg:/images/white-circle.png" uri="pkg:/images/white-circle.png"
translation="[2,2]"> translation="[2,2]">
<Label <Label
@@ -163,10 +163,10 @@ function GetContextMenuOptionsForItem(video as object) as object
end if end if
options = [ options = [
ContextMenuUtils.CreateOption("Play", m.videoQueue, "FuncPlayPlaylist", [playlist, index]), ContextMenuUtils.CreateOption(Tr(Locale.ContextMenu.PlayPlaylist), m.videoQueue, "FuncPlayPlaylist", [playlist, index]),
ContextMenuUtils.CreateOption("Queue", m.videoQueue, "FuncAddToQueuePlaylist", [playlist]) ContextMenuUtils.CreateOption(Tr(Locale.ContextMenu.QueuePlaylist), m.videoQueue, "FuncAddToQueuePlaylist", [playlist])
ContextMenuUtils.CreateOption("Play video", m.videoQueue, "FuncPlayVideo", [video]), ContextMenuUtils.CreateOption(Tr(Locale.ContextMenu.PlayVideo), m.videoQueue, "FuncPlayVideo", [video]),
ContextMenuUtils.CreateOption("Queue video", m.videoQueue, "FuncAddToQueueVideo", [video]), ContextMenuUtils.CreateOption(Tr(Locale.ContextMenu.QueueVideo), m.videoQueue, "FuncAddToQueueVideo", [video]),
] ]
playlistAuthorId = playlist.authorId playlistAuthorId = playlist.authorId
@@ -174,19 +174,19 @@ function GetContextMenuOptionsForItem(video as object) as object
if not StringUtils.IsNullOrEmpty(playlistAuthorId) or not StringUtils.IsNullOrEmpty(videoAuthorId) if not StringUtils.IsNullOrEmpty(playlistAuthorId) or not StringUtils.IsNullOrEmpty(videoAuthorId)
if playlistAuthorId = videoAuthorId if playlistAuthorId = videoAuthorId
options.push(ContextMenuUtils.CreateOption("Open channel", m.top, "OpenPlaylistChannel", [playlist])) options.push(ContextMenuUtils.CreateOption(Tr(Locale.ContextMenu.OpenChannel), m.top, "OpenPlaylistChannel", [playlist]))
else else
if not StringUtils.IsNullOrEmpty(playlistAuthorId) if not StringUtils.IsNullOrEmpty(playlistAuthorId)
options.push(ContextMenuUtils.CreateOption("Open playlist channel", m.top, "OpenPlaylistChannel", [playlist])) options.push(ContextMenuUtils.CreateOption(Tr(Locale.ContextMenu.OpenPlaylistChannel), m.top, "OpenPlaylistChannel", [playlist]))
end if end if
if not StringUtils.IsNullOrEmpty(videoAuthorId) if not StringUtils.IsNullOrEmpty(videoAuthorId)
options.push(ContextMenuUtils.CreateOption("Open video channel", m.top, "OpenVideoChannel", [video])) options.push(ContextMenuUtils.CreateOption(Tr(Locale.ContextMenu.OpenVideoChannel), m.top, "OpenVideoChannel", [video]))
end if end if
end if end if
end if end if
options.append(m.bookmarks@.GetMenuForPlaylist(playlist)) options.append(m.bookmarksService@.GetMenuForPlaylist(playlist))
options.append(m.bookmarks@.GetMenuForVideo(video)) options.append(m.bookmarksService@.GetMenuForVideo(video))
return options return options
end function end function
@@ -4,7 +4,7 @@
<field id="appController" type="node" bind="/AppController" /> <field id="appController" type="node" bind="/AppController" />
<field id="invidious" type="node" bind="/Invidious" /> <field id="invidious" type="node" bind="/Invidious" />
<field id="videoQueue" type="node" bind="/VideoQueue" /> <field id="videoQueue" type="node" bind="/VideoQueue" />
<field id="bookmarks" type="node" bind="/Bookmarks" /> <field id="bookmarksService" type="node" bind="/BookmarksService" />
<function name="OpenPlaylistChannel" /> <function name="OpenPlaylistChannel" />
<function name="OpenVideoChannel" /> <function name="OpenVideoChannel" />
</interface> </interface>
@@ -1,6 +1,7 @@
import "pkg:/components/Navigation/Navigation.bs" import "pkg:/components/Navigation/Navigation.bs"
import "pkg:/source/utils/DisposableObserve.bs" import "pkg:/source/utils/DisposableObserve.bs"
import "pkg:/source/utils/FocusManagement.bs" import "pkg:/source/utils/FocusManagement.bs"
import "pkg:/source/utils/Locale.bs"
import "pkg:/source/utils/StringUtils.bs" import "pkg:/source/utils/StringUtils.bs"
import "pkg:/source/utils/Types.bs" import "pkg:/source/utils/Types.bs"
@@ -8,7 +9,6 @@ function Init()
m.activateButton = m.top.findNode("activateButton") m.activateButton = m.top.findNode("activateButton")
m.logoutButton = m.top.findNode("logoutButton") m.logoutButton = m.top.findNode("logoutButton")
m.closeButton = m.top.findNode("closeButton") m.closeButton = m.top.findNode("closeButton")
m.buttonGroup = m.top.findNode("buttonGroup")
DisposableObserveField(m.activateButton, "buttonSelected", FuncName(Activate)) DisposableObserveField(m.activateButton, "buttonSelected", FuncName(Activate))
DisposableObserveField(m.logoutButton, "buttonSelected", FuncName(Logout)) DisposableObserveField(m.logoutButton, "buttonSelected", FuncName(Logout))
@@ -21,8 +21,8 @@ function OnNodeReady()
SetNavigation(m.closeButton, "up", m.logoutButton) SetNavigation(m.closeButton, "up", m.logoutButton)
SetNavigation(m.logoutButton, "up", m.activateButton) SetNavigation(m.logoutButton, "up", m.activateButton)
DisposableObserveFieldScoped(m.profiles, "currentProfile", FuncName(OnCunrrentProfileChanged)) DisposableObserveFieldScoped(m.profilesService, "currentProfile", FuncName(OnCunrrentProfileChanged))
DisposableObserveFieldScoped(m.profiles, "onProfileLogout", FuncName(OnProfileLogout)) DisposableObserveFieldScoped(m.profilesService, "onProfileLogout", FuncName(OnProfileLogout))
end function end function
function OnContentSet() as void function OnContentSet() as void
@@ -81,13 +81,13 @@ function Activate() as void
return return
end if end if
profile = m.profiles.content.getChild(0).findNode(content.id) profile = m.profilesService.content.getChild(0).findNode(content.id)
if profile = invalid if profile = invalid
return return
end if end if
m.top.content = invalid m.top.content = invalid
m.profiles@.SetCurrentProfile(profile) m.profilesService@.SetCurrentProfile(profile)
Close() Close()
end function end function
@@ -98,7 +98,7 @@ function Logout() as void
end if end if
m.top.content = invalid m.top.content = invalid
m.profiles@.LogoutWithProfile(content) m.profilesService@.LogoutWithProfile(content)
Close() Close()
end function end function
@@ -127,7 +127,7 @@ function OnProfileLogout() as void
return return
end if end if
profile = m.profiles.content.getChild(0).findNode(content.id) profile = m.profilesService.content.getChild(0).findNode(content.id)
if profile = invalid if profile = invalid
Close() Close()
end if end if
@@ -144,17 +144,10 @@ function UpdateActivateButton() as void
if m.activateButton.hasFocus() if m.activateButton.hasFocus()
NodeSetFocus(m.logoutButton, true) NodeSetFocus(m.logoutButton, true)
end if end if
m.activateButton.text = Tr(Locale.Buttons.InUse)
parent = m.activateButton.getParent() m.activateButton.disabled = true
if parent <> invalid
m.buttonGroup.removeChild(m.activateButton)
end if
m.activateButton.focusable = false
else else
parent = m.activateButton.getParent() m.activateButton.text = Tr(Locale.Buttons.Activate)
if parent = invalid m.activateButton.disabled = false
m.buttonGroup.insertChild(m.activateButton, 0)
end if
m.activateButton.focusable = true
end if end if
end function end function
@@ -9,7 +9,7 @@
<field id="crownVisible" type="boolean" alias="CrownPoster.visible" /> <field id="crownVisible" type="boolean" alias="CrownPoster.visible" />
<field id="appController" type="node" bind="/AppController" /> <field id="appController" type="node" bind="/AppController" />
<field id="profiles" type="node" bind="/Profiles" /> <field id="profilesService" type="node" bind="/ProfilesService" />
</interface> </interface>
<children> <children>
<Rectangle <Rectangle
@@ -30,12 +30,13 @@
width="160" width="160"
height="160" height="160"
translation="[20,20]" translation="[20,20]"
blendColor="#DDDDDDFF"
uri="pkg:/images/white-circle.png"> uri="pkg:/images/white-circle.png">
<Poster <Poster
id="circlePosterInner" id="circlePosterInner"
width="152" width="152"
height="152" height="152"
blendColor="#9696c8" blendColor="#9696C8"
uri="pkg:/images/white-circle.png" uri="pkg:/images/white-circle.png"
translation="[4,4]"> translation="[4,4]">
<Label <Label
@@ -72,26 +73,28 @@
</Label> </Label>
</Group> </Group>
<LayoutGroup <ButtonEx
id="buttonGroup" id="activateButton"
translation="[420,94]" iconVisible="false"
itemSpacings="[20,20]"> anchor="[0.5,0.5]"
<Button text="Activate"
id="activateButton" minWidth="200"
text="Activate" translation="[520,132]" />
minWidth="200" <ButtonEx
showFocusFootprint="true" /> id="logoutButton"
<Button iconVisible="false"
id="logoutButton" anchor="[0.5,0.5]"
text="Logout" text="Logout"
minWidth="200" minWidth="200"
showFocusFootprint="true" /> translation="[520,210]" />
<Button <ButtonEx
id="closeButton" id="closeButton"
text="Close" iconVisible="false"
minWidth="200" anchor="[0.5,0.5]"
showFocusFootprint="true" /> text="Close"
</LayoutGroup> minWidth="200"
translation="[520,288]" />
</Rectangle> </Rectangle>
</children> </children>
</component> </component>
@@ -1,6 +1,8 @@
import "pkg:/components/ContextMenu/ContextMenuUtils.bs" import "pkg:/components/ContextMenu/ContextMenuUtils.bs"
import "pkg:/components/Navigation/Navigation.bs" import "pkg:/components/Navigation/Navigation.bs"
import "pkg:/components/Services/BookmarksService/BookmarksServiceUtils.bs"
import "pkg:/source/utils/FocusManagement.bs" import "pkg:/source/utils/FocusManagement.bs"
import "pkg:/source/utils/Locale.bs"
import "pkg:/source/utils/Types.bs" import "pkg:/source/utils/Types.bs"
function Init() function Init()
@@ -20,7 +22,7 @@ function OnNodeReady()
m.rowList@.BindNode() m.rowList@.BindNode()
OnBookmarksChange() OnBookmarksChange()
m.bookmarks.ObserveField("contentChange", FuncName(OnBookmarksChange)) m.bookmarksService.ObserveField("contentChange", FuncName(OnBookmarksChange))
end function end function
function OnFocusChange() as void function OnFocusChange() as void
@@ -53,13 +55,13 @@ function OnBookmarksChange() as void
end if end if
m.isDirty = false m.isDirty = false
hasBookmarks = m.bookmarks.content.getChildCount() > 0 hasBookmarks = m.bookmarksService.content.getChildCount() > 0
m.noBookmarks.visible = not hasBookmarks m.noBookmarks.visible = not hasBookmarks
m.yesBookmarks.visible = hasBookmarks m.yesBookmarks.visible = hasBookmarks
m.top.focusable = hasBookmarks m.top.focusable = hasBookmarks
if hasBookmarks if hasBookmarks
SetRowListContent(m.bookmarks.content) SetRowListContent(m.bookmarksService.content)
else else
if m.rowList.hasFocus() if m.rowList.hasFocus()
NodeSetFocus(m.navBar, true) NodeSetFocus(m.navBar, true)
@@ -68,23 +70,7 @@ function OnBookmarksChange() as void
end function end function
function SetRowListContent(bookmarksContent as object) function SetRowListContent(bookmarksContent as object)
bookmarkGroupNodes = bookmarksContent.getChildren(-1, 0) m.rowList.feeds = BookmarksServiceUtils.BookmarksContentToFeed(bookmarksContent)
feeds = []
for each bookmarkGroupNode in bookmarkGroupNodes
bookmarkNodes = bookmarkGroupNode.getChildren(-1, 0)
feedSources = []
for each bookmarkNode in bookmarkNodes
feedSources.push(bookmarkNode.feedSource)
end for
feeds.push({
"title": bookmarkGroupNode.title
"feedSources": feedSources
})
end for
m.rowList.feeds = feeds
end function end function
function OnkeyEvent(key as string, press as boolean) as boolean function OnkeyEvent(key as string, press as boolean) as boolean
@@ -95,6 +81,6 @@ function OnkeyEvent(key as string, press as boolean) as boolean
end function end function
function GetContextMenuOptionsForItem(rowItem as object) as object function GetContextMenuOptionsForItem(rowItem as object) as object
refreshItem = ContextMenuUtils.CreateOption("Refresh Bookmarks", m.top, "Refresh", [invalid]) refreshItem = ContextMenuUtils.CreateOption(Tr(Locale.ContextMenu.RefreshBookmarks), m.top, "Refresh", [invalid])
return [refreshItem] return [refreshItem]
end function end function
@@ -2,19 +2,31 @@
<interface> <interface>
<field id="navBar" type="node" bind="/NavBar" /> <field id="navBar" type="node" bind="/NavBar" />
<field id="applicationInfo" type="node" bind="/ApplicationInfo" /> <field id="applicationInfo" type="node" bind="/ApplicationInfo" />
<field id="bookmarks" type="node" bind="/Bookmarks" /> <field id="bookmarksService" type="node" bind="/BookmarksService" />
<function name="Refresh" /> <function name="Refresh" />
</interface> </interface>
<children> <children>
<Group id="noBookmarks" visible="false"> <Group id="noBookmarks" visible="false">
<Label <LayoutGroup vertAlignment="center" itemSpacings="[25,25]" translation="[180,360]">
height="720" <Label
width="1280" width="920"
font="font:MediumBoldSystemFont" horizAlign="center"
horizAlign="center" font="font:SmallSystemFont"
vertAlign="center" text="You currently have no bookmarks."
text="You currently have no bookmarks.&#xA;&#xA;To add bookmarks, long-press 'OK' on a video, playlist or channel.&#xA;&#xA;Please note that Bookmarks is an experimental feature." wrap="true" />
wrap="true" /> <Label
width="920"
horizAlign="center"
font="font:SmallSystemFont"
text="To add bookmarks, long-press 'OK' on a video, playlist or channel."
wrap="true" />
<Label
width="920"
horizAlign="center"
font="font:SmallSystemFont"
text="Please note that Bookmarks is an experimental feature."
wrap="true" />
</LayoutGroup>
</Group> </Group>
<Group id="yesBookmarks" visible="false"> <Group id="yesBookmarks" visible="false">
<VideoRowList <VideoRowList
@@ -2,6 +2,7 @@ import "HomeScreenUtils.bs"
import "pkg:/components/ContextMenu/ContextMenuUtils.bs" import "pkg:/components/ContextMenu/ContextMenuUtils.bs"
import "pkg:/components/Navigation/Navigation.bs" import "pkg:/components/Navigation/Navigation.bs"
import "pkg:/source/utils/FocusManagement.bs" import "pkg:/source/utils/FocusManagement.bs"
import "pkg:/source/utils/Locale.bs"
function Init() function Init()
m.top.focusable = true m.top.focusable = true
@@ -41,6 +42,6 @@ function OnkeyEvent(key as string, press as boolean) as boolean
end function end function
function GetContextMenuOptionsForItem(rowItem as object) as object function GetContextMenuOptionsForItem(rowItem as object) as object
refresh = ContextMenuUtils.CreateOption("Refresh Home", m.rowList, "Refresh", [invalid]) refresh = ContextMenuUtils.CreateOption(Tr(Locale.ContextMenu.RefreshHome), m.rowList, "Refresh", [invalid])
return [refresh] return [refresh]
end function end function
@@ -4,6 +4,13 @@ namespace HomeScreenUtils
function GetFeed(feedFileName as string, preferences as object) as object function GetFeed(feedFileName as string, preferences as object) as object
feed = ParseJson(ReadAsciiFile(feedFileName)) feed = ParseJson(ReadAsciiFile(feedFileName))
for each item in feed
item.title = Tr(item.title)
for each feedSource in item.feedSources
feedSource.title = Tr(feedSource.title)
end for
end for
homeLayout = preferences["misc.home_screen_layout"] homeLayout = preferences["misc.home_screen_layout"]
if not IsArray(homeLayout) or homeLayout.Count() = 0 if not IsArray(homeLayout) or homeLayout.Count() = 0
@@ -1,3 +1,4 @@
import "pkg:/source/utils/Locale.bs"
import "pkg:/source/utils/StringUtils.bs" import "pkg:/source/utils/StringUtils.bs"
function Init() function Init()
@@ -16,7 +17,7 @@ function OnContentSet() as void
' bs:disable-next-line LINT3023 ' bs:disable-next-line LINT3023
m.top.circlePosterInnerBlendColor = "#FFFFFFFF" m.top.circlePosterInnerBlendColor = "#FFFFFFFF"
m.top.letter = "" m.top.letter = ""
m.top.username = "Login" m.top.username = Tr(Locale.Buttons.Login)
m.top.serverUrl = "" m.top.serverUrl = ""
m.top.crownVisible = false m.top.crownVisible = false
return return
@@ -43,12 +43,13 @@
width="160" width="160"
height="160" height="160"
translation="[20,20]" translation="[20,20]"
blendColor="#DDDDDDFF"
uri="pkg:/images/white-circle.png"> uri="pkg:/images/white-circle.png">
<Poster <Poster
id="circlePosterInner" id="circlePosterInner"
width="152" width="152"
height="152" height="152"
blendColor="#9696c8" blendColor="#9696C8"
uri="pkg:/images/white-circle.png" uri="pkg:/images/white-circle.png"
translation="[4,4]"> translation="[4,4]">
<Label <Label
@@ -13,9 +13,9 @@ function OnNodeReady()
SetNavigation(invalid, "back", m.navBar) SetNavigation(invalid, "back", m.navBar)
SetNavigation(invalid, "left", m.navBar) SetNavigation(invalid, "left", m.navBar)
m.profileRowList.content = m.profiles.content m.profileRowList.content = m.profilesService.content
m.profileRowList.observeFieldScoped("rowItemSelected", FuncName(OnRowItemSelected)) m.profileRowList.observeFieldScoped("rowItemSelected", FuncName(OnRowItemSelected))
m.profiles.observeFieldScoped("currentProfile", FuncName(OnCurrentProfileChanged)) m.profilesService.observeFieldScoped("currentProfile", FuncName(OnCurrentProfileChanged))
end function end function
function OnFocusChange() as void function OnFocusChange() as void
@@ -47,7 +47,7 @@ function OnRowItemSelected() as void
end function end function
function OnCurrentProfileChanged() as void function OnCurrentProfileChanged() as void
currentProfile = m.profiles.currentProfile currentProfile = m.profilesService.currentProfile
if currentProfile = invalid if currentProfile = invalid
return return
end if end if
@@ -1,7 +1,7 @@
<component name="ProfileScreen" extends="Group" includes="AutoBind,Focus"> <component name="ProfileScreen" extends="Group" includes="AutoBind,Focus">
<interface> <interface>
<field id="navBar" type="node" bind="/NavBar" /> <field id="navBar" type="node" bind="/NavBar" />
<field id="profiles" type="node" bind="/Profiles" /> <field id="profilesService" type="node" bind="/ProfilesService" />
<field id="appController" type="node" bind="/AppController" /> <field id="appController" type="node" bind="/AppController" />
</interface> </interface>
@@ -4,7 +4,9 @@ import "pkg:/source/AsyncTask/AsyncTask.bs"
import "pkg:/source/AsyncTask/Tasks.bs" import "pkg:/source/AsyncTask/Tasks.bs"
import "pkg:/source/utils/ErrorUtils.bs" import "pkg:/source/utils/ErrorUtils.bs"
import "pkg:/source/utils/FocusManagement.bs" import "pkg:/source/utils/FocusManagement.bs"
import "pkg:/source/utils/Locale.bs"
import "pkg:/source/utils/Logging.bs" import "pkg:/source/utils/Logging.bs"
import "pkg:/source/utils/MathUtils.bs"
import "pkg:/source/utils/StringUtils.bs" import "pkg:/source/utils/StringUtils.bs"
function Init() function Init()
@@ -21,6 +23,19 @@ function Init()
m.wifiNameLabel = m.top.findNode("WifiNameLabel") m.wifiNameLabel = m.top.findNode("WifiNameLabel")
m.wifiInstructionWithDeviceNameLabel = m.top.findNode("WifiInstructionWithDeviceNameLabel") m.wifiInstructionWithDeviceNameLabel = m.top.findNode("WifiInstructionWithDeviceNameLabel")
m.linkCodeLabel = m.top.findNode("LinkCodeLabel") m.linkCodeLabel = m.top.findNode("LinkCodeLabel")
m.wifiInstructionWithDeviceNameLabel.drawingStyles = {
"Bold": {
"fontSize": 22
"fontUri": "font:SmallBoldSystemFont"
"color": "#DDDDDDFF"
}
"default": {
"fontSize": 22
"fontUri": "font:SmallSystemFont"
"color": "#DDDDDDFF"
}
}
end function end function
function OnNodeReady() function OnNodeReady()
@@ -47,6 +62,11 @@ function OnNodeReady()
m.linkWithWifiPanel.visible = false m.linkWithWifiPanel.visible = false
m.linkWithTvPanel.observeField("visible", FuncName(OnLinkWithTvPanelVisibleChanged)) m.linkWithTvPanel.observeField("visible", FuncName(OnLinkWithTvPanelVisibleChanged))
m.linkWithTvPanel.visible = false m.linkWithTvPanel.visible = false
m.webAppButton.observeField("contentWidth", FuncName(OnButtonSizeChange))
m.linkWithWifiButton.observeField("contentWidth", FuncName(OnButtonSizeChange))
m.linkWithTvButton.observeField("contentWidth", FuncName(OnButtonSizeChange))
OnButtonSizeChange()
end function end function
function OnFocusChange() as void function OnFocusChange() as void
@@ -69,6 +89,18 @@ function OnUrlSet()
m.webAppQrCodePoster.text = url m.webAppQrCodePoster.text = url
end function end function
function OnButtonSizeChange()
width1 = m.webAppButton.contentWidth
width2 = m.linkWithWifiButton.contentWidth
width3 = m.linkWithTvButton.contentWidth
width = MathUtils.Max(width1, MathUtils.Max(width2, width3))
m.webAppButton.minimumWidth = width
m.linkWithWifiButton.minimumWidth = width
m.linkWithTvButton.minimumWidth = width
end function
function OnkeyEvent(key as string, press as boolean) as boolean function OnkeyEvent(key as string, press as boolean) as boolean
navigation = NavigationKeyHandler(key, press) navigation = NavigationKeyHandler(key, press)
if navigation.handled if navigation.handled
@@ -117,12 +149,13 @@ function OnLinkWithWifiPanelVisibleChanged() as void
if connectionInfo.type = "WiFiConnection" if connectionInfo.type = "WiFiConnection"
m.wifiNameLabel.text = connectionInfo.ssid m.wifiNameLabel.text = connectionInfo.ssid
else if connectionInfo.type = "WiredConnection" else if connectionInfo.type = "WiredConnection"
m.wifiNameLabel.text = "Wired connection" m.wifiNameLabel.text = Tr(Locale.RemoteScreen.WiredConnection)
else else
m.wifiNameLabel.text = "N/A" m.wifiNameLabel.text = "N/A"
end if end if
m.wifiInstructionWithDeviceNameLabel.text = `Tap the cast icon and select "${m.loungeService.deviceName}"` deviceName = `<Bold>"${m.loungeService.deviceName}"</Bold>`
m.wifiInstructionWithDeviceNameLabel.text = Tr(Locale.RemoteScreen.WifiInstruction3).Replace("%1", deviceName)
end function end function
function OnLinkWithTvPanelVisibleChanged() function OnLinkWithTvPanelVisibleChanged()
@@ -142,7 +175,7 @@ function GeneratePairingCode()
m.linkCodeTask.cancel = true m.linkCodeTask.cancel = true
end if end if
m.linkCodeLabel.text = "Loading..." m.linkCodeLabel.text = Tr(Locale.RemoteScreen.Loading)
m.linkCodeTask = AsyncTask.Start(Tasks.LoungeGenerateManualPairingCodeTask, { m.linkCodeTask = AsyncTask.Start(Tasks.LoungeGenerateManualPairingCodeTask, {
loungeService: m.loungeService loungeService: m.loungeService
loungeToken: m.loungeService.loungeToken loungeToken: m.loungeService.loungeToken
@@ -170,8 +203,8 @@ function OnLoungeGenerateManualPairingCodeTaskResult(output as object) as void
error = ErrorUtils.Format(error) error = ErrorUtils.Format(error)
LogError(error) LogError(error)
message = `Failed to generate manual pairing code\n${error}` message = Tr(Locale.RemoteScreen.FailedToGeneratePairingCode) + `\n${error}`
DialogUtils.ShowDialog(message, "Get TV code fail", true) DialogUtils.ShowDialog(message, Tr(Locale.RemoteScreen.TvCodeError), true)
return return
end if end if
@@ -10,11 +10,13 @@
<Group id="noInternet" visible="false"> <Group id="noInternet" visible="false">
<Label <Label
height="720" height="720"
width="1280" width="920"
font="font:MediumBoldSystemFont" font="font:SmallSystemFont"
horizAlign="center" horizAlign="center"
vertAlign="center" vertAlign="center"
text="Could not get IP address: are we connected to the internet?" text="Could not get IP address: are we connected to the internet?"
wrap="true"
translation="[180,0]"
/> />
</Group> </Group>
<Group id="yesInternet" visible="false"> <Group id="yesInternet" visible="false">
@@ -91,30 +93,29 @@
<Label <Label
font="font:SmallSystemFont" font="font:SmallSystemFont"
text="3." /> text="3." />
<Label <MultiStyleLabel
id="WifiInstructionWithDeviceNameLabel" id="WifiInstructionWithDeviceNameLabel"
font="font:SmallSystemFont"
width="380" width="380"
wrap="true" wrap="true"
text="Tap the cast icon and select this device." /> text="Tap the cast icon and select this device." />
</LayoutGroup> </LayoutGroup>
<Label
text="Roku connected to:"
translation="[0,220]">
<Font role="font" uri="font:SystemFontFile" size="20" />
</Label>
<Label
id="WifiNameLabel"
color="#4287f5"
translation="[0,250]">
<Font role="font" uri="font:BoldSystemFontFile" size="28" />
</Label>
</LayoutGroup> </LayoutGroup>
<Label
text="Roku connected to:"
translation="[0,220]">
<Font role="font" uri="font:SystemFontFile" size="20" />
</Label>
<Label
id="WifiNameLabel"
color="#4287f5"
translation="[0,250]">
<Font role="font" uri="font:BoldSystemFontFile" size="28" />
</Label>
</Group> </Group>
<Group id="LinkWithTvPanel" <Group id="LinkWithTvPanel"
translation="[700,220]"> translation="[700,220]">
<LayoutGroup itemSpacings="[12]"> <LayoutGroup itemSpacings="[12,12,25]">
<LayoutGroup layoutDirection="horiz" itemSpacings="[15]"> <LayoutGroup layoutDirection="horiz" itemSpacings="[15]">
<Label <Label
font="font:SmallSystemFont" font="font:SmallSystemFont"
@@ -133,7 +134,7 @@
font="font:SmallSystemFont" font="font:SmallSystemFont"
width="380" width="380"
wrap="true" wrap="true"
text="Tap the Chromecast icon." /> text="Tap the cast icon." />
</LayoutGroup> </LayoutGroup>
<LayoutGroup layoutDirection="horiz" itemSpacings="[15]"> <LayoutGroup layoutDirection="horiz" itemSpacings="[15]">
<Label <Label
@@ -143,18 +144,15 @@
font="font:SmallSystemFont" font="font:SmallSystemFont"
width="380" width="380"
wrap="true" wrap="true"
text="Tap &quot;Link with TV code&quot; and enter the code below." /> text="Tap 'Link with TV code' and enter the code below." />
</LayoutGroup> </LayoutGroup>
<Label
id="LinkCodeLabel"
font="font:LargeBoldSystemFont"
color="#4287f5">
<Font role="font" uri="font:BoldSystemFontFile" size="48" />
</Label>
</LayoutGroup> </LayoutGroup>
<Label
id="LinkCodeLabel"
font="font:LargeBoldSystemFont"
color="#4287f5"
translation="[-30,180]"
width="460"
horizAlign="center">
<Font role="font" uri="font:BoldSystemFontFile" size="48" />
</Label>
</Group> </Group>
</Group> </Group>
</children> </children>
@@ -1,105 +1,103 @@
import "pkg:/components/Navigation/Navigation.bs" import "pkg:/components/Navigation/Navigation.bs"
import "pkg:/source/utils/ArrayUtils.bs" import "pkg:/source/utils/ArrayUtils.bs"
import "pkg:/source/utils/Locale.bs"
import "pkg:/source/utils/Types.bs" import "pkg:/source/utils/Types.bs"
function Init() function Init()
options = { options = {
date: [{ date: [{
title: "Any date" title: Tr(Locale.SearchFilters.AnyDate)
value: "" value: ""
}, { }, {
title: "Last hour" title: Tr(Locale.SearchFilters.LastHour)
value: "hour" value: "hour"
}, { }, {
title: "Today" title: Tr(Locale.SearchFilters.Today)
value: "today" value: "today"
}, { }, {
title: "This week" title: Tr(Locale.SearchFilters.ThisWeek)
value: "week" value: "week"
}, { }, {
title: "This month" title: Tr(Locale.SearchFilters.ThisMonth)
value: "month" value: "month"
}, { }, {
title: "This year" title: Tr(Locale.SearchFilters.ThisYear)
value: "year" value: "year"
}] }]
type: [{ type: [{
title: "Any type" title: Tr(Locale.SearchFilters.AnyType)
value: "" value: ""
}, { }, {
title: "Video" title: Tr(Locale.SearchFilters.Video)
value: "video" value: "video"
}, { }, {
title: "Playlist" title: Tr(Locale.SearchFilters.Playlist)
value: "playlist" value: "playlist"
}, { }, {
title: "Channel" title: Tr(Locale.SearchFilters.Channel)
value: "channel" value: "channel"
}, { }, {
title: "Movie" title: Tr(Locale.SearchFilters.Movie)
value: "movie" value: "movie"
}, {
title: "Show"
value: "show"
}] }]
duration: [{ duration: [{
title: "Any duration" title: Tr(Locale.SearchFilters.AnyDuration)
value: "" value: ""
}, { }, {
title: "Under 4 minutes" title: Tr(Locale.SearchFilters.Under4Minutes)
value: "short" value: "short"
}, { }, {
title: "4 - 20 minutes" title: Tr(Locale.SearchFilters.FourTo20Minutes)
value: "medium" value: "medium"
}, { }, {
title: "Over 20 minutes" title: Tr(Locale.SearchFilters.Over20Minutes)
value: "long" value: "long"
}] }]
features: [{ features: [{
title: "Live" title: Tr(Locale.Feed.Live)
value: "live" value: "live"
}, { }, {
title: "4K" title: Tr(Locale.SearchFilters.FourK)
value: "4k" value: "4k"
}, { }, {
title: "HD" title: Tr(Locale.SearchFilters.HD)
value: "hd" value: "hd"
}, { }, {
title: "Subtitles/CC" title: Tr(Locale.SearchFilters.SubtitlesCC)
value: "subtitles" value: "subtitles"
}, { }, {
title: "Creative Commons" title: Tr(Locale.SearchFilters.CreativeCommons)
value: "creative_commons" value: "creative_commons"
}, { }, {
title: "360°" title: Tr(Locale.SearchFilters.ThreeSixty)
value: "360" value: "360"
}, { }, {
title: "VR180" title: Tr(Locale.SearchFilters.VR180)
value: "vr180" value: "vr180"
}, { }, {
title: "3D" title: Tr(Locale.SearchFilters.ThreeD)
value: "3d" value: "3d"
}, { }, {
title: "HDR" title: Tr(Locale.SearchFilters.HDR)
value: "hdr" value: "hdr"
}, { }, {
title: "Purchased" title: Tr(Locale.SearchFilters.Purchased)
value: "purchased" value: "purchased"
}, { }, {
title: "Location" title: Tr(Locale.SearchFilters.Location)
value: "location" value: "location"
}] }]
sort_by: [{ sort: [{
title: "Relevance" title: Tr(Locale.SearchFilters.Relevance)
value: "" value: ""
}, { }, {
title: "Upload date" title: Tr(Locale.SearchFilters.UploadDate)
value: "upload_date" value: "date"
}, { }, {
title: "View count" title: Tr(Locale.SearchFilters.ViewCount)
value: "view_count" value: "views"
}, { }, {
title: "Rating" title: Tr(Locale.SearchFilters.Rating)
value: "rating" value: "rating"
}] }]
} }
@@ -109,7 +107,7 @@ function Init()
type: m.top.findNode("TypeList") type: m.top.findNode("TypeList")
duration: m.top.findNode("DurationList") duration: m.top.findNode("DurationList")
features: m.top.findNode("FeaturesList") features: m.top.findNode("FeaturesList")
sort_by: m.top.findNode("SortByList") sort: m.top.findNode("SortList")
} }
for each filterKey in m.controls for each filterKey in m.controls
@@ -122,12 +120,12 @@ function Init()
type: m.controls.type.content type: m.controls.type.content
duration: m.controls.duration.content duration: m.controls.duration.content
features: m.controls.features.content features: m.controls.features.content
sort_by: m.controls.sort_by.content sort: m.controls.sort.content
} }
PopulateLists(m.contentNodes, options) PopulateLists(m.contentNodes, options)
navigationNodes = [m.controls.date, m.controls.type, m.controls.duration, m.controls.features, m.controls.sort_by] navigationNodes = [m.controls.date, m.controls.type, m.controls.duration, m.controls.features, m.controls.sort]
for i = 0 to navigationNodes.count() - 2 for i = 0 to navigationNodes.count() - 2
SetNavigation(navigationNodes[i], "right", navigationNodes[i + 1]) SetNavigation(navigationNodes[i], "right", navigationNodes[i + 1])
end for end for
@@ -156,7 +154,7 @@ function OnNodeReady()
m.controls.type.ObserveField("checkedItem", FuncName(OnListChecked)) m.controls.type.ObserveField("checkedItem", FuncName(OnListChecked))
m.controls.duration.ObserveField("checkedItem", FuncName(OnListChecked)) m.controls.duration.ObserveField("checkedItem", FuncName(OnListChecked))
m.controls.features.ObserveField("checkedState", FuncName(OnListChecked)) m.controls.features.ObserveField("checkedState", FuncName(OnListChecked))
m.controls.sort_by.ObserveField("checkedItem", FuncName(OnListChecked)) m.controls.sort.ObserveField("checkedItem", FuncName(OnListChecked))
end function end function
function RefreshUI() function RefreshUI()
@@ -14,14 +14,14 @@
<Font id="ItemFont" uri="font:SystemFontFile" size="18" /> <Font id="ItemFont" uri="font:SystemFontFile" size="18" />
<Font id="ItemFocusedFont" uri="font:BoldSystemFontFile" size="18" /> <Font id="ItemFocusedFont" uri="font:BoldSystemFontFile" size="18" />
<Rectangle <Rectangle
width="1116" width="1200"
height="543" height="543"
translation="[82,84]" translation="[40,84]"
color="#242424"> color="#242424">
<LayoutGroup <LayoutGroup
layoutDirection="horiz" layoutDirection="horiz"
translation="[35,20]"> translation="[20,20]">
<LayoutGroup horizAlignment="center" itemSpacings="[10,10]"> <LayoutGroup horizAlignment="center" itemSpacings="[10,10]">
<Label <Label
text="Upload date" text="Upload date"
@@ -36,7 +36,7 @@
vertFocusAnimationStyle="floatingFocus" vertFocusAnimationStyle="floatingFocus"
font="dictionary:ItemFont" font="dictionary:ItemFont"
focusedFont="dictionary:ItemFocusedFont" focusedFont="dictionary:ItemFocusedFont"
itemSize="[140,42]"> itemSize="[170,42]">
<ContentNode role="content" /> <ContentNode role="content" />
</RadioButtonList> </RadioButtonList>
</LayoutGroup> </LayoutGroup>
@@ -74,7 +74,7 @@
vertFocusAnimationStyle="floatingFocus" vertFocusAnimationStyle="floatingFocus"
font="dictionary:ItemFont" font="dictionary:ItemFont"
focusedFont="dictionary:ItemFocusedFont" focusedFont="dictionary:ItemFocusedFont"
itemSize="[190,42]"> itemSize="[230,42]">
<ContentNode role="content" /> <ContentNode role="content" />
</RadioButtonList> </RadioButtonList>
</LayoutGroup> </LayoutGroup>
@@ -108,11 +108,11 @@
width="180" width="180"
height="1" /> height="1" />
<RadioButtonList <RadioButtonList
id="SortByList" id="SortList"
vertFocusAnimationStyle="floatingFocus" vertFocusAnimationStyle="floatingFocus"
font="dictionary:ItemFont" font="dictionary:ItemFont"
focusedFont="dictionary:ItemFocusedFont" focusedFont="dictionary:ItemFocusedFont"
itemSize="[150,42]"> itemSize="[190,42]">
<ContentNode role="content" /> <ContentNode role="content" />
</RadioButtonList> </RadioButtonList>
</LayoutGroup> </LayoutGroup>
@@ -7,6 +7,7 @@ import "pkg:/source/utils/CryptoUtils.bs"
import "pkg:/source/utils/ErrorUtils.bs" import "pkg:/source/utils/ErrorUtils.bs"
import "pkg:/source/utils/FocusManagement.bs" import "pkg:/source/utils/FocusManagement.bs"
import "pkg:/source/utils/LoadingScreen.bs" import "pkg:/source/utils/LoadingScreen.bs"
import "pkg:/source/utils/Locale.bs"
import "pkg:/source/utils/Logging.bs" import "pkg:/source/utils/Logging.bs"
import "pkg:/source/utils/UrlUtils.bs" import "pkg:/source/utils/UrlUtils.bs"
@@ -33,7 +34,7 @@ function Init()
type: "" type: ""
duration: "" duration: ""
features: [] features: []
sort_by: "" sort: ""
} }
m.top.ObserveField("filters", FuncName(OnFiltersChange)) m.top.ObserveField("filters", FuncName(OnFiltersChange))
@@ -196,9 +197,9 @@ function OnFiltersChange()
end if end if
end for end for
if filterCount > 0 if filterCount > 0
m.filtersButton.text = `Filters (${filterCount})` m.filtersButton.text = `${Tr(Locale.Buttons.Filters)} (${filterCount})`
else else
m.filtersButton.text = "Filters" m.filtersButton.text = Tr(Locale.Buttons.Filters)
end if end if
end function end function
@@ -209,7 +210,7 @@ function Search(text as string)
feedSource = { feedSource = {
"id": `inv_search_${CryptoUtils.GetMd5(text)}` "id": `inv_search_${CryptoUtils.GetMd5(text)}`
"title": `Search - ${text}` "title": `${Tr(Locale.NavBar.Search)} - ${text}`
"apiType": "Invidious" "apiType": "Invidious"
"endpoint": "search" "endpoint": "search"
"queryParams": { "queryParams": {
@@ -231,7 +232,7 @@ function Search(text as string)
end for end for
m.rowList.feeds = [{ m.rowList.feeds = [{
"title": `Search - ${text}` "title": `${Tr(Locale.NavBar.Search)} - ${text}`
"feedSources": [feedSource] "feedSources": [feedSource]
}] }]
end function end function
@@ -240,7 +241,7 @@ function OnSearchContentReady() as void
m.rowlist.UnobserveFieldScoped("someContentReady") m.rowlist.UnobserveFieldScoped("someContentReady")
if not m.rowlist.someContentReady if not m.rowlist.someContentReady
DialogUtils.ShowDialog("We didn't find any results for your search. Please try again with a different query or different filters.", "No results found") DialogUtils.ShowDialog(Tr(Locale.Dialogs.NoResultsFoundMessage), Tr(Locale.Dialogs.NoResultsFound))
m.rowlist.feeds = invalid m.rowlist.feeds = invalid
m.rowlist.focusable = false m.rowlist.focusable = false
HideLoadingScreen() HideLoadingScreen()
@@ -8,16 +8,13 @@
</interface> </interface>
<children> <children>
<Group id="container"> <Group id="container">
<Button <ButtonEx
id="filtersButton" id="filtersButton"
translation="[160,35]" translation="[190,64]"
minWidth="0" iconUri="pkg:/images/icons/filters.png"
height="58" anchor="[0,0.5]"
showFocusFootprint="true" padding="[30,30]"
iconUri="pkg:/images/icons/filters-white.png" text="Filters" />
focusedIconUri="pkg:/images/icons/filters-black.png"
text="Filters">
</Button>
<DynamicMiniKeyboard <DynamicMiniKeyboard
id="keyboard" id="keyboard"
@@ -1,7 +1,9 @@
import "pkg:/source/utils/MathUtils.bs"
import "pkg:/source/utils/Types.bs" import "pkg:/source/utils/Types.bs"
function Init() function Init()
m.top.observeField("checkedState", FuncName(OnCheckedStateChange)) m.top.observeField("checkedState", FuncName(OnCheckedStateChange))
m.minItemWidth = m.top.itemSize[0]
end function end function
function OnValueChange() function OnValueChange()
@@ -15,3 +17,19 @@ function OnCheckedStateChange() as void
end if end if
m.top.value = checkedState[0] m.top.value = checkedState[0]
end function end function
function OnTitleChange()
title = m.top.title
' TODO:P2 FIX THIS
' This is a gross estimate of the width of the text, because there isn't
' a simple way to measure using the font, and accurately estimate the width
' of the checkbox. I hate it, but I currently don't have the patience to
' do something else.
' The risks are, if the checkbox is too big, it will look ugly, and if it's
' too small, the text will be scrolling. Either way, it will be usable.
' A better way is to create a Checkbox from scratch, instead of using the CheckList
size = title.len() * 14 - 30
size = MathUtils.Max(size, m.minItemWidth)
m.top.itemSize = [size, m.top.itemSize[1]]
end function
@@ -1,6 +1,6 @@
<component name="Checkbox" extends="CheckList"> <component name="Checkbox" extends="CheckList">
<interface> <interface>
<field id="title" type="string" alias="checkboxNode.title" /> <field id="title" type="string" alias="checkboxNode.title" onChange="OnTitleChange" />
<field id="value" type="boolean" onChange="OnValueChange" /> <field id="value" type="boolean" onChange="OnValueChange" />
</interface> </interface>
<children> <children>
@@ -1,6 +1,7 @@
import "pkg:/components/Dialog/DialogUtils.bs" import "pkg:/components/Dialog/DialogUtils.bs"
import "pkg:/components/Services/SearchHistory/SearchHistoryUtils.bs" import "pkg:/components/Services/SearchHistory/SearchHistoryUtils.bs"
import "pkg:/source/utils/FocusManagement.bs" import "pkg:/source/utils/FocusManagement.bs"
import "pkg:/source/utils/Locale.bs"
function Init() function Init()
m.top.focusable = true m.top.focusable = true
@@ -22,5 +23,5 @@ end function
function OnButtonSelected() function OnButtonSelected()
SearchHistoryUtils.Clear() SearchHistoryUtils.Clear()
DialogUtils.ShowDialog("Search history cleared.", "Success") DialogUtils.ShowDialog(Tr(Locale.Settings.SearchHistoryCleared), Tr(Locale.Generic.Success))
end function end function
@@ -35,6 +35,16 @@ function Init()
m.closeButton.observeField("buttonSelected", FuncName(Close)) m.closeButton.observeField("buttonSelected", FuncName(Close))
m.checkList.observeField("checkedState", FuncName(OnCheckedStateChange)) m.checkList.observeField("checkedState", FuncName(OnCheckedStateChange))
SetButtonPositions()
end function
function SetButtonPositions()
saveButtonWidth = m.saveButton.width
closeButtonWidth = m.closeButton.width
buttonsWith = closeButtonWidth + saveButtonWidth + 20
m.saveButton.translation = [960 / 2 - buttonsWith / 2, m.saveButton.translation[1]]
m.closeButton.translation = [960 / 2 + buttonsWith / 2 - closeButtonWidth, m.closeButton.translation[1]]
end function end function
function OnFocusChange() as void function OnFocusChange() as void
@@ -77,7 +87,7 @@ function OnValueChange()
end if end if
node = CreateObject("roSGNode", "ContentNode") node = CreateObject("roSGNode", "ContentNode")
node.id = feed.id node.id = feed.id
node.title = feed.title node.title = Tr(feed.title)
nodes.push(node) nodes.push(node)
checkedState.push(item.enabled) checkedState.push(item.enabled)
end for end for
@@ -24,30 +24,33 @@
<ContentNode role="content" /> <ContentNode role="content" />
</CheckList> </CheckList>
<Button <ButtonEx
id="moveUpButton" id="moveUpButton"
iconVisible="false"
anchor="[0.5,0.5]"
text="Move up" text="Move up"
showFocusFootprint="true"
minWidth="220" minWidth="220"
translation="[640,183]" /> translation="[750,220]" />
<Button <ButtonEx
id="moveDownButton" id="moveDownButton"
iconVisible="false"
anchor="[0.5,0.5]"
text="Move down" text="Move down"
showFocusFootprint="true"
minWidth="220" minWidth="220"
translation="[640,273]" /> translation="[750,300]" />
<Button
id="closeButton" <ButtonEx
text="Close"
showFocusFootprint="true"
minWidth="150"
translation="[500,500]" />
<Button
id="saveButton" id="saveButton"
iconVisible="false"
text="Save" text="Save"
showFocusFootprint="true" padding="[30,30]"
minWidth="150" translation="[340,500]" />
translation="[320,500]" /> <ButtonEx
id="closeButton"
iconVisible="false"
text="Close"
padding="[30,30]"
translation="[496,500]" />
</Rectangle> </Rectangle>
</children> </children>
</component> </component>
@@ -33,6 +33,28 @@ function Init()
m.currentNavigtionNode = m.editButton m.currentNavigtionNode = m.editButton
m.textEditBox.hintText = `e.g. ${Invidious.DEFAULT_INSTANCE}` m.textEditBox.hintText = `e.g. ${Invidious.DEFAULT_INSTANCE}`
SetButtonPositions()
SetPublicInstancesPosition()
m.publicInstances.observeField("width", FuncName(SetPublicInstancesPosition))
end function
function SetButtonPositions()
testButtonWidth = m.testButton.width
saveButtonWidth = m.saveButton.width
buttonsWith = testButtonWidth + saveButtonWidth + 20
m.testButton.translation = [960 / 2 - buttonsWith / 2, m.testButton.translation[1]]
m.saveButton.translation = [960 / 2 + buttonsWith / 2 - saveButtonWidth, m.saveButton.translation[1]]
end function
function SetPublicInstancesPosition() as void
width = m.publicInstances.width
if width = 0
return
end if
m.publicInstances.translation = [960 / 2 - width / 2, m.publicInstances.translation[1]]
end function end function
function OnFocusChange() as void function OnFocusChange() as void
@@ -83,7 +105,7 @@ function OnEditButtonSelected()
keyboardDialog.title = "Edit Instance" keyboardDialog.title = "Edit Instance"
keyboardDialog.message = [`Enter the instance url (e.g. ${Invidious.DEFAULT_INSTANCE})`] keyboardDialog.message = [`Enter the instance url (e.g. ${Invidious.DEFAULT_INSTANCE})`]
keyboardDialog.text = m.top.text keyboardDialog.text = m.top.text
keyboardDialog.buttons = ["OK", "Cancel"] keyboardDialog.buttons = [Tr(Locale.Buttons.OK), Tr(Locale.Buttons.Cancel)]
keyboardDialog.observeField("buttonSelected", FuncName(OnKeyboardButton)) keyboardDialog.observeField("buttonSelected", FuncName(OnKeyboardButton))
m.top.getScene().dialog = keyboardDialog m.top.getScene().dialog = keyboardDialog
@@ -18,58 +18,64 @@
color="#242424"> color="#242424">
<Label <Label
text="Invidious custom instance" text="Invidious custom instance"
translation="[326,13]" /> horizAlign="center"
width="960"
translation="[0,13]" />
<TextEditBox <TextEditBox
id="textEditBox" id="textEditBox"
width="480" width="480"
height="50" height="50"
translation="[200,50]" /> translation="[170,50]" />
<Button <ButtonEx
id="editButton" id="editButton"
text="" iconUri="pkg:/images/icons/edit.png"
minWidth="64" height="50"
maxWidth="80" iconWidth="22"
height="48" iconHeight="22"
iconUri="pkg:/images/icons/edit-48-white.png" text="Edit"
focusedIconUri="pkg:/images/icons/edit-48-black.png" translation="[670,50]" />
showFocusFootprint="true"
translation="[692,50]" /> <LayoutGroup
<Label layoutDirection="horiz"
text="OR" horizAlignment="center"
translation="[460,110]"> vertAlignment="center"
itemSpacings="[30,30]"
translation="[480,125]">
<Rectangle <Rectangle
width="250" width="250"
height="1" height="1" />
translation="[-282,10]" />
<Label
text="Or" />
<Rectangle <Rectangle
width="250" width="250"
height="1" height="1" />
translation="[71,10]" />
</Label> </LayoutGroup>
<Label <Label
text="Invidious public instances" text="Invidious public instances"
translation="[328,145]" /> horizAlign="center"
width="960"
translation="[0,145]" />
<InvidiousPublicInstances <InvidiousPublicInstances
id="instances" id="instances"
translation="[50,190]"> translation="[50,190]" />
</InvidiousPublicInstances> <ButtonEx
<Button
id="testButton" id="testButton"
text="Test instance" text="Test instance"
showFocusFootprint="true" iconVisible="false"
translation="[495,507]" /> padding="[30,30]"
<Button translation="[300,510]" />
<ButtonEx
id="saveButton" id="saveButton"
text="Save" text="Save"
showFocusFootprint="true" iconVisible="false"
minWidth="150" padding="[30,30]"
translation="[768,507]" /> translation="[545,510]" />
</Rectangle> </Rectangle>
</children> </children>
</component> </component>
@@ -53,14 +53,15 @@ function Close()
end function end function
function RunTestsTask() function RunTestsTask()
m.titleLabel.text = `Testing ${m.top.instance}` instance = m.top.instance
m.titleLabel.text = Tr(Locale.InvidiousTesting.TestingInstance).Replace("%1", instance)
if m.testingTask <> invalid if m.testingTask <> invalid
m.testingTask.cancel = true m.testingTask.cancel = true
end if end if
m.testingTask = AsyncTask.Start(Tasks.InvidiousInstanceTestingTask, { m.testingTask = AsyncTask.Start(Tasks.InvidiousInstanceTestingTask, {
instance: m.top.instance instance: instance
listNode: m.testList listNode: m.testList
}) })
end function end function
@@ -68,10 +69,21 @@ end function
function ShowTestDetails(event as object) as void function ShowTestDetails(event as object) as void
selected = m.testList.itemSelected selected = m.testList.itemSelected
itemContent = m.testList.content.GetChild(selected) itemContent = m.testList.content.GetChild(selected)
if StringUtils.IsNullOrEmpty(itemContent.details) details = itemContent.details
if StringUtils.IsNullOrEmpty(details)
return return
end if end if
message = `Status: ${itemContent.state}\nTest duration: ${itemContent.duration}ms\nDetails: ${itemContent.details}` state = itemContent.state
DialogUtils.ShowDialog(message, `Test: ${itemContent.title}`) displayStates = {
"passed": Locale.InvidiousTesting.Passed
"failed": Locale.InvidiousTesting.Failed
}
message = Tr(Locale.InvidiousTesting.Status) + ": " + Tr(ValidString(displayStates[state])) + `\n`
message += Tr(Locale.InvidiousTesting.TestDuration) + ": " + `${itemContent.duration}ms\n`
message += Tr(Locale.InvidiousTesting.Details) + ": " + details
title = Tr(Locale.InvidiousTesting.Test) + ": " + itemContent.title
DialogUtils.ShowDialog(message, title)
end function end function
@@ -12,32 +12,33 @@
opacity="0.5"> opacity="0.5">
</Rectangle> </Rectangle>
<Rectangle <Rectangle
width="960" width="1160"
height="600" height="600"
translation="[160,60]" translation="[60,60]"
color="#242424"> color="#242424">
<Label <Label
id="titleLabel" id="titleLabel"
width="960" width="1160"
horizAlign="center" horizAlign="center"
text="" text=""
translation="[0,20]" /> translation="[0,20]" />
<MarkupGrid <MarkupGrid
id="testList" id="testList"
itemSize="[860,40]" itemSize="[1060,40]"
itemSpacing="[0,20]" itemSpacing="[0,20]"
numColumns="1" numColumns="1"
numRows="7" numRows="7"
vertFocusAnimationStyle="floatingFocus" vertFocusAnimationStyle="floatingFocus"
translation="[50,80]" translation="[50,80]"
itemComponentName="InvidiousInstanceTestingItem" /> itemComponentName="InvidiousInstanceTestingItem" />
<Button <ButtonEx
id="closeButton" id="closeButton"
text="Close" text="Close"
minWidth="160" iconVisible="false"
showFocusFootprint="true" anchor="[0.5,0.5]"
translation="[400,506]" /> padding="[30,30]"
translation="[580,530]" />
</Rectangle> </Rectangle>
</children> </children>
</component> </component>
@@ -13,14 +13,16 @@
translation="[5,0]" /> translation="[5,0]" />
<Label <Label
id="nameLabel" id="nameLabel"
width="450" width="660"
translation="[60,10]" /> translation="[60,10]" />
<Label <Label
id="detailsLabel" id="detailsLabel"
visible="false" visible="false"
horizAlign="right" horizAlign="right"
width="300" width="400"
text="Press 'OK' for details" text="Press 'OK' for details"
translation="[560,10]" /> translation="[660,12]">
<Font role="font" uri="font:SystemFontFile" size="20" />
</Label>
</children> </children>
</component> </component>
@@ -2,6 +2,7 @@ import "pkg:/components/Services/Invidious/InvidiousService.bs"
import "pkg:/components/Services/Invidious/InvidiousToContentNode.bs" import "pkg:/components/Services/Invidious/InvidiousToContentNode.bs"
import "pkg:/source/services/HttpClient.bs" import "pkg:/source/services/HttpClient.bs"
import "pkg:/source/utils/ErrorUtils.bs" import "pkg:/source/utils/ErrorUtils.bs"
import "pkg:/source/utils/Locale.bs"
import "pkg:/source/utils/StringUtils.bs" import "pkg:/source/utils/StringUtils.bs"
@asynctask @asynctask
@@ -16,7 +17,7 @@ function InvidiousInstanceTestingTask(input as object) as object
content = PrepareTests() content = PrepareTests()
listNode.content = content listNode.content = content
RunTests(instance, content) RunTests(instance, content, m.top.cancellation)
return invalid return invalid
end function end function
@@ -25,12 +26,12 @@ function PrepareTests() as object
content = CreateObject("roSGNode", "ContentNode") content = CreateObject("roSGNode", "ContentNode")
' TODO:P2 test if video data is reachable (head?) ' TODO:P2 test if video data is reachable (head?)
' TODO:P2 test if video data is reachable in proxy mode (local=true) ' TODO:P2 test if video data is reachable in proxy mode (local=true)
content.AppendChild(CreateTestNode("Valid url", IsValidUrl)) content.AppendChild(CreateTestNode(Tr(Locale.InvidiousTesting.ValidUrl), IsValidUrl))
content.AppendChild(CreateTestNode("Instance reachable", IsReachable)) content.AppendChild(CreateTestNode(Tr(Locale.InvidiousTesting.InstanceReachable), IsReachable))
content.AppendChild(CreateTestNode("Fetch video details", CanFetchVideoDetails)) content.AppendChild(CreateTestNode(Tr(Locale.InvidiousTesting.FetchVideoDetails), CanFetchVideoDetails))
content.AppendChild(CreateTestNode("Fetch video comments", CanFetchVideoComments)) content.AppendChild(CreateTestNode(Tr(Locale.InvidiousTesting.FetchVideoComments), CanFetchVideoComments))
content.AppendChild(CreateTestNode("Fetch video captions", CanFetchVideoCaptions)) content.AppendChild(CreateTestNode(Tr(Locale.InvidiousTesting.FetchVideoCaptions), CanFetchVideoCaptions))
content.AppendChild(CreateTestNode("Fetch video thumbnails", CanFetchVideoThumbails)) content.AppendChild(CreateTestNode(Tr(Locale.InvidiousTesting.FetchVideoThumbnails), CanFetchVideoThumbails))
return content return content
end function end function
@@ -47,14 +48,14 @@ function CreateTestNode(title as string, func as function) as object
return testNode return testNode
end function end function
function RunTests(instance as string, content as object) as void function RunTests(instance as string, content as object, cancellation as object) as void
testNodes = content.getChildren(-1, 0) testNodes = content.getChildren(-1, 0)
timer = CreateObject("roTimespan") timer = CreateObject("roTimespan")
for each testNode in testNodes for each testNode in testNodes
timer.Mark() timer.Mark()
m[testNode.func](instance, testNode) m[testNode.func](instance, testNode, cancellation)
testNode.duration = timer.TotalMilliseconds() testNode.duration = timer.TotalMilliseconds()
testNode.title = `${testNode.title} (${testNode.duration}ms)` testNode.title = `${testNode.title} (${testNode.duration}ms)`
@@ -69,31 +70,31 @@ function RunTests(instance as string, content as object) as void
end for end for
end function end function
function IsValidUrl(instance as string, testNode as object) as void function IsValidUrl(instance as string, testNode as object, cancellation as object) as void
try try
if not instance.StartsWith("http://") and not instance.StartsWith("https://") if not instance.StartsWith("http://") and not instance.StartsWith("https://")
testNode.state = "failed" testNode.state = "failed"
testNode.details = "Url must start with http:// or https://" testNode.details = Tr(Locale.InvidiousTesting.UrlMustStartWith)
return return
end if end if
if instance.EndsWith("/") if instance.EndsWith("/")
testNode.state = "failed" testNode.state = "failed"
testNode.details = "Url must not end with /" testNode.details = Tr(Locale.InvidiousTesting.UrlMustNotEndWith)
return return
end if end if
testNode.state = "passed" testNode.state = "passed"
testNode.details = "The url seems to be of a valid format" testNode.details = Tr(Locale.InvidiousTesting.UrlSeemsValid)
catch e catch e
testNode.state = "failed" testNode.state = "failed"
testNode.details = ErrorUtils.Format(e) testNode.details = ErrorUtils.Format(e)
end try end try
end function end function
function IsReachable(instance as string, testNode as object) as void function IsReachable(instance as string, testNode as object, cancellation as object) as void
try try
url = `${instance}${Invidious.STATS_ENDPOINT}` url = `${instance}${Invidious.STATS_ENDPOINT}`
response = HttpClient.Get(url).NoCache().Await() response = HttpClient.Get(url).NoCache().Cancellation(cancellation).Await()
if not response.IsSuccess() if not response.IsSuccess()
testNode.state = "failed" testNode.state = "failed"
testNode.details = response.ErrorMessage() testNode.details = response.ErrorMessage()
@@ -103,33 +104,33 @@ function IsReachable(instance as string, testNode as object) as void
json = response.Json() json = response.Json()
if json = invalid if json = invalid
testNode.state = "failed" testNode.state = "failed"
testNode.details = `Invalid json from ${url}` testNode.details = Tr(Locale.InvidiousTesting.InvalidJsonFrom).Replace("%1", url)
return return
end if end if
software = json.software software = json.software
if software = invalid if software = invalid
testNode.state = "failed" testNode.state = "failed"
testNode.details = `Invalid json from ${url} (couldn't read $.software)` testNode.details = Tr(Locale.InvidiousTesting.InvalidJsonFromCouldntRead).Replace("%1", url).Replace("%2", "$.software")
return return
end if end if
name = software.name name = software.name
if not IsString(name) if not IsString(name)
testNode.state = "failed" testNode.state = "failed"
testNode.details = `Invalid json from ${url} (couldn't read $.software.name)` testNode.details = Tr(Locale.InvidiousTesting.InvalidJsonFromCouldntRead).Replace("%1", url).Replace("%2", "$.software.name")
return return
end if end if
version = software.version version = software.version
if not IsString(version) if not IsString(version)
testNode.state = "failed" testNode.state = "failed"
testNode.details = `Invalid json from ${url} (couldn't read software.version)` testNode.details = Tr(Locale.InvidiousTesting.InvalidJsonFromCouldntRead).Replace("%1", url).Replace("%2", "$.software.version")
return return
end if end if
testNode.state = "passed" testNode.state = "passed"
testNode.details = `The instance is reachable and running ${name} version ${version}` testNode.details = Tr(Locale.InvidiousTesting.TheInstanceIsReachableAndRunning).Replace("%1", name).Replace("%2", version)
catch e catch e
testNode.state = "failed" testNode.state = "failed"
testNode.details = ErrorUtils.Format(e) testNode.details = ErrorUtils.Format(e)
@@ -137,11 +138,11 @@ function IsReachable(instance as string, testNode as object) as void
end function end function
function CanFetchVideoDetails(instance as string, testNode as object) as void function CanFetchVideoDetails(instance as string, testNode as object, cancellation as object) as void
try try
videoId = "jNQXAC9IVRw" videoId = "jNQXAC9IVRw"
url = `${instance}${Invidious.VIDEOS_ENDPOINT}/${videoId}` url = `${instance}${Invidious.VIDEOS_ENDPOINT}/${videoId}`
response = HttpClient.Get(url).NoCache().Await() response = HttpClient.Get(url).NoCache().Cancellation(cancellation).Await()
if not response.IsSuccess() if not response.IsSuccess()
testNode.state = "failed" testNode.state = "failed"
@@ -152,30 +153,30 @@ function CanFetchVideoDetails(instance as string, testNode as object) as void
json = response.Json() json = response.Json()
if json = invalid if json = invalid
testNode.state = "failed" testNode.state = "failed"
testNode.details = `Invalid json from ${url}` testNode.details = Tr(Locale.InvidiousTesting.InvalidJsonFrom).Replace("%1", url)
return return
end if end if
title = json.title title = json.title
if not IsString(title) if not IsString(title)
testNode.state = "failed" testNode.state = "failed"
testNode.details = `Invalid json from ${url} (couldn't read title)` testNode.details = Tr(Locale.InvidiousTesting.InvalidJsonFromCouldntRead).Replace("%1", url).Replace("%2", "$.title")
return return
end if end if
testNode.state = "passed" testNode.state = "passed"
testNode.details = `The instance can fetch video details for id "${videoId}" (${title})` testNode.details = Tr(Locale.InvidiousTesting.TheInstanceCanFetchVideoDetails).Replace("%1", videoId).Replace("%2", title)
catch e catch e
testNode.state = "failed" testNode.state = "failed"
testNode.details = ErrorUtils.Format(e) testNode.details = ErrorUtils.Format(e)
end try end try
end function end function
function CanFetchVideoComments(instance as string, testNode as object) as void function CanFetchVideoComments(instance as string, testNode as object, cancellation as object) as void
try try
videoId = "jNQXAC9IVRw" videoId = "jNQXAC9IVRw"
url = `${instance}/api/v1/comments/${videoId}` url = `${instance}/api/v1/comments/${videoId}`
response = HttpClient.Get(url).NoCache().Await() response = HttpClient.Get(url).NoCache().Cancellation(cancellation).Await()
if not response.IsSuccess() if not response.IsSuccess()
testNode.state = "failed" testNode.state = "failed"
@@ -186,38 +187,38 @@ function CanFetchVideoComments(instance as string, testNode as object) as void
json = response.Json() json = response.Json()
if json = invalid if json = invalid
testNode.state = "failed" testNode.state = "failed"
testNode.details = `Invalid json from ${url}` testNode.details = Tr(Locale.InvidiousTesting.InvalidJsonFrom).Replace("%1", url)
return return
end if end if
commentCount = json.commentCount commentCount = json.commentCount
if not IsInt(commentCount) if not IsInt(commentCount)
testNode.state = "failed" testNode.state = "failed"
testNode.details = `Invalid json from ${url} (couldn't read commentCount)` testNode.details = Tr(Locale.InvidiousTesting.InvalidJsonFromCouldntRead).Replace("%1", url).Replace("%2", "$.commentCount")
return return
end if end if
comments = json.comments comments = json.comments
if not IsArray(comments) if not IsArray(comments)
testNode.state = "failed" testNode.state = "failed"
testNode.details = `Invalid json from ${url} (couldn't read comments)` testNode.details = Tr(Locale.InvidiousTesting.InvalidJsonFromCouldntRead).Replace("%1", url).Replace("%2", "$.comments")
return return
end if end if
testNode.state = "passed" testNode.state = "passed"
testNode.details = `The instance can fetch video comments for id "${videoId}" (${commentCount} comments)` testNode.details = Tr(Locale.InvidiousTesting.TheInstanceCanFetchVideoComments).Replace("%1", videoId).Replace("%2", `${commentCount}`)
catch e catch e
testNode.state = "failed" testNode.state = "failed"
testNode.details = ErrorUtils.Format(e) testNode.details = ErrorUtils.Format(e)
end try end try
end function end function
function CanFetchVideoCaptions(instance as string, testNode as object) as void function CanFetchVideoCaptions(instance as string, testNode as object, cancellation as object) as void
try try
videoId = "jNQXAC9IVRw" videoId = "jNQXAC9IVRw"
label = "English" label = "English"
url = `${instance}/api/v1/captions/${videoId}?label=${label}` url = `${instance}/api/v1/captions/${videoId}?label=${label}`
response = HttpClient.Get(url).NoCache().Await() response = HttpClient.Get(url).NoCache().Cancellation(cancellation).Await()
if not response.IsSuccess() if not response.IsSuccess()
testNode.state = "failed" testNode.state = "failed"
@@ -229,36 +230,36 @@ function CanFetchVideoCaptions(instance as string, testNode as object) as void
contentType = headers["Content-Type"] contentType = headers["Content-Type"]
if StringUtils.IsNullOrEmpty(contentType) or not contentType.StartsWith("text/vtt") if StringUtils.IsNullOrEmpty(contentType) or not contentType.StartsWith("text/vtt")
testNode.state = "failed" testNode.state = "failed"
testNode.details = `Invalid caption data ${url} (Content-Type is not text/vtt)` testNode.details = Tr(Locale.InvidiousTesting.InvalidCaptionDataContentType).Replace("%1", url)
return return
end if end if
text = response.Text() text = response.Text()
if StringUtils.IsNullOrEmpty(text) or not text.StartsWith("WEBVTT") if StringUtils.IsNullOrEmpty(text) or not text.StartsWith("WEBVTT")
testNode.state = "failed" testNode.state = "failed"
testNode.details = `Invalid caption data from ${url} (response is not a valid vtt file)` testNode.details = Tr(Locale.InvidiousTesting.InvalidCaptionDataNotWebVtt).Replace("%1", url)
return return
end if end if
if text.InStr(`All right, so here we are, in front of the\nelephants`) = -1 if text.InStr(`All right, so here we are, in front of the\nelephants`) = -1
testNode.state = "failed" testNode.state = "failed"
testNode.details = `Did not find expected text in caption data from ${url}` testNode.details = Tr(Locale.InvidiousTesting.ExpectedTextNotFoundInCaptionData).Replace("%1", url)
return return
end if end if
testNode.state = "passed" testNode.state = "passed"
testNode.details = `The instance can fetch video ${label} captions for id "${videoId}"` testNode.details = Tr(Locale.InvidiousTesting.TheInstanceCanFetchVideoCaptions).Replace("%1", label).Replace("%2", videoId)
catch e catch e
testNode.state = "failed" testNode.state = "failed"
testNode.details = ErrorUtils.Format(e) testNode.details = ErrorUtils.Format(e)
end try end try
end function end function
function CanFetchVideoThumbails(instance as string, testNode as object) as void function CanFetchVideoThumbails(instance as string, testNode as object, cancellation as object) as void
try try
videoId = "jNQXAC9IVRw" videoId = "jNQXAC9IVRw"
url = `${instance}${Invidious.VIDEOS_ENDPOINT}/${videoId}` url = `${instance}${Invidious.VIDEOS_ENDPOINT}/${videoId}`
response = HttpClient.Get(url).NoCache().Await() response = HttpClient.Get(url).NoCache().Cancellation(cancellation).Await()
if not response.IsSuccess() if not response.IsSuccess()
testNode.state = "failed" testNode.state = "failed"
@@ -269,14 +270,14 @@ function CanFetchVideoThumbails(instance as string, testNode as object) as void
json = response.Json() json = response.Json()
if json = invalid if json = invalid
testNode.state = "failed" testNode.state = "failed"
testNode.details = `Invalid json from ${url}` testNode.details = Tr(Locale.InvidiousTesting.InvalidJsonFrom).Replace("%1", url)
return return
end if end if
videoThumbnails = json.videoThumbnails videoThumbnails = json.videoThumbnails
if not IsArray(videoThumbnails) or videoThumbnails.Count() = 0 if not IsArray(videoThumbnails) or videoThumbnails.Count() = 0
testNode.state = "failed" testNode.state = "failed"
testNode.details = `No thumbnails found in json from ${url}` testNode.details = Tr(Locale.InvidiousTesting.NoThumbnailsFoundInJson).Replace("%1", url)
return return
end if end if
@@ -284,28 +285,28 @@ function CanFetchVideoThumbails(instance as string, testNode as object) as void
thumbnail = contentNode.thumbnail thumbnail = contentNode.thumbnail
if StringUtils.IsNullOrEmpty(thumbnail) if StringUtils.IsNullOrEmpty(thumbnail)
testNode.state = "failed" testNode.state = "failed"
testNode.details = `No thumbnail found in json from ${url}` testNode.details = Tr(Locale.InvidiousTesting.NoThumbnailsFoundInJson).Replace("%1", url)
return return
end if end if
' Note: we could do a HEAD request, but Invidious returns 200 even for invalid thumbnails ' Note: we could do a HEAD request, but Invidious returns 200 even for invalid thumbnails
' To make sure we don't get a 200 for an invalid thumbnail, we do a GET request instead ' To make sure we don't get a 200 for an invalid thumbnail, we do a GET request instead
response = HttpClient.Get(thumbnail).NoCache().Await() response = HttpClient.Get(thumbnail).NoCache().Cancellation(cancellation).Await()
if not response.IsSuccess() if not response.IsSuccess()
testNode.state = "failed" testNode.state = "failed"
testNode.details = `${thumbnail} is not reachable\n${response.ErrorMessage(false)}` testNode.details = Tr(Locale.InvidiousTesting.ThumbnailNotReachable).Replace("%1", thumbnail) + `\n` + response.ErrorMessage(false)
return return
end if end if
contentType = response.Headers()["Content-Type"] contentType = response.Headers()["Content-Type"]
if StringUtils.IsNullOrEmpty(contentType) or not contentType.StartsWith("image/") if StringUtils.IsNullOrEmpty(contentType) or not contentType.StartsWith("image/")
testNode.state = "failed" testNode.state = "failed"
testNode.details = `Invalid thumbnail data ${thumbnail} (Content-Type is not image/*)` testNode.details = Tr(Locale.InvidiousTesting.InvalidThumbnailData).Replace("%1", thumbnail)
return return
end if end if
testNode.state = "passed" testNode.state = "passed"
testNode.details = `The instance can fetch video thumbnail for id "${videoId}" (${thumbnail})` testNode.details = Tr(Locale.InvidiousTesting.TheInstanceCanFetchVideoThumbnails).Replace("%1", videoId).Replace("%2", thumbnail)
catch e catch e
testNode.state = "failed" testNode.state = "failed"
testNode.details = ErrorUtils.Format(e) testNode.details = ErrorUtils.Format(e)
@@ -3,7 +3,9 @@ import "pkg:/source/AsyncTask/AsyncTask.bs"
import "pkg:/source/AsyncTask/Tasks.bs" import "pkg:/source/AsyncTask/Tasks.bs"
import "pkg:/source/utils/ErrorUtils.bs" import "pkg:/source/utils/ErrorUtils.bs"
import "pkg:/source/utils/FocusManagement.bs" import "pkg:/source/utils/FocusManagement.bs"
import "pkg:/source/utils/Locale.bs"
import "pkg:/source/utils/Logging.bs" import "pkg:/source/utils/Logging.bs"
import "pkg:/source/utils/MathUtils.bs"
function Init() function Init()
m.failedLabel = m.top.findNode("failedLabel") m.failedLabel = m.top.findNode("failedLabel")
@@ -16,11 +18,58 @@ function Init()
m.busyspinner.poster.height = 100 m.busyspinner.poster.height = 100
m.busySpinner.poster.uri = "pkg:/images/spinner.png" m.busySpinner.poster.uri = "pkg:/images/spinner.png"
InitHeader()
m.instances.ObserveField("itemSelected", FuncName(OnInstanceSelected)) m.instances.ObserveField("itemSelected", FuncName(OnInstanceSelected))
m.refreshButton.ObserveField("buttonSelected", FuncName(Refresh)) m.refreshButton.ObserveField("buttonSelected", FuncName(Refresh))
Refresh() Refresh()
end function end function
function InitHeader()
fields = ["name", "version", "users", "signup", "location", "health"]
fieldLabels = ["nameLabel", "versionLabel", "usersLabel", "signupLabel", "locationLabel", "healthLabel"]
fieldWidths = {
"name": 240
"version": 220
"users": 80
"signup": 70
"location": 65
"health": 65
}
totalWidth = 0
for i = 0 to fields.Count() - 1
field = fields[i]
label = m.instancesHeader.findNode(fieldLabels[i])
label.text = Tr(field)
rect = label.boundingRect()
rectWidth = rect.width
if i < fields.Count() - 1
rectWidth += 10
end if
width = MathUtils.Max(rectWidth, fieldWidths[field])
fieldWidths[field] = width
label.width = width
totalWidth += width
end for
m.fieldWidths = fieldWidths
m.top.width = totalWidth
end function
function OnWidthChange() as void
width = m.top.width
if width = 0
return
end if
m.instances.itemSize = [width, m.instances.itemSize[1]]
m.busySpinner.translation = [width / 2 - 50, m.busySpinner.translation[1]]
m.failedLabel.width = width
m.refreshButton.translation = [width / 2, m.refreshButton.translation[1]]
end function
function OnFocusChange() as void function OnFocusChange() as void
if not m.top.focus if not m.top.focus
return return
@@ -45,6 +94,7 @@ function Refresh()
m.invidiousPublicInstancesTask = AsyncTask.Start(Tasks.InvidiousPublicInstancesTask, { m.invidiousPublicInstancesTask = AsyncTask.Start(Tasks.InvidiousPublicInstancesTask, {
listNode: m.instances listNode: m.instances
fieldWidths: m.fieldWidths
}, OnInvidiousPublicInstancesTaskResults) }, OnInvidiousPublicInstancesTaskResults)
m.busySpinner.visible = true m.busySpinner.visible = true
@@ -71,8 +121,8 @@ function OnInvidiousPublicInstancesTaskResults(output as object) as void
error = ErrorUtils.Format(error) error = ErrorUtils.Format(error)
LogError(output.error) LogError(output.error)
message = `Failed to load Invidious public instances\n${error}` message = Tr(Locale.Dialogs.FailedToLoadInvidiousPublicInstances) + `\n${error}`
DialogUtils.ShowDialog(message, "Invidious public instances load error", true) DialogUtils.ShowDialog(message, Tr(Locale.Dialogs.InvidiousPublicInstancesLoadError), true)
m.failedLabel.visible = true m.failedLabel.visible = true
m.refreshButton.visible = true m.refreshButton.visible = true
@@ -1,6 +1,7 @@
<component name="InvidiousPublicInstances" extends="Group" includes="Focus"> <component name="InvidiousPublicInstances" extends="Group" includes="Focus">
<interface> <interface>
<field id="instance" type="string" /> <field id="instance" type="string" />
<field id="width" type="float" onChange="OnWidthChange" />
</interface> </interface>
<children> <children>
<BusySpinner <BusySpinner
@@ -10,23 +11,19 @@
<Label <Label
id="failedLabel" id="failedLabel"
text="Failed to load Invidious public instances." text="Failed to load Invidious public instances."
translation="[190,60]" /> horizAlign="center"
<Button translation="[0,60]"
id="refreshButton" width="960" />
minWidth="180"
text="Refresh"
translation="[340,130]" />
<InvidiousPublicInstancesListItem id="instancesHeader"> <ButtonEx
<InvidiousPublicInstancesListItemContent id="refreshButton"
role="itemContent" iconVisible="false"
name="name" text="Refresh"
version="version" anchor="[0.5,0]"
users="users" padding="[30,30]"
signup="signup" translation="[430,130]" />
location="location"
health="health" /> <InvidiousPublicInstancesListItem id="instancesHeader" />
</InvidiousPublicInstancesListItem>
<MarkupGrid <MarkupGrid
id="instances" id="instances"
@@ -1,5 +1,8 @@
function OnContentSet() as void function OnContentSet() as void
content = m.top.itemContent content = m.top.itemContent
if content = invalid
return
end if
m.top.name = content.name m.top.name = content.name
m.top.version = content.version m.top.version = content.version
@@ -8,4 +11,19 @@ function OnContentSet() as void
m.top.location = content.location m.top.location = content.location
m.top.flag = content.flag m.top.flag = content.flag
m.top.health = content.health m.top.health = content.health
fieldWidths = content.fieldWidths
labels = {
"name": "nameLabelWidth"
"version": "versionLabelWidth"
"users": "usersLabelWidth"
"signup": "signupLabelWidth"
"location": "locationLabelWidth"
"health": "healthLabelWidth"
}
for each label in labels
m.top[labels[label]] = fieldWidths[label]
end for
end function end function
@@ -1,6 +1,7 @@
<component name="InvidiousPublicInstancesListItem" extends="Group"> <component name="InvidiousPublicInstancesListItem" extends="Group">
<interface> <interface>
<field id="itemContent" type="node" onChange="OnContentSet" /> <field id="itemContent" type="node" onChange="OnContentSet" />
<field id="name" type="string" alias="nameLabel.text" /> <field id="name" type="string" alias="nameLabel.text" />
<field id="version" type="string" alias="versionLabel.text" /> <field id="version" type="string" alias="versionLabel.text" />
<field id="users" type="string" alias="usersLabel.text" /> <field id="users" type="string" alias="usersLabel.text" />
@@ -8,41 +9,24 @@
<field id="location" type="string" alias="locationLabel.text" /> <field id="location" type="string" alias="locationLabel.text" />
<field id="flag" type="string" alias="flagEmoji.uri" /> <field id="flag" type="string" alias="flagEmoji.uri" />
<field id="health" type="string" alias="healthLabel.text" /> <field id="health" type="string" alias="healthLabel.text" />
<field id="nameLabelWidth" type="float" alias="nameLabel.width" />
<field id="versionLabelWidth" type="float" alias="versionLabel.width" />
<field id="usersLabelWidth" type="float" alias="usersLabel.width" />
<field id="signupLabelWidth" type="float" alias="signupLabel.width" />
<field id="locationLabelWidth" type="float" alias="locationLabel.width" />
<field id="healthLabelWidth" type="float" alias="healthLabel.width" />
</interface> </interface>
<children> <children>
<Label <LayoutGroup layoutDirection="horiz">
id="nameLabel" <Label id="nameLabel" font="font:SmallestSystemFont" />
font="font:SmallestSystemFont" <Label id="versionLabel" font="font:SmallestSystemFont" />
width="240" /> <Label id="usersLabel" font="font:SmallestSystemFont" />
<Label <Label id="signupLabel" font="font:SmallestSystemFont" />
id="versionLabel" <Label id="locationLabel" font="font:SmallestSystemFont">
font="font:SmallestSystemFont" <Poster id="flagEmoji" width="16" height="16" />
width="220" </Label>
translation="[240,0]" /> <Label id="healthLabel" font="font:SmallestSystemFont" />
<Label </LayoutGroup>
id="usersLabel"
font="font:SmallestSystemFont"
width="100"
translation="[460,0]" />
<Label
id="signupLabel"
font="font:SmallestSystemFont"
width="90"
translation="[550,0]" />
<Label
id="locationLabel"
font="font:SmallestSystemFont"
width="100"
translation="[650,0]" />
<Poster
id="flagEmoji"
width="16"
height="16"
translation="[650,0]" />
<Label
id="healthLabel"
font="font:SmallestSystemFont"
width="60"
translation="[750,0]" />
</children> </children>
</component> </component>
@@ -8,5 +8,6 @@
<field id="flag" type="string" /> <field id="flag" type="string" />
<field id="health" type="string" /> <field id="health" type="string" />
<field id="uri" type="string" /> <field id="uri" type="string" />
<field id="fieldWidths" type="assocarray" />
</interface> </interface>
</component> </component>
@@ -5,6 +5,7 @@ import "pkg:/source/utils/Logging.bs"
@asynctask @asynctask
function InvidiousPublicInstancesTask(input as object) as object function InvidiousPublicInstancesTask(input as object) as object
listNode = input.listNode listNode = input.listNode
fieldWidths = input.fieldWidths
if m.top.cancel if m.top.cancel
return invalid return invalid
@@ -29,7 +30,7 @@ function InvidiousPublicInstancesTask(input as object) as object
content = CreateObject("roSGNode", "ContentNode") content = CreateObject("roSGNode", "ContentNode")
for each instance in instances for each instance in instances
item = CreateListItemContent(instance) item = CreateListItemContent(instance, fieldWidths)
if item = invalid if item = invalid
continue for continue for
end if end if
@@ -61,7 +62,7 @@ function FilterInstances(instances as object) as object
return filtered return filtered
end function end function
function CreateListItemContent(instance as object) as object function CreateListItemContent(instance as object, fieldWidths as object) as object
if not IsArray(instance) or instance.Count() < 2 if not IsArray(instance) or instance.Count() < 2
LogWarn("Invalid instance:", instance) LogWarn("Invalid instance:", instance)
return invalid return invalid
@@ -72,12 +73,13 @@ function CreateListItemContent(instance as object) as object
name: instance[0] name: instance[0]
version: DrillIntoObject(instance[1], ["stats", "software", "version"], "N/A") version: DrillIntoObject(instance[1], ["stats", "software", "version"], "N/A")
users: DrillIntoObject(instance[1], ["stats", "usage", "users", "total"], "N/A") users: DrillIntoObject(instance[1], ["stats", "usage", "users", "total"], "N/A")
signup: DrillIntoObject(instance[1], ["stats", "openRegistrations"], false) ? "Yes" : "No" signup: Tr(DrillIntoObject(instance[1], ["stats", "openRegistrations"], false) ? "Yes" : "No")
' Leave 5 spaces for the flag, just to simplify the layout ' Leave 5 spaces for the flag, just to simplify the layout
location: ` ${DrillIntoObject(instance[1], ["region"], "N/A")}` location: ` ${DrillIntoObject(instance[1], ["region"], "N/A")}`
flag: GetFlagUrl(DrillIntoObject(instance[1], ["flag"], "")) flag: GetFlagUrl(DrillIntoObject(instance[1], ["flag"], ""))
health: DrillIntoObject(instance[1], ["monitor", "30dRatio", "ratio"], "N/A") health: DrillIntoObject(instance[1], ["monitor", "30dRatio", "ratio"], "N/A")
uri: instance[1].uri uri: instance[1].uri
fieldWidths: fieldWidths
}) })
return item return item
@@ -57,7 +57,7 @@ function OnOptionsChange()
for i = 0 to options.Count() - 1 for i = 0 to options.Count() - 1
option = options[i].displayText option = options[i].displayText
node = CreateObject("roSGNode", "ContentNode") node = CreateObject("roSGNode", "ContentNode")
node.title = option node.title = Tr(option)
m.radioButtonListContent.appendChild(node) m.radioButtonListContent.appendChild(node)
end for end for
@@ -1,3 +1,4 @@
import "pkg:/source/utils/MathUtils.bs"
import "pkg:/source/utils/Types.bs" import "pkg:/source/utils/Types.bs"
function Init() function Init()
@@ -21,7 +22,10 @@ function Resize()
width = rect.width + m.top.padding * 2 width = rect.width + m.top.padding * 2
height = rect.height + m.top.padding * 2 height = rect.height + m.top.padding * 2
m.top.minWidth = width < m.top.minimumWidth ? m.top.minimumWidth : width m.top.contentWidth = width
m.top.contentHeight = height
m.top.minWidth = MathUtils.Max(m.top.minimumWidth, width)
m.top.height = height m.top.height = height
m.container.translation = [m.top.padding, m.top.padding] m.container.translation = [m.top.padding, m.top.padding]
@@ -1,7 +1,9 @@
<component name="SettingCategory" extends="Button"> <component name="SettingCategory" extends="Button">
<interface> <interface>
<field id="padding" type="integer" value="15" onChange="Resize" /> <field id="padding" type="float" value="15" onChange="Resize" />
<field id="minimumWidth" type="integer" value="280" onChange="Resize" /> <field id="minimumWidth" type="float" value="280" onChange="Resize" />
<field id="contentWidth" type="float" />
<field id="contentHeight" type="float" />
<field id="displayText" type="string" alias="DisplayTextLabel.text" onChange="Resize" /> <field id="displayText" type="string" alias="DisplayTextLabel.text" onChange="Resize" />
<field id="description" type="string" alias="DescriptionLabel.text" onChange="Resize" /> <field id="description" type="string" alias="DescriptionLabel.text" onChange="Resize" />
<field id="textColor2" type="Color" value="0xb4b4b4ff" /> <field id="textColor2" type="Color" value="0xb4b4b4ff" />
@@ -9,13 +11,11 @@
</interface> </interface>
<children> <children>
<LayoutGroup id="Container" itemSpacings="[5]"> <LayoutGroup id="Container" itemSpacings="[5]">
<SimpleLabel <Label id="DisplayTextLabel">
id="DisplayTextLabel" <Font role="font" uri="font:SystemFontFile" size="34" />
fontUri="font:SystemFontFile" </Label>
fontSize="34" /> <Label id="DescriptionLabel"
<SimpleLabel id="DescriptionLabel" font="font:SmallestSystemFont"
fontUri="font:SystemFontFile"
fontSize="18"
translation="[0,42]" /> translation="[0,42]" />
</LayoutGroup> </LayoutGroup>
</children> </children>
@@ -20,10 +20,10 @@ function OnNodeReady()
startX = 150 startX = 150
startY = 100 startY = 100
controlsX = 400 controlsX = 450
categorySpacing = 80 categorySpacing = 50
controlSpacing = 30 controlSpacing = 25
model = m.preferences.prefsModel model = m.preferences.prefsModel
previousCategory = invalid previousCategory = invalid
@@ -73,8 +73,8 @@ end function
function CreateCategoryNode(item as object, container as object, startX as integer, startY as integer) as object function CreateCategoryNode(item as object, container as object, startX as integer, startY as integer) as object
node = container.createChild("SettingCategory") node = container.createChild("SettingCategory")
node.translation = [startX, startY] node.translation = [startX, startY]
node.displayText = item.displayText node.displayText = Tr(item.displayText)
node.description = item.description node.description = Tr(item.description)
return { return {
node: node node: node
rect: node.boundingRect() rect: node.boundingRect()
@@ -152,30 +152,30 @@ end function
function CreateBooleanControl(item as object, container as object) as object function CreateBooleanControl(item as object, container as object) as object
node = container.createChild("BooleanControl") node = container.createChild("BooleanControl")
node.displayText = item.displayText node.displayText = Tr(item.displayText)
node.description = item.description node.description = Tr(item.description)
return node return node
end function end function
function CreateRadioControl(item as object, container as object) as object function CreateRadioControl(item as object, container as object) as object
node = container.createChild("RadioControl") node = container.createChild("RadioControl")
node.displayText = item.displayText node.displayText = Tr(item.displayText)
node.description = item.description node.description = Tr(item.description)
node.options = item.options node.options = item.options
return node return node
end function end function
function CreateStringControl(item as object, container as object) as object function CreateStringControl(item as object, container as object) as object
node = container.createChild("StringControl") node = container.createChild("StringControl")
node.displayText = item.displayText node.displayText = Tr(item.displayText)
node.description = item.description node.description = Tr(item.description)
return node return node
end function end function
function CreateNumberComponent(item as object, container as object) as object function CreateNumberComponent(item as object, container as object) as object
node = container.createChild("NumberControl") node = container.createChild("NumberControl")
node.displayText = item.displayText node.displayText = Tr(item.displayText)
node.description = item.description node.description = Tr(item.description)
if IsInt(item.min) if IsInt(item.min)
node.min = item.min node.min = item.min
end if end if
@@ -188,10 +188,10 @@ end function
function CreateRokuComponent(item as object, container as object) as object function CreateRokuComponent(item as object, container as object) as object
node = container.createChild(item.rokuComponent) node = container.createChild(item.rokuComponent)
if node.hasField("displayText") if node.hasField("displayText")
node.displayText = item.displayText node.displayText = Tr(item.displayText)
end if end if
if node.hasField("description") if node.hasField("description")
node.description = item.description node.description = Tr(item.description)
end if end if
return node return node
end function end function
@@ -1,5 +1,6 @@
import "pkg:/components/Dialog/DialogPalette.bs" import "pkg:/components/Dialog/DialogPalette.bs"
import "pkg:/source/utils/FocusManagement.bs" import "pkg:/source/utils/FocusManagement.bs"
import "pkg:/source/utils/Locale.bs"
import "pkg:/source/utils/Types.bs" import "pkg:/source/utils/Types.bs"
function Init() function Init()
@@ -70,7 +71,7 @@ function ShowEditKeyboard()
keyboardDialog.title = m.top.displayText keyboardDialog.title = m.top.displayText
keyboardDialog.message = [m.top.description] keyboardDialog.message = [m.top.description]
keyboardDialog.text = m.top.value keyboardDialog.text = m.top.value
keyboardDialog.buttons = ["OK", "Cancel"] keyboardDialog.buttons = [Tr(Locale.Buttons.OK), Tr(Locale.Buttons.Cancel)]
keyboardDialog.observeField("buttonSelected", FuncName(OnKeyboardButton)) keyboardDialog.observeField("buttonSelected", FuncName(OnKeyboardButton))
m.top.getScene().dialog = keyboardDialog m.top.getScene().dialog = keyboardDialog
@@ -1,14 +1,11 @@
import "pkg:/components/ContextMenu/ContextMenuUtils.bs" import "pkg:/components/ContextMenu/ContextMenuUtils.bs"
import "pkg:/source/utils/CryptoUtils.bs" import "pkg:/source/utils/CryptoUtils.bs"
import "pkg:/source/utils/Locale.bs"
import "pkg:/source/utils/Logging.bs" import "pkg:/source/utils/Logging.bs"
import "pkg:/source/utils/RegistryUtils.bs" import "pkg:/source/utils/RegistryUtils.bs"
import "pkg:/source/utils/StringUtils.bs" import "pkg:/source/utils/StringUtils.bs"
import "pkg:/source/utils/Types.bs" import "pkg:/source/utils/Types.bs"
const VIDEOS_GROUP = "Videos"
const CHANNELS_GROUP = "Channels"
const PLAYLISTS_GROUP = "Playlists"
function Init() function Init()
m.top.content = m.top.findNode("content") m.top.content = m.top.findNode("content")
m.bookmarksString = "" m.bookmarksString = ""
@@ -140,7 +137,7 @@ function AddPlaylistBookmarkWithSpread(id as string, groupName as string)
feedSource = { feedSource = {
"id": `inv_playlist_${id}` "id": `inv_playlist_${id}`
"title": `${groupName} videos` "title": `${groupName} ${Tr(Locale.Feed.Videos)}`
"apiType": "Invidious" "apiType": "Invidious"
"endpoint": "playlist" "endpoint": "playlist"
"pathParams": { "pathParams": {
@@ -177,7 +174,7 @@ function AddChannelBookmarkWithSpread(id as string, groupName as string)
feedSource = { feedSource = {
"id": `inv_channel_videos_${id}` "id": `inv_channel_videos_${id}`
"title": `${groupName} videos` "title": `${groupName} ${Tr(Locale.Feed.Videos)}`
"apiType": "Invidious" "apiType": "Invidious"
"endpoint": "channel_videos" "endpoint": "channel_videos"
"pathParams": { "pathParams": {
@@ -241,10 +238,14 @@ function GetMenuForVideo(videoNode as object) as object
isInBookmarks = bookmark <> invalid isInBookmarks = bookmark <> invalid
if isInBookmarks if isInBookmarks
bookmarkGroup = bookmark.getParent() bookmarkGroup = bookmark.getParent()
item = ContextMenuUtils.CreateOption(`Remove from "${bookmarkGroup.title}" bookmarks`, m.top, "RemoveBookmark", [videoId]) title = Tr(Locale.ContextMenu.RemoveFromBookmarks).Replace("%1", `"${bookmarkGroup.title}"`)
item = ContextMenuUtils.CreateOption(title, m.top, "RemoveBookmark", [videoId])
menu.push(item) menu.push(item)
else else
item = ContextMenuUtils.CreateOption(`Add to "${VIDEOS_GROUP}" bookmark`, m.top, "AddVideoBookmark", [videoId, VIDEOS_GROUP]) ' "Videos" exists in feed
group = Tr(Locale.Feed.Videos)
title = Tr(Locale.ContextMenu.AddToBookmark).Replace("%1", `"${group}"`)
item = ContextMenuUtils.CreateOption(title, m.top, "AddVideoBookmark", [videoId, group])
menu.push(item) menu.push(item)
end if end if
return menu return menu
@@ -261,13 +262,18 @@ function GetMenuForPlaylist(playlistNode as object) as object
isInBookmarks = bookmark <> invalid isInBookmarks = bookmark <> invalid
if isInBookmarks if isInBookmarks
bookmarkGroup = bookmark.getParent() bookmarkGroup = bookmark.getParent()
item = ContextMenuUtils.CreateOption(`Remove from "${bookmarkGroup.title}" bookmarks`, m.top, "RemoveBookmark", [playlistId]) title = Tr(Locale.ContextMenu.RemoveFromBookmarks).Replace("%1", `"${bookmarkGroup.title}"`)
item = ContextMenuUtils.CreateOption(title, m.top, "RemoveBookmark", [playlistId])
menu.push(item) menu.push(item)
else else
item = ContextMenuUtils.CreateOption(`Add to "${PLAYLISTS_GROUP}" bookmark`, m.top, "AddPlaylistBookmark", [playlistId, PLAYLISTS_GROUP]) ' "Playlists" exists in feed
group = Tr(Locale.Feed.Playlists)
title = Tr(Locale.ContextMenu.AddToBookmark).Replace("%1", `"${group}"`)
item = ContextMenuUtils.CreateOption(title, m.top, "AddPlaylistBookmark", [playlistId, group])
menu.push(item) menu.push(item)
item = ContextMenuUtils.CreateOption(`Add to "${playlistNode.title}" bookmark`, m.top, "AddPlaylistBookmarkWithSpread", [playlistId, playlistNode.title]) title = Tr(Locale.ContextMenu.AddToBookmark).Replace("%1", `"${playlistNode.title}"`)
item = ContextMenuUtils.CreateOption(title, m.top, "AddPlaylistBookmarkWithSpread", [playlistId, playlistNode.title])
menu.push(item) menu.push(item)
end if end if
return menu return menu
@@ -284,13 +290,17 @@ function GetMenuForChannel(channelNode as object) as object
isInBookmarks = bookmark <> invalid isInBookmarks = bookmark <> invalid
if isInBookmarks if isInBookmarks
bookmarkGroup = bookmark.getParent() bookmarkGroup = bookmark.getParent()
item = ContextMenuUtils.CreateOption(`Remove from "${bookmarkGroup.title}" bookmarks`, m.top, "RemoveBookmark", [authorId]) title = Tr(Locale.ContextMenu.RemoveFromBookmarks).Replace("%1", `"${bookmarkGroup.title}"`)
item = ContextMenuUtils.CreateOption(title, m.top, "RemoveBookmark", [authorId])
menu.push(item) menu.push(item)
else else
item = ContextMenuUtils.CreateOption(`Add to "${CHANNELS_GROUP}" bookmark`, m.top, "AddChannelBookmark", [authorId, CHANNELS_GROUP]) group = Tr(Locale.Bookmarks.Channels)
title = Tr(Locale.ContextMenu.AddToBookmark).Replace("%1", `"${group}"`)
item = ContextMenuUtils.CreateOption(title, m.top, "AddChannelBookmark", [authorId, group])
menu.push(item) menu.push(item)
item = ContextMenuUtils.CreateOption(`Add to "${channelNode._author}" bookmark`, m.top, "AddChannelBookmarkWithSpread", [authorId, channelNode._author]) title = Tr(Locale.ContextMenu.AddToBookmark).Replace("%1", `"${channelNode._author}"`)
item = ContextMenuUtils.CreateOption(title, m.top, "AddChannelBookmarkWithSpread", [authorId, channelNode._author])
menu.push(item) menu.push(item)
end if end if
return menu return menu
@@ -316,17 +326,19 @@ function GetMenuForParentFeedSource(itemNode as object) as object
return [] return []
end if end if
title = feedSource.title feedSourceTitle = feedSource.title
feedSourceId = feedSource.id feedSourceId = feedSource.id
menu = [] menu = []
isInBookmarks = m.top.content.findNode(feedSourceId) <> invalid isInBookmarks = m.top.content.findNode(feedSourceId) <> invalid
if isInBookmarks if isInBookmarks
item = ContextMenuUtils.CreateOption(`Remove "${feedSource.title}" from bookmarks`, m.top, "RemoveBookmark", [feedSourceId]) title = Tr(Locale.ContextMenu.RemoveFromBookmarks).Replace("%1", `"${feedSourceTitle}"`)
item = ContextMenuUtils.CreateOption(title, m.top, "RemoveBookmark", [feedSourceId])
menu.push(item) menu.push(item)
else else
item = ContextMenuUtils.CreateOption(`Add to "${title}" bookmark`, m.top, "AddFeedSourceBookmark", [feedSource, feedSourceId, title]) title = Tr(Locale.ContextMenu.AddToBookmark).Replace("%1", `"${feedSourceTitle}"`)
item = ContextMenuUtils.CreateOption(title, m.top, "AddFeedSourceBookmark", [feedSource, feedSourceId, feedSourceTitle])
menu.push(item) menu.push(item)
end if end if
return menu return menu
@@ -1,4 +1,4 @@
<component name="Bookmarks" extends="Node" includes="ContextMenuProvider"> <component name="BookmarksService" extends="Node" includes="ContextMenuProvider">
<interface> <interface>
<field id="__version" type="integer" value="1" /> <field id="__version" type="integer" value="1" />
<field id="content" type="node" /> <field id="content" type="node" />
Loaded 100 of 229 files, more files were not shown because too many files have changed in this diff. Show more