Compare commits

..
97 Commits
Author SHA1 Message Date
Brahim Hadriche c156865de7 Release v0.23.1 (#364) 2024-04-24 09:19:53 -04:00
Brahim Hadriche faa4b928d9 Add announcement 2024-04-24 09:14:10 -04:00
github-actions[bot]andiBicha 254efb289d update dependencies (#363)
Co-authored-by: iBicha <iBicha@users.noreply.github.com>
2024-04-19 20:37:17 -04:00
github-actions[bot]andiBicha 151d05831c update dependencies (#361)
Co-authored-by: iBicha <iBicha@users.noreply.github.com>
2024-04-12 20:38:25 -04:00
Brahim Hadriche e35fad7d9c Small fix in dial server 2024-04-10 17:49:09 -04:00
Brahim Hadriche f15202593b [skip ci] Update README badge 2024-04-08 09:03:42 -04:00
Brahim Hadriche 58b3405cdc [skip ci] update todos 2024-04-07 11:09:06 -04:00
github-actions[bot]andiBicha 2b1e0fa154 update dependencies (#359)
Co-authored-by: iBicha <iBicha@users.noreply.github.com>
2024-04-05 23:06:53 -04:00
Brahim Hadriche 8a9f0e4dfa small fix 2024-04-04 17:54:10 -04:00
Brahim Hadriche 7ebccaa812 Add on device prerelease testing 2024-04-04 17:49:50 -04:00
Brahim Hadriche 23336c36e8 Navbar version fix 2024-04-04 13:43:46 -04:00
Brahim Hadriche 117fe0ce81 fix for lib selector 2024-04-04 13:37:49 -04:00
Brahim Hadriche 005bf0146d Update changelog 2024-04-04 12:44:49 -04:00
Brahim Hadriche 3697eafc43 Release v0.23.0 (#358) 2024-04-04 12:22:14 -04:00
Brahim Hadriche c741466a85 shorten link in web app 2024-04-04 11:24:20 -04:00
Brahim Hadriche 1cbb52fad4 Load playlet lib as squashfs (#357)
* Load playlet lib as squashfs

* typo
2024-04-04 11:10:23 -04:00
Brahim Hadriche b534ea68db Feature/squashfs (#356)
* shorten link

* Add zip to squash

* squashfs signing

* Format

* add secrets

* release fix

* revert testing

* check for needed commands

* changelog
2024-04-03 17:31:35 -04:00
Brahim Hadriche dc7cded3f5 shorten link 2024-04-02 13:32:03 -04:00
Brahim Hadriche 76a57af5a0 use short git commit hash 2024-04-02 12:13:15 -04:00
Brahim Hadriche e73fc9ab72 http logging tweak 2024-04-02 09:31:35 -04:00
Brahim Hadriche cac9090f4d Fix for disabled popular endpoint 2024-04-01 09:42:30 -04:00
Brahim Hadriche b8ed900769 Adjust web app video rows 2024-04-01 08:29:21 -04:00
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
Brahim Hadriche 1ba5184d95 Release v0.21.1 (#323) 2024-03-09 22:59:04 -05:00
Brahim Hadriche 26ed985ecc Bug fixes 2024-03-09 22:55:07 -05:00
Brahim Hadriche 6b47440cb5 Add launch arg to clear 2024-03-09 19:09:11 -05:00
Brahim Hadriche ee3312763d Add a loading indicator to QR codes 2024-03-09 18:34:32 -05:00
Brahim Hadriche 7bb73e0fb6 Dev video player (#321) 2024-03-09 08:44:32 -05:00
f71ad7b873 [chore] update dependencies (#320)
* update dependencies

* no message

---------

Co-authored-by: iBicha <iBicha@users.noreply.github.com>
Co-authored-by: Brahim Hadriche <brahim.hadriche@gmail.com>
2024-03-08 23:30:09 -05:00
Brahim Hadriche 0f6329997d tweak optional chaining rule 2024-03-08 23:14:32 -05:00
Brahim Hadriche 58918f68fb Add a /watch endpoint for easier casting 2024-03-08 13:19:40 -05:00
Brahim Hadriche 8a63bc848d Disallow optional chaining operator 2024-03-08 12:06:41 -05:00
Brahim Hadriche 9315fa6cf7 Added subscriber count in the channel page 2024-03-07 23:12:35 -05:00
267 changed files with 6798 additions and 2078 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
+21 -11
View File
@@ -17,26 +17,36 @@ 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
run: npm ci run: npm ci
- name: Build tests - name: Run tests
run: npm run test:build run: npm run test
env:
ROKU_DEV_TARGET: ${{ secrets.ROKU_DEV_TARGET }}
ROKU_DEV_TARGET_PORT: ${{ secrets.ROKU_DEV_TARGET_PORT }}
ROKU_DEVPASSWORD: ${{ secrets.ROKU_DEVPASSWORD }}
ROKU_DEV_TARGET_TELNET_PORT: ${{ secrets.ROKU_DEV_TARGET_TELNET_PORT }}
- name: Build Playlet - name: Build Playlet for release
run: npm run build:release:ci run: npm run build:release
env:
ROKU_DEV_TARGET: ${{ secrets.ROKU_DEV_TARGET }}
ROKU_DEV_TARGET_PORT: ${{ secrets.ROKU_DEV_TARGET_PORT }}
ROKU_DEVPASSWORD: ${{ secrets.ROKU_DEVPASSWORD }}
ROKU_SIGN_PASSWORD: ${{ secrets.ROKU_SIGN_PASSWORD }}
- 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: |
@@ -70,6 +80,6 @@ jobs:
run: sleep 10 run: sleep 10
- name: Create Canary release - name: Create Canary release
run: gh release create canary ./release/playlet.zip ./release/playlet-lib.zip --notes-file docs/canary-changelog.md --prerelease --title Canary run: gh release create canary ./release/playlet.zip ./release/playlet.squashfs.pkg ./release/playlet-lib.zip ./release/playlet-lib.squashfs.pkg --notes-file docs/canary-changelog.md --prerelease --title Canary
env: env:
GH_TOKEN: ${{ secrets.GH_TOKEN }} GH_TOKEN: ${{ secrets.GH_TOKEN }}
+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,
+78 -4
View File
@@ -2,9 +2,83 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.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.23.1] - 2024-04-24
### Added
- Announcement dialog to indicate outage
## [0.23.0] - 2024-04-04
### Added
- Loading Playlet lib as squashfs, with fallback to the zip file. This significantly decreases load times.
### Changed
- Bumped minimum OS version to 11, this is required for squashfs-zstd
## [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
### Added
- Subscriber count in the channel page
### Fixed
- A bug where videos that did not premiere yet would error with a playback error
- A bug where a playback error dialog is dismissed too fast before playing the next video
## [0.21.0] - 2024-03-07 ## [0.21.0] - 2024-03-07
### Added ### Added
@@ -22,7 +96,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
@@ -124,7 +198,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
@@ -369,7 +443,7 @@ This version went through a major refactor, which resulted in a different arcite
- It reads the response data, headers, error codes and etc even if they are not needed - It reads the response data, headers, error codes and etc even if they are not needed
- Excessive logging without a way to toggle it, or redirect it to a file - Excessive logging without a way to toggle it, or redirect it to a file
- Some unused parts of the code (Like basic auth in the server, WebSockets, RegistryRouter, Kanji QR Code) - Some unused parts of the code (Like basic auth in the server, WebSockets, RegistryRouter, Kanji QR Code)
- These were unsued and/or feature flagged features. Things can be restored as needed. - These were unused and/or feature flagged features. Things can be restored as needed.
- The video player loading spinner when the video is minimized: this added too much hacky code with minimum value. - The video player loading spinner when the video is minimized: this added too much hacky code with minimum value.
### Fixed ### Fixed
+4 -1
View File
@@ -7,7 +7,10 @@
</a> </a>
<a href="https://github.com/iBicha/playlet/releases"> <a href="https://github.com/iBicha/playlet/releases">
<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.squashfs.pkg.svg"/>
</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>
<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"/>
+15 -1
View File
@@ -40,6 +40,18 @@
"regex": "\\b(?!_unused)unused\\b", "regex": "\\b(?!_unused)unused\\b",
"regexFlags": "ig", "regexFlags": "ig",
"message": "unused args should start with _ (e.g. _unused)" "message": "unused args should start with _ (e.g. _unused)"
},
{
"code": "NO_OPTIONAL_CHAINING",
"regex": "\\?[\\.|\\[|\\(|@]",
"regexFlags": "ig",
"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": [
@@ -50,6 +62,7 @@
"!**/*.psd", "!**/*.psd",
"!**/*.svg", "!**/*.svg",
"!**/*.svg.meta.json5", "!**/*.svg.meta.json5",
"locale/**",
"config/**", "config/**",
"lib/**", "lib/**",
"www/**", "www/**",
@@ -73,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,
+8 -2
View File
@@ -294,14 +294,20 @@ This is mostly useful to QA the `canary` release (see [Canary release](https://e
#### In case of a softlock #### In case of a softlock
If the dev menu is used to load a custom Playlet lib url, but the lib does not have a functionality to revert back: If the dev menu is used to load a custom Playlet lib url, but you couldn't revert back:
```bash ```bash
curl -d '' "http://$ROKU_DEV_TARGET:8060/launch/dev?clearPlayletLibUrls=true" curl -d '' "http://$ROKU_DEV_TARGET:8060/launch/693751?clearPlayletLibUrls=true"
``` ```
This will remove the custom lib, and revert to using default (latest release from Github). This will remove the custom lib, and revert to using default (latest release from Github).
If you need to clear all the data from the registry, use
```bash
curl -d '' "http://$ROKU_DEV_TARGET:8060/launch/693751?clearRegistry=true"
```
## CI/CD ## CI/CD
On pull requests, a Github action will run `lint:fix` and `format:fix` and push changes to the PR branch, to keep things tidy. On pull requests, a Github action will run `lint:fix` and `format:fix` and push changes to the PR branch, to keep things tidy.
+1 -8
View File
@@ -40,11 +40,4 @@ These are mostly the steps when releasing a new version:
## Playlet ## Playlet
For releasing to the store (when needed), this is done following a Playlet lib release: For releasing to the store (when needed), signed packages are attached to Github releases, ready to publish
- Switch to main branch and pull changes, **including tags** - **match commit corresponding to the release.**
- `npm run build:release:ci`
- This makes sure to have a valid app in the staging folder
- `npm run sign-released-package`
- This should create the signed package under `release/playlet.pkg`
- Upload to dashboard, and schedule a release (takes a couple of days)
+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.0 version: 0.23.1
description: description:
Playlet Web API is a RESTful API for controlling the Playlet app on Playlet Web API is a RESTful API for controlling the Playlet app on
Roku devices. The API is intended to be used by the Playlet web app, but can Roku devices. The API is intended to be used by the Playlet web app, but can
@@ -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

+408 -102
View File
@@ -1,44 +1,45 @@
{ {
"name": "playlet", "name": "playlet",
"version": "0.21.0", "version": "0.23.1",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "playlet", "name": "playlet",
"version": "0.21.0", "version": "0.23.1",
"hasInstallScript": true, "hasInstallScript": true,
"devDependencies": { "devDependencies": {
"@rokucommunity/bslint": "^0.8.18", "@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.24", "@types/node": "^20.12.7",
"@types/xml2js": "^0.4.14", "@types/xml2js": "^0.4.14",
"argparse": "^2.0.1", "argparse": "^2.0.1",
"brighterscript": "0.65.24", "brighterscript": "0.65.27",
"brighterscript-formatter": "^1.6.41", "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.7.0",
"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.3.3", "typescript": "^5.4.5",
"xml2js": "^0.6.2", "xml2js": "^0.6.2",
"yaml": "^2.4.0" "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.18", "version": "0.8.20",
"resolved": "https://registry.npmjs.org/@rokucommunity/bslint/-/bslint-0.8.18.tgz", "resolved": "https://registry.npmjs.org/@rokucommunity/bslint/-/bslint-0.8.20.tgz",
"integrity": "sha512-wVJKxfuQNUogTlVm7idCcpVWxIG0pttdv+ZgZC3JB812Oz/8k5gpvOiy4udKJP8AgW0VwGAdebb38Cpr2hLc3g==", "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.24", "version": "20.12.7",
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.24.tgz", "resolved": "https://registry.npmjs.org/@types/node/-/node-20.12.7.tgz",
"integrity": "sha512-Kza43ewS3xoLgCEpQrsT+xRo/EJej1y0kVYGiLFE1NEODXGzTfwiC6tXTLMQskn1X4/Rjlh0MQUvx9W+L9long==", "integrity": "sha512-wq0cICSkRLVaf3UGLMGItu/PtdY7oaXaI/RVU+xliKVOtRna3PRY57ZDfztpDL0n11vfymMUnXv8QwYCO7L1wg==",
"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.24", "version": "0.65.27",
"resolved": "https://registry.npmjs.org/brighterscript/-/brighterscript-0.65.24.tgz", "resolved": "https://registry.npmjs.org/brighterscript/-/brighterscript-0.65.27.tgz",
"integrity": "sha512-l57tvVA9n7cNHZIA/Up8zQpFAWTOwwn0QjUTrTnSWG3wzRhifbnaCPMLHlHTmBlSmQcoz3fqROy6/JBQHPlFCw==", "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.6.41", "version": "1.7.1",
"resolved": "https://registry.npmjs.org/brighterscript-formatter/-/brighterscript-formatter-1.6.41.tgz", "resolved": "https://registry.npmjs.org/brighterscript-formatter/-/brighterscript-formatter-1.7.1.tgz",
"integrity": "sha512-JzgDP7bSAfglBCXBRtw5TnqYyCwsQeSMEm9zyayJgAP2TFT8kjOS6d5c7ancjC67fYlkWWBC71CRCpzC7ytwPg==", "integrity": "sha512-P5ovoRUsiYJYk0lO0X5iWtYWMOI3g0bpnVDefnh6spkYsKnz6YhG0r9zMdsvlUk2mYzkqK/pA7LTGlTbiVUa0Q==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"brighterscript": "^0.65.23", "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",
@@ -3015,9 +3079,9 @@
} }
}, },
"node_modules/mailparser": { "node_modules/mailparser": {
"version": "3.6.9", "version": "3.7.0",
"resolved": "https://registry.npmjs.org/mailparser/-/mailparser-3.6.9.tgz", "resolved": "https://registry.npmjs.org/mailparser/-/mailparser-3.7.0.tgz",
"integrity": "sha512-1fIDZlgN1NnuzmTSEUxkaViquXYkw5NbQehVc+kz55QRy98QgLdTtRSKv289Jy4NrCiDchRx6zAijB4HrPsvkA==", "integrity": "sha512-yFo1+4r3gHhTcazVGCv3D/uX5VJyyrx4iWkzKtJh8mujYIUm92kpG5BjKpZIJgEoKcKxbJVd4CPs+IImE1sKlQ==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"encoding-japanese": "2.0.0", "encoding-japanese": "2.0.0",
@@ -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.3.3", "version": "5.4.5",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz",
"integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==", "integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==",
"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",
@@ -5047,9 +5353,9 @@
"dev": true "dev": true
}, },
"node_modules/yaml": { "node_modules/yaml": {
"version": "2.4.0", "version": "2.4.1",
"resolved": "https://registry.npmjs.org/yaml/-/yaml-2.4.0.tgz", "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.4.1.tgz",
"integrity": "sha512-j9iR8g+/t0lArF4V6NE/QCfT+CO7iLqrXAHZbJdo+LfjqP1vR8Fg5bSiaq6Q2lOD1AUEVrEVIgABvBFYojJVYQ==", "integrity": "sha512-pIXzoImaqmfOrL7teGUBt/T7ZDnyeGBWyXQBvOVhLkWLN37GXv8NMLK406UY6dS51JfcQHsmcW5cJ441bHg6Lg==",
"dev": true, "dev": true,
"bin": { "bin": {
"yaml": "bin.mjs" "yaml": "bin.mjs"
+14 -15
View File
@@ -1,46 +1,46 @@
{ {
"name": "playlet", "name": "playlet",
"version": "0.21.0", "version": "0.23.1",
"description": "Unofficial YouTube client for Roku", "description": "Unofficial YouTube client for Roku",
"devDependencies": { "devDependencies": {
"@rokucommunity/bslint": "^0.8.18", "@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.24", "@types/node": "^20.12.7",
"@types/xml2js": "^0.4.14", "@types/xml2js": "^0.4.14",
"argparse": "^2.0.1", "argparse": "^2.0.1",
"brighterscript": "0.65.24", "brighterscript": "0.65.27",
"brighterscript-formatter": "^1.6.41", "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.7.0",
"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.3.3", "typescript": "^5.4.5",
"xml2js": "^0.6.2", "xml2js": "^0.6.2",
"yaml": "^2.4.0" "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",
"prebuild": "rm -rf dist", "prebuild": "rm -rf dist",
"build:dev": "npm run build:web && npm run build:lib:dev && npm run build:app:dev", "build:dev": "npm run build:web && npm run build:lib:dev && npm run build:app:dev",
"build:prod": "npm run build:web && npm run build:lib:prod && npm run build:app:prod", "build:prod": "npm run build:web && npm run build:lib:prod && npm run build:app:prod",
"build:release": "npm run build:release:ci && npm run sign-package", "build:release": "npm run format:fix && npm run lint:fix && npm run version-sync && npm run manifest-git-hash && npm run build:prod",
"build:release:ci": "npm run format:fix && npm run lint:fix && npm run version-sync && npm run manifest-git-hash && npm run build:prod",
"build:app:dev": "cd playlet-app && npm run build:dev", "build:app:dev": "cd playlet-app && npm run build:dev",
"build:app:prod": "cd playlet-app && npm run build:prod", "build:app:prod": "cd playlet-app && npm run build:prod",
"build:lib:dev": "cd playlet-lib && npm run build:dev", "build:lib:dev": "cd playlet-lib && npm run build:dev",
@@ -58,7 +58,6 @@
"test:build:lib": "cd playlet-lib && npm run test:build", "test:build:lib": "cd playlet-lib && npm run test:build",
"version-sync": "node tools/version-sync.js", "version-sync": "node tools/version-sync.js",
"manifest-git-hash": "node tools/update-manifest-git-hash.js", "manifest-git-hash": "node tools/update-manifest-git-hash.js",
"sign-package": "node tools/sign-package.js",
"sign-released-package": "node tools/sign-released-package.js", "sign-released-package": "node tools/sign-released-package.js",
"screenshot": "node tools/screenshot.js", "screenshot": "node tools/screenshot.js",
"profile-sync": "node tools/profile-sync.js", "profile-sync": "node tools/profile-sync.js",
+2 -2
View File
@@ -1,12 +1,12 @@
{ {
"name": "playlet-app", "name": "playlet-app",
"version": "0.21.0", "version": "0.23.1",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "playlet-app", "name": "playlet-app",
"version": "0.21.0" "version": "0.23.1"
} }
} }
} }
+5 -3
View File
@@ -1,14 +1,16 @@
{ {
"name": "playlet-app", "name": "playlet-app",
"version": "0.21.0", "version": "0.23.1",
"description": "Unofficial YouTube client for Roku", "description": "Unofficial YouTube client for Roku",
"scripts": { "scripts": {
"prebuild": "rm -rf build/playlet-app", "prebuild": "rm -rf ../build/playlet-app",
"prebuild:dev": "npm run prebuild", "prebuild:dev": "npm run prebuild",
"prebuild:prod": "npm run prebuild", "prebuild:prod": "npm run prebuild",
"build:dev": "bsc --create-package --debug --sourceMap=true --lintConfig ../config/bslint.jsonc", "build:dev": "bsc --create-package --debug --sourceMap=true --lintConfig ../config/bslint.jsonc",
"build:prod": "bsc --create-package --sourceMap=false --lintConfig ../config/bslint.jsonc", "build:prod": "bsc --create-package --sourceMap=false --lintConfig ../config/bslint.jsonc",
"postbuild:prod": "mkdir -p ../release && cp ../dist/playlet-app.zip ../release/playlet.zip", "postbuild:prod": "mkdir -p ../release && cp ../dist/playlet-app.zip ../release/playlet.zip && npm run squash-fs && npm run sign-package",
"squash-fs": "node ../tools/squash-fs.js --in-file ../release/playlet.zip --out-file ../release/playlet.squashfs.zip",
"sign-package": "node ../tools/sign-package.js --out-file playlet.squashfs.zip --out-dir ../release --staging-dir ../build/playlet-app",
"lint": "bslint --project bsconfig.lint.json --lintConfig ../config/bslint.jsonc", "lint": "bslint --project bsconfig.lint.json --lintConfig ../config/bslint.jsonc",
"lint:fix": "npm run lint -- --fix", "lint:fix": "npm run lint -- --fix",
"format:base": "bsfmt \"src/**/*.brs\" \"src/**/*.bs\" \"!**/bslib.brs\" \"!**/roku_modules/**/*\" \"!**/*.transpiled/**\" \"!**/*.transpiled.*\" --bsfmt-path ../config/bsfmt.jsonc", "format:base": "bsfmt \"src/**/*.brs\" \"src/**/*.bs\" \"!**/bslib.brs\" \"!**/roku_modules/**/*\" \"!**/*.transpiled/**\" \"!**/*.transpiled.*\" --bsfmt-path ../config/bsfmt.jsonc",
@@ -22,8 +22,8 @@ end function
function GetPlayletLibUrls() as object function GetPlayletLibUrls() as object
#if DEBUG #if DEBUG
debug = { type: "debug", link: Manifest.ReadValue("playlet_lib_debug_url") } debug = { type: "debug-zip", link: Manifest.ReadValue("playlet_lib_zip_debug_url") }
embedded = { type: "embedded", link: Manifest.ReadValue("playlet_lib_embedded_url") } embedded = { type: "embedded-zip", link: Manifest.ReadValue("playlet_lib_zip_embedded_url") }
#if DEBUG_FALLBACK_TO_EMBEDDED #if DEBUG_FALLBACK_TO_EMBEDDED
return [debug, embedded] return [debug, embedded]
#else #else
@@ -36,9 +36,10 @@ function GetPlayletLibUrls() as object
return savedUrls return savedUrls
end if end if
github = { type: "github", link: Manifest.ReadValue("playlet_lib_remote_url") } githubSquashFs = { type: "github-squashfs", link: Manifest.ReadValue("playlet_lib_squashfs_remote_url") }
embedded = { type: "embedded", link: Manifest.ReadValue("playlet_lib_embedded_url") } githubZip = { type: "github-zip", link: Manifest.ReadValue("playlet_lib_zip_remote_url") }
return [github, embedded] embedded = { type: "embedded-zip", link: Manifest.ReadValue("playlet_lib_zip_embedded_url") }
return [githubSquashFs, githubZip, embedded]
#end if #end if
end function end function
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',
}, },
], ],
} }
+6 -5
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=23
build_version=00000 build_version=00001
ui_resolutions=hd ui_resolutions=hd
@@ -27,9 +27,10 @@ confirm_partner_button=1
supports_input_launch=1 supports_input_launch=1
playlet_lib_remote_url=https://github.com/iBicha/playlet/releases/latest/download/playlet-lib.zip playlet_lib_squashfs_remote_url=https://github.com/iBicha/playlet/releases/latest/download/playlet-lib.squashfs.pkg
playlet_lib_embedded_url=pkg:/lib/playlet-lib.zip playlet_lib_zip_remote_url=https://github.com/iBicha/playlet/releases/latest/download/playlet-lib.zip
playlet_lib_debug_url=http://DEBUG_HOST_IP_ADDRESS:8086/playlet-lib.zip playlet_lib_zip_embedded_url=pkg:/lib/playlet-lib.zip
playlet_lib_zip_debug_url=http://DEBUG_HOST_IP_ADDRESS:8086/playlet-lib.zip
git_commit_sha=unknown git_commit_sha=unknown
+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
+1
View File
@@ -22,6 +22,7 @@ function Main(args as object) as void
Logger.Init() Logger.Init()
Registry.ClearPlayletLibUrlsIfNeeded(args) Registry.ClearPlayletLibUrlsIfNeeded(args)
Registry.ClearRegistryIfNeeded(args)
scene = screen.CreateScene("BootstrapScene") scene = screen.CreateScene("BootstrapScene")
screen.show() screen.show()
+3 -2
View File
@@ -8,8 +8,9 @@ namespace Tests
@it("Reads values from manifest") @it("Reads values from manifest")
@params("title", "Playlet") @params("title", "Playlet")
@params("supports_input_launch", "1") @params("supports_input_launch", "1")
@params("playlet_lib_remote_url", "https://github.com/iBicha/playlet/releases/latest/download/playlet-lib.zip") @params("playlet_lib_squashfs_remote_url", "https://github.com/iBicha/playlet/releases/latest/download/playlet-lib.squashfs.pkg")
@params("playlet_lib_embedded_url", "pkg:/lib/playlet-lib.zip") @params("playlet_lib_zip_remote_url", "https://github.com/iBicha/playlet/releases/latest/download/playlet-lib.zip")
@params("playlet_lib_zip_embedded_url", "pkg:/lib/playlet-lib.zip")
function _(key as string, expectedValue as string) function _(key as string, expectedValue as string)
m.assertEqual(Manifest.ReadValue(key), expectedValue) m.assertEqual(Manifest.ReadValue(key), expectedValue)
end function end function
+17
View File
@@ -14,6 +14,15 @@ namespace Registry
sec.Flush() sec.Flush()
end function end function
function DeleteAll()
reg = CreateObject("roRegistry")
sectionNames = reg.GetSectionList()
for each sectionName in sectionNames
reg.Delete(sectionName)
end for
reg.Flush()
end function
function GetPlayletLibUrlsFromRegistry() as object function GetPlayletLibUrlsFromRegistry() as object
urlsJson = ReadKey("playlet_lib_urls", "Playlet") urlsJson = ReadKey("playlet_lib_urls", "Playlet")
if urlsJson = invalid if urlsJson = invalid
@@ -31,4 +40,12 @@ namespace Registry
Logger.Log("Cleared key playlet_lib_urls from registry") Logger.Log("Cleared key playlet_lib_urls from registry")
end function end function
function ClearRegistryIfNeeded(launchArgs as object) as void
if launchArgs = invalid or launchArgs.clearRegistry = invalid
return
end if
DeleteAll()
Logger.Log("Cleared all data from registry")
end function
end namespace end namespace
+2 -2
View File
@@ -1,12 +1,12 @@
{ {
"name": "playlet-lib", "name": "playlet-lib",
"version": "0.21.0", "version": "0.23.1",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "playlet-lib", "name": "playlet-lib",
"version": "0.21.0" "version": "0.23.1"
} }
} }
} }
+5 -3
View File
@@ -1,16 +1,18 @@
{ {
"name": "playlet-lib", "name": "playlet-lib",
"version": "0.21.0", "version": "0.23.1",
"description": "Unofficial YouTube client for Roku", "description": "Unofficial YouTube client for Roku",
"scripts": { "scripts": {
"prebuild": "rm -rf build/playlet-lib", "prebuild": "rm -rf ../build/playlet-lib",
"prebuild:dev": "npm run prebuild", "prebuild:dev": "npm run prebuild",
"prebuild:prod": "npm run prebuild", "prebuild:prod": "npm run prebuild",
"build:dev": "bsc --create-package --debug --sourceMap=true --lintConfig ../config/bslint.jsonc", "build:dev": "bsc --create-package --debug --sourceMap=true --lintConfig ../config/bslint.jsonc",
"build:prod": "bsc --create-package --sourceMap=false --lintConfig ../config/bslint.jsonc", "build:prod": "bsc --create-package --sourceMap=false --lintConfig ../config/bslint.jsonc",
"postbuild": "mkdir -p ../release && mkdir -p ../playlet-app/src/lib && cp ../dist/playlet-lib.zip ../playlet-app/src/lib/playlet-lib.zip", "postbuild": "mkdir -p ../release && mkdir -p ../playlet-app/src/lib && cp ../dist/playlet-lib.zip ../playlet-app/src/lib/playlet-lib.zip",
"postbuild:dev": "npm run postbuild", "postbuild:dev": "npm run postbuild",
"postbuild:prod": "npm run postbuild && cp ../dist/playlet-lib.zip ../release/playlet-lib.zip", "postbuild:prod": "npm run postbuild && cp ../dist/playlet-lib.zip ../release/playlet-lib.zip && npm run squash-fs && npm run sign-package",
"squash-fs": "node ../tools/squash-fs.js --in-file ../release/playlet-lib.zip --out-file ../release/playlet-lib.squashfs.zip",
"sign-package": "node ../tools/sign-package.js --out-file playlet-lib.squashfs.zip --out-dir ../release --staging-dir ../build/playlet-lib",
"lint": "bslint --project bsconfig.lint.json --lintConfig ../config/bslint.jsonc", "lint": "bslint --project bsconfig.lint.json --lintConfig ../config/bslint.jsonc",
"lint:fix": "npm run lint -- --fix", "lint:fix": "npm run lint -- --fix",
"format:base": "bsfmt \"src/**/*.brs\" \"src/**/*.bs\" \"!**/bslib.brs\" \"!**/roku_modules/**/*\" \"!**/*.transpiled/**\" \"!**/*.transpiled.*\" --bsfmt-path ../config/bsfmt.jsonc", "format:base": "bsfmt \"src/**/*.brs\" \"src/**/*.bs\" \"!**/bslib.brs\" \"!**/roku_modules/**/*\" \"!**/*.transpiled/**\" \"!**/*.transpiled.*\" --bsfmt-path ../config/bsfmt.jsonc",
@@ -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"
@@ -16,6 +19,7 @@ function Init()
m.banner = m.top.findNode("banner") m.banner = m.top.findNode("banner")
m.thumbnail = m.top.findNode("thumbnail") m.thumbnail = m.top.findNode("thumbnail")
m.authorLabel = m.top.findNode("authorLabel") m.authorLabel = m.top.findNode("authorLabel")
m.subCountLabel = m.top.findNode("subCountLabel")
m.subscribeButton = m.top.findNode("subscribeButton") m.subscribeButton = m.top.findNode("subscribeButton")
m.rowList = m.top.FindNode("rowList") m.rowList = m.top.FindNode("rowList")
m.rowList.focusable = true m.rowList.focusable = true
@@ -26,6 +30,7 @@ function Init()
m.authorId = "" m.authorId = ""
InitializeTabs() InitializeTabs()
InitializeSortOptions()
end function end function
function OnNodeready() function OnNodeready()
@@ -34,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()
@@ -60,6 +65,7 @@ function OnContentSet() as void
' NOTE: "_author" not "author". See PlaylistContentNode.xml for explanation. ' NOTE: "_author" not "author". See PlaylistContentNode.xml for explanation.
m.authorLabel.text = content._author m.authorLabel.text = content._author
m.subCountLabel.text = content.subCountText
m.banner.uri = content.banner m.banner.uri = content.banner
if StringUtils.IsNullOrEmpty(content.thumbnail) if StringUtils.IsNullOrEmpty(content.thumbnail)
m.thumbnail.uri = "" m.thumbnail.uri = ""
@@ -170,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: [{
@@ -207,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
@@ -236,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
@@ -247,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
@@ -36,15 +38,18 @@
id="authorLabel" id="authorLabel"
translation="[115,40]" translation="[115,40]"
font="font:MediumBoldSystemFont" /> font="font:MediumBoldSystemFont" />
<Label
id="subCountLabel"
translation="[115,70]"
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
@@ -29,8 +29,7 @@ function ChannelContentTask(input as object) as object
} }
end if end if
instance = service.GetInstance() InvidiousContent.ToChannelContentNode(contentNode, metadata)
InvidiousContent.ToChannelContentNode(contentNode, metadata, instance)
contentNode.loadState = FeedLoadState.Loaded contentNode.loadState = FeedLoadState.Loaded
@@ -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
@@ -86,7 +86,7 @@ function Init()
m.showAnimation = m.top.findNode("showAnimation") m.showAnimation = m.top.findNode("showAnimation")
end function end function
function Show(unsued as dynamic) function Show(_unused as dynamic)
m.optionsList.ObserveField("itemSelected", FuncName(OnItemSelected)) m.optionsList.ObserveField("itemSelected", FuncName(OnItemSelected))
m.showAnimation.control = "start" m.showAnimation.control = "start"
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,6 +1,5 @@
import "DialogPalette.bs" import "DialogPalette.bs"
import "pkg:/source/AsyncTask/AsyncTask.bs" import "pkg:/source/utils/Locale.bs"
import "pkg:/source/AsyncTask/Tasks.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"
@@ -11,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()
@@ -19,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))
@@ -33,12 +35,7 @@ function OnUrlSet()
url = m.top.url url = m.top.url
m.urlLabel.text = url m.urlLabel.text = url
AsyncTask.Start(Tasks.GenerateQrCodeTask, { m.qrCode.text = url
poster: m.qrCode
text: url
size: m.qrCode.loadWidth
padding: 10
})
end function end function
function OnAuthTokenChange() function 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,17 +20,19 @@
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">
<Font role="font" uri="font:SystemFontFile" size="24" /> <Font role="font" uri="font:SystemFontFile" size="24" />
</Label> </Label>
<Poster <QrCodePoster
id="QrCodePoster" id="QrCodePoster"
width="300" width="300"
height="300" height="300"
loadWidth="300" loadWidth="300"
loadHeight="300" loadHeight="300"
padding="10"
translation="[50, 50]" /> translation="[50, 50]" />
<Label <Label
id="urlLabel" id="urlLabel"
@@ -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()
@@ -57,20 +67,15 @@ function OnDialogClosed()
CancelTimer() CancelTimer()
end function end function
function onKeyEvent(key as string, press as boolean) as boolean function onKeyEvent(_key as string, _press as boolean) as boolean
if m.timer = invalid if m.timer = invalid
return false return false
end if end if
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
+25
View File
@@ -2,6 +2,7 @@ import "pkg:/components/EcpArgs.bs"
import "pkg:/components/parts/AutoBind/AutoBind.part.bs" import "pkg:/components/parts/AutoBind/AutoBind.part.bs"
import "pkg:/components/parts/AutoBind/OnNodeReadyNoOp.bs" import "pkg:/components/parts/AutoBind/OnNodeReadyNoOp.bs"
import "pkg:/source/utils/LoadingScreen.bs" import "pkg:/source/utils/LoadingScreen.bs"
import "pkg:/source/utils/Locale.bs"
function Init() function Init()
m.scene = m.top.getScene() m.scene = m.top.getScene()
@@ -18,6 +19,7 @@ function MainSceneContainerChanged()
InitEcpArgs() InitEcpArgs()
m.scene.signalBeacon("AppLaunchComplete") m.scene.signalBeacon("AppLaunchComplete")
CopyLoadingMessagesToCache() CopyLoadingMessagesToCache()
ShowAnnouncement()
end function end function
function StartWebServer() function StartWebServer()
@@ -30,3 +32,26 @@ function StartWebServer()
m.dialServer = m.top.findNode("DialServer") m.dialServer = m.top.findNode("DialServer")
m.dialServer@.StartServer() m.dialServer@.StartServer()
end function end function
function ShowAnnouncement()
title = "Announcement"
message = [
"YouTube has made changes that broke 3rd party apps, which is affecting Playlet and Invidious.",
"Some videos might not play, and you might see error messages often.",
"We're aware of the issue, and working on a fix.",
"We apologize for the inconvenience.",
]
buttons = [Tr(Locale.Buttons.OK)]
dialog = CreateObject("roSGNode", "SimpleDialog")
dialog.title = title
dialog.message = message
dialog.buttons = buttons
deviceInfo = CreateObject("roDeviceInfo")
displaySize = deviceInfo.GetDisplaySize()
dialog.width = displaySize.w - 180
m.top.getScene().dialog = dialog
end function
@@ -2,6 +2,7 @@
'import "pkg:/components/parts/AutoBind/AutoBind.part.bs" 'import "pkg:/components/parts/AutoBind/AutoBind.part.bs"
'import "pkg:/components/parts/AutoBind/OnNodeReadyNoOp.bs" 'import "pkg:/components/parts/AutoBind/OnNodeReadyNoOp.bs"
'import "pkg:/source/utils/LoadingScreen.bs" 'import "pkg:/source/utils/LoadingScreen.bs"
'import "pkg:/source/utils/Locale.bs"
function Init() function Init()
InitializeBindings() ' auto-generated! InitializeBindings() ' auto-generated!
@@ -19,6 +20,7 @@ function MainSceneContainerChanged()
InitEcpArgs() InitEcpArgs()
m.scene.signalBeacon("AppLaunchComplete") m.scene.signalBeacon("AppLaunchComplete")
CopyLoadingMessagesToCache() CopyLoadingMessagesToCache()
ShowAnnouncement()
end function end function
function StartWebServer() function StartWebServer()
@@ -29,4 +31,25 @@ function StartWebServer()
m.dialServer = m.top.findNode("DialServer") m.dialServer = m.top.findNode("DialServer")
m.dialServer.callfunc("StartServer", invalid) m.dialServer.callfunc("StartServer", invalid)
end function end function
function ShowAnnouncement()
title = "Announcement"
message = [
"YouTube has made changes that broke 3rd party apps, which is affecting Playlet and Invidious."
"Some videos might not play, and you might see error messages often."
"We're aware of the issue, and working on a fix."
"We apologize for the inconvenience."
]
buttons = [
Tr("OK")
]
dialog = CreateObject("roSGNode", "SimpleDialog")
dialog.title = title
dialog.message = message
dialog.buttons = buttons
deviceInfo = CreateObject("roDeviceInfo")
displaySize = deviceInfo.GetDisplaySize()
dialog.width = displaySize.w - 180
m.top.getScene().dialog = dialog
end function
'//# sourceMappingURL=./MainScene.brs.map '//# sourceMappingURL=./MainScene.brs.map
@@ -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
@@ -197,7 +197,7 @@ function OpenPlaylistChannel(playlist as object) as void
LogWarn("Invalid authorId:", authorId) LogWarn("Invalid authorId:", authorId)
return return
end if end if
channel = InvidiousContent.ToChannelContentNode(invalid, { authorId: authorId }, invalid) channel = InvidiousContent.ToChannelContentNode(invalid, { authorId: authorId })
ChannelUtils.Open(channel) ChannelUtils.Open(channel)
end function end function
@@ -207,7 +207,7 @@ function OpenVideoChannel(video as object) as void
LogWarn("Invalid authorId:", authorId) LogWarn("Invalid authorId:", authorId)
return return
end if end if
channel = InvidiousContent.ToChannelContentNode(invalid, { authorId: authorId }, invalid) channel = InvidiousContent.ToChannelContentNode(invalid, { authorId: authorId })
ChannelUtils.Open(channel) ChannelUtils.Open(channel)
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,10 +1,8 @@
import "pkg:/source/QrCode/QrImage.bs" import "pkg:/source/QrCode/QrImage.bs"
import "pkg:/source/utils/StringUtils.bs" import "pkg:/source/utils/StringUtils.bs"
' TODO:P1 create a QRCode component that has a loading spinner while the QRCode is being generated
' It is slow and can take several seconds.
@asynctask @asynctask
function GenerateQrCodeTask(input as object) function GenerateQrCodeTask(input as object) as object
poster = input.poster poster = input.poster
mode = input.mode mode = input.mode
text = input.text text = input.text
@@ -26,7 +24,13 @@ function GenerateQrCodeTask(input as object)
qr = new QrCode.QRImage() qr = new QrCode.QRImage()
imagePath = qr.Generate(text, size, padding, mode) imagePath = qr.Generate(text, size, padding, mode)
if m.top.cancel
return invalid
end if
if not StringUtils.IsNullOrEmpty(imagePath) if not StringUtils.IsNullOrEmpty(imagePath)
poster.uri = imagePath poster.uri = imagePath
end if end if
return invalid
end function end function
@@ -0,0 +1,65 @@
import "pkg:/source/AsyncTask/AsyncTask.bs"
import "pkg:/source/AsyncTask/Tasks.bs"
import "pkg:/source/utils/StringUtils.bs"
import "pkg:/source/utils/Types.bs"
function Init()
m.busySpinner = m.top.findNode("busySpinner")
m.busySpinnerPoster = m.busySpinner.poster
m.busySpinnerPoster.uri = "pkg:/images/spinner.png"
m.top.observeField("width", FuncName(OnSizeChange))
m.top.observeField("height", FuncName(OnSizeChange))
OnSizeChange()
end function
function OnSizeChange()
width = m.top.width
height = m.top.height
m.busySpinnerPoster.width = width / 2
m.busySpinnerPoster.height = height / 2
m.busySpinner.translation = [width / 4, height / 4]
end function
function OnTextChange() as void
if m.qrCodeGenTask <> invalid
m.qrCodeGenTask.cancel = true
end if
text = m.top.text
width = m.top.loadWidth
if width = 0
width = m.top.width
end if
m.top.uri = ""
if StringUtils.IsNullOrEmpty(text)
m.busySpinner.control = "stop"
m.busySpinner.visible = false
return
end if
m.busySpinnerPoster.rotation = 0
m.busySpinner.visible = true
m.busySpinner.control = "start"
m.qrCodeGenTask = AsyncTask.Start(Tasks.GenerateQrCodeTask, {
poster: m.top
text: text
size: width
padding: m.top.padding
}, OnGenerateQrCodeTaskResult)
end function
function OnGenerateQrCodeTaskResult(output as object) as void
if output.cancelled
return
end if
m.busySpinner.control = "stop"
m.busySpinner.visible = false
end function
@@ -0,0 +1,12 @@
<component name="QrCodePoster" extends="Poster">
<interface>
<field id="text" type="string" onChange="OnTextChange" />
<field id="padding" type="integer" />
</interface>
<children>
<BusySpinner
id="busySpinner"
spinInterval="1"
visible="false" />
</children>
</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
@@ -94,7 +80,7 @@ function OnkeyEvent(key as string, press as boolean) as boolean
return false return false
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
@@ -40,7 +41,7 @@ function OnkeyEvent(key as string, press as boolean) as boolean
return false return false
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>
@@ -1,12 +1,12 @@
import "pkg:/components/Dialog/DialogUtils.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/AsyncTask.bs"
import "pkg:/source/AsyncTask/Tasks.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()
@@ -18,9 +18,24 @@ function Init()
m.linkWithWifiPanel = m.top.findNode("LinkWithWiFiPanel") m.linkWithWifiPanel = m.top.findNode("LinkWithWiFiPanel")
m.linkWithTvPanel = m.top.findNode("LinkWithTvPanel") m.linkWithTvPanel = m.top.findNode("LinkWithTvPanel")
m.webAppUrlLabel = m.top.findNode("WebAppUrlLabel")
m.webAppQrCodePoster = m.top.findNode("WebAppQrCodePoster")
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
@@ -65,16 +85,20 @@ end function
function OnUrlSet() function OnUrlSet()
url = m.top.url url = m.top.url
urlLabel = m.top.findNode("urlLabel") m.webAppUrlLabel.text = url
urlLabel.text = url m.webAppQrCodePoster.text = url
end function
qrCodePoster = m.top.findNode("QrCodePoster") function OnButtonSizeChange()
AsyncTask.Start(Tasks.GenerateQrCodeTask, { width1 = m.webAppButton.contentWidth
poster: qrCodePoster width2 = m.linkWithWifiButton.contentWidth
text: url width3 = m.linkWithTvButton.contentWidth
size: qrCodePoster.loadWidth
padding: 20 width = MathUtils.Max(width1, MathUtils.Max(width2, width3))
})
m.webAppButton.minimumWidth = width
m.linkWithWifiButton.minimumWidth = width
m.linkWithTvButton.minimumWidth = width
end function end function
function OnkeyEvent(key as string, press as boolean) as boolean function OnkeyEvent(key as string, press as boolean) as boolean
@@ -125,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()
@@ -150,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
@@ -178,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">
@@ -47,15 +49,16 @@
font="font:SmallBoldSystemFont" font="font:SmallBoldSystemFont"
horizAlign="center" horizAlign="center"
text="Scan the QR code" /> text="Scan the QR code" />
<Poster <QrCodePoster
id="QrCodePoster" id="WebAppQrCodePoster"
height="400" height="400"
width="400" width="400"
loadHeight="400" loadHeight="400"
loadWidth="400" loadWidth="400"
padding="20"
translation="[0,40]" /> translation="[0,40]" />
<Label <Label
id="UrlLabel" id="WebAppUrlLabel"
height="30" height="30"
width="400" width="400"
font="font:SmallBoldSystemFont" font="font:SmallBoldSystemFont"
@@ -90,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"
@@ -132,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
@@ -142,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
@@ -16,11 +17,11 @@ function OnFocusChange() as void
NodeSetFocus(m.button, true) NodeSetFocus(m.button, true)
end function end function
function BindPreference(preferences as object, key as string) function BindPreference(_preferences as object, _key as string)
' Do nothing ' Do nothing
end function 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,25 +53,37 @@ 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
function ShowTestDetails(event as object) as void function ShowTestDetails() 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>
@@ -9,17 +9,20 @@
<children> <children>
<BusySpinner <BusySpinner
id="busySpinner" id="busySpinner"
spinInterval="2"
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)
Loaded 100 of 267 files, more files were not shown because too many files have changed in this diff. Show more