Compare commits

..
57 Commits
Author SHA1 Message Date
Brahim Hadriche 982dd0cd2e Release v0.14.0 (#181) 2023-10-25 21:32:05 -04:00
Brahim Hadriche 4827537f57 Fix for feed when no videos are loaded 2023-10-25 21:22:22 -04:00
Brahim Hadriche 586925c2da Comment 2023-10-25 20:55:03 -04:00
Brahim Hadriche dd79d85cca Fix "upcoming" videos 2023-10-25 20:51:36 -04:00
Brahim Hadriche 584ee9a38a dash router input validation 2023-10-25 17:06:39 -04:00
Brahim Hadriche 6051d45a80 Support drag and drop links for channels 2023-10-24 19:59:24 -04:00
Brahim Hadriche 549913ef7d Open views (#179)
* adjust todo

* Open view
2023-10-24 17:21:48 -04:00
Brahim Hadriche 8975861615 signing script update 2023-10-24 16:19:23 -04:00
Brahim Hadriche 03e08c99c6 comment 2023-10-24 14:11:29 -04:00
Brahim Hadriche 072b93728a Bookmarks web app part 2 (#178)
* Message for no bookmarks

* feed lazy loading

* cached fetch

* Versioned cache

* comment
2023-10-24 13:41:13 -04:00
Brahim Hadricheandgithub-action linter 57fa1c5c3f Bookmarks in web app (#177)
* Bookmarks api

* Lint fix

* first pass

* Lint fix

* comment

* bookmarks, loading feedSources, and pagination

* comment

* null check

---------

Co-authored-by: github-action linter <githubaction@githubaction.com>
2023-10-23 20:39:44 -04:00
Brahim Hadriche 58ce2d6396 ChannelHandle in web app 2023-10-23 20:26:28 -04:00
Brahim Hadriche 837386b6e0 Change playlist view cell to avoid execution timeout 2023-10-23 13:14:47 -04:00
Brahim Hadriche 9baa132ca3 Refactor to reduce chance of execution timeout 2023-10-23 12:40:48 -04:00
Brahim Hadriche ed2ec9bea5 increase resolution of navbar icons 2023-10-22 19:51:01 -04:00
Brahim Hadriche 2bc4d43f51 Search filters in web app (#176) 2023-10-22 18:29:45 -04:00
Brahim Hadriche a61c0afe16 Fix for long press 2023-10-22 16:17:03 -04:00
Brahim Hadriche 6fd34c13d1 A fix for upcoming videos 2023-10-22 16:08:56 -04:00
Brahim Hadriche e1b7500d7c TODOs 2023-10-22 15:35:58 -04:00
7bfe657401 Smooth scroll to top if active screen selected in web UI (#175)
* Smooth scroll to top if active screen selected in web UI

* Use fullname repo

---------

Co-authored-by: agathanonymous <agatha@juggalol.com>
Co-authored-by: Brahim Hadriche <brahim.hadriche@gmail.com>
2023-10-21 20:13:14 -04:00
Brahim Hadriche ceeb2bf37b Show channel handle instead of video count in search (#174) 2023-10-21 16:50:07 -04:00
Brahim Hadriche 3b69140398 Fix for bookmark load order 2023-10-21 16:49:26 -04:00
Brahim Hadriche 25e573a1e1 change debug port 2023-10-20 17:01:32 -04:00
Brahim Hadriche d123393b2f Log warn 2023-10-19 21:33:55 -04:00
Brahim Hadriche 6e0ee8adf4 Canary fallback to latest to avoid issues 2023-10-19 19:33:27 -04:00
Brahim Hadriche 74742c7e28 small tweak 2023-10-19 19:22:40 -04:00
Brahim Hadricheandgithub-action linter c740d5e0a0 Bookmarks (#153)
* Empty bookmarks screen

* Bookmarks object

* Long press support

* Lint fix

* Context menu v1

* A working context menu

* Basic bookmarks in context menu

* Use a root content node for bookmarks

* context menu animation

* small tweak

* move logger around, adjust animation

* Lint fix

* Restore logger fix

* Cache channel info

* Bookmarks v1

* Added comment

* Adjust "popular" feed error handling

* Progress with bookmarks

* Add todo

* add todo

* handle roDateTime logging

* logger adjustment

* Use yaml for api and layout

* rename requestData to feedSource

* Restructure things

* Lint fix

* remove comment

* introduce feedSource id

* small cleanup

* playlist context menu

* Context menu for the channel view

* changelog

---------

Co-authored-by: github-action linter <githubaction@githubaction.com>
2023-10-19 19:16:27 -04:00
Brahim Hadriche 620a8a6e2b banner on top 2023-10-18 09:07:11 -04:00
Brahim Hadriche 84835e26e0 dash manifest sorting 2023-10-15 12:58:42 -04:00
Brahim Hadriche 64f3683a22 Add invidious test duration in list 2023-10-14 22:54:13 -04:00
Brahim Hadriche e80fcabae5 Trickplay thumbnails (#169)
* Trickplay thumbnails

* Changelog

* Comment
2023-10-14 17:36:06 -04:00
Brahim Hadriche a12b6cca11 Removed "chapter" from SponsorBlock categories 2023-10-14 15:53:20 -04:00
Brahim Hadriche b2f5ed2275 Add comment 2023-10-14 14:59:12 -04:00
Brahim Hadricheandgithub-action linter fc161ffe4c Feature/local dash (#166)
* Generate dash locally

* Refactor xml gen

* Lint fix

* Add feature flag

* Multi language audio tracks

* Unused var

* Set video expiration to 5 hours

---------

Co-authored-by: github-action linter <githubaction@githubaction.com>
2023-10-14 14:44:08 -04:00
Brahim Hadriche fc3629de09 Cache format (#168) 2023-10-14 12:47:09 -04:00
Brahim Hadriche 4efbdda167 Fix for channel view layout (#167)
* Fix for channel view layout

* tweak
2023-10-14 12:08:42 -04:00
Brahim Hadriche 0aad02f5e6 [Shore] update dependencies 2023-10-09 17:43:24 -04:00
Brahim Hadriche ea5ca1c45d Adjust image gen plugin 2023-10-09 11:15:53 -04:00
Brahim Hadriche 9fddd40ff3 Release v0.13.1 (#164) 2023-10-08 12:26:47 -04:00
Brahim Hadriche b489735af9 only regen images on release 2023-10-08 12:11:30 -04:00
Brahim Hadriche 508306c6f4 Refactor image conversion (#163)
* Refactor image conversion

* Docs
2023-10-07 18:21:54 -04:00
Brahim Hadriche 7818f778ea Log video player errors 2023-10-06 09:18:21 -04:00
Brahim Hadriche 6abd18ab85 Handle Popular disabled case (#162) 2023-10-04 18:52:44 -04:00
Brahim Hadriche e8fd7ee35d Fix/bugs (#161)
* Fix for execution timeout

* Multiple bug fixes
2023-10-04 18:16:57 -04:00
Brahim Hadriche deeed05383 Fix button size 2023-10-03 20:46:14 -04:00
Brahim Hadriche 518409cb3f Add todo 2023-10-03 20:41:07 -04:00
Brahim Hadriche a9d7de971b Delete renovate.json 2023-10-03 11:41:13 -04:00
Brahim Hadriche 324543684d Pause/Resume during picture in picture (#156)
* Pause/Resume during picture in picture

* changelog

* changelog
2023-10-02 15:14:24 -04:00
Brahim Hadriche a6f8cb59ee fix filter button again 2023-10-02 15:03:20 -04:00
Brahim Hadriche e2822baac1 Release v0.13.0 (#159) 2023-10-02 09:17:19 -04:00
Brahim Hadricheandgithub-action linter 256fc22bd9 Bug/a few fixes (#158)
* Change default instance

* Fix cropped buttons

* Lint fix

* changelog

---------

Co-authored-by: github-action linter <githubaction@githubaction.com>
2023-10-02 09:10:52 -04:00
Brahim Hadriche cb877f9415 Xml consistency pass 2023-09-30 08:58:02 -04:00
Brahim Hadricheandgithub-action linter acce520752 Sort imports (#155)
* Sort imports

* Lint fix

---------

Co-authored-by: github-action linter <githubaction@githubaction.com>
2023-09-29 18:16:00 -04:00
Brahim Hadriche 5d81f025ad Log testing errors 2023-09-23 22:53:19 -04:00
Brahim Hadriche c5680f7b06 Add Etag support (#151)
* Add Etag support

* small tweak
2023-09-23 18:22:23 -04:00
Brahim Hadriche dab6dc5bc4 Feature/channel view content (#150)
* ChannelView feeds

* Fixes for web app

* Add request id to error message
2023-09-22 17:52:53 -04:00
Brahim Hadriche e2df0b524a Fix copy paste bug 2023-09-21 15:41:40 -04:00
222 changed files with 4875 additions and 1296 deletions

No files matched your search

+1
View File
@@ -17,6 +17,7 @@ jobs:
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: Configure repo
run: |
+6 -2
View File
@@ -18,6 +18,7 @@
"files": [
"**"
],
"componentLibrariesPort": 8086,
"componentLibraries": [
{
"rootDir": "${workspaceFolder}/build/playlet-lib",
@@ -59,7 +60,7 @@
"command": "npm run dev:web",
"request": "launch",
"type": "node-terminal"
},
},
{
"name": "Playlet Web (Chrome)",
"type": "chrome",
@@ -79,7 +80,10 @@
"compounds": [
{
"name": "Playlet Web (Debug)",
"configurations": ["Playlet Web (Dev)", "Playlet Web (Chrome)"],
"configurations": [
"Playlet Web (Dev)",
"Playlet Web (Chrome)"
],
"stopAll": true
}
]
+69
View File
@@ -5,6 +5,75 @@ 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/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [0.14.0] - 2023-10-25
### Added
- Bookmarks: different items can now be bookmarked, and be found in the `Bookmarks` screen.
Things that can be bookmarked:
- A video
- A channel
- A playlist
- Subscriptions
- Trending
- Popular
- Playlists
- Search results
- Channel tabs (latest videos, live streams, playlists, shorts, podcasts, related channels)
- Context menu: press and hold `OK` to show a context menu to:
- Play/queue a video or a playlist
- Open the channel of a playlist or of a video
- Manage bookmarks
- Local DASH manifest generation
- This adds support for multi languages audio tracks
- Also adds thumbnails/preview in trick play mode
- Known issue: thumbnails might appear cropped/misaligned at the end of videos. This will be addressed in a later release.
- Search filters in web app
- Channels and Playlists can be opened on TV from web app
- Channel links can be drag and dropped into the web app
### Fixed
- Layout in channel view so that the upload time and view count of videos is visible
- A few things in the logger
- A bug where channels show "0 videos". Channel handle is shown instead.
### Changed
- Cache format so it does less parsing work
- Removed "chapter" from SponsorBlock categories
## [0.13.1] - 2023-10-08
### Added
- Support to pause/play while picture-in-picture
### Fixed
- (potentionally) a bug where many dialogs could cause an execution timeout
- Mutltiple rare crashes when component content is set before component initialization
- Error dialog for loading "Popular" when "Popular" is disabled
## [0.13.0] - 2023-10-02
### Added
- Playlists, streams, podcasts and related channels to Channel UI
- Pagination supported
- Channels show up in web app (but no UI for channel details yet)
- Support for `Etag` header on the web server to improve performance with caching
### Fixed
- Another bug where the app crashes if an error happens loading channel info
- Issue with default instance (by changing default instance)
- Cropped text in a couple of buttons
### Removed
- Partial content (`Range` header) from the web server, since we never serve very big files
## [0.12.1] - 2023-09-19
### Added
+3 -3
View File
@@ -1,6 +1,4 @@
# Playlet
<!-- markdownlint-disable MD033 -->
<!-- markdownlint-disable MD033 MD041 -->
<p align="center">
<img src="docs/banner.png" style="display:block;text-align:center" alt="Playlet Logo" width="800"/>
<br/><br/>
@@ -19,6 +17,8 @@
</a>
</p>
# Playlet
Playlet is an unofficial Youtube client for Roku 📺
## Screenshots
+4 -2
View File
@@ -26,7 +26,8 @@
"source/**",
"components/**",
"images/**",
"!images/vector/**",
"!**/*.svg",
"!**/*.svg.meta.json5",
"fonts/**",
"config/**",
"lib/**",
@@ -48,7 +49,8 @@
"../tools/bs-plugins/track-transpiled-plugin.ts",
"../tools/bs-plugins/json-yaml-plugin.ts",
"../tools/bs-plugins/validation-plugin.ts",
"../tools/bs-plugins/logger-plugin.ts"
"../tools/bs-plugins/logger-plugin.ts",
"../tools/bs-plugins/image-gen-plugin.ts"
],
"retainStagingDir": true,
"require": [
+4 -2
View File
@@ -4,7 +4,8 @@
"source/**",
"components/**",
"images/**",
"!images/vector/**",
"!**/*.svg",
"!**/*.svg.meta.json5",
"fonts/**",
"config/**",
"lib/**",
@@ -24,7 +25,8 @@
"../tools/bs-plugins/track-transpiled-plugin.ts",
"../tools/bs-plugins/json-yaml-plugin.ts",
"../tools/bs-plugins/validation-plugin.ts",
"../tools/bs-plugins/logger-plugin.ts"
"../tools/bs-plugins/logger-plugin.ts",
"../tools/bs-plugins/image-gen-plugin.ts"
],
"rooibos": {
"logLevel": 2,
+3 -1
View File
@@ -17,5 +17,7 @@
// Enforces all keywords and types to be lowercase.
"keywordCase": "lower",
// Remove trailing whitespace at the end of each line.
"removeTrailingWhiteSpace": true
"removeTrailingWhiteSpace": true,
// Sort imports alphabetically.
"sortImports": true
}
+2 -2
View File
@@ -210,13 +210,13 @@ Additionally, the web server exposes the settings under `/api/preferences`, whic
When Playlet starts, it shows a video feed on the screen. Subscription, Trending videos, and so on.
The layout is defined under [playlet-lib/src/config/default_home_layout.json5](/playlet-lib/src/config/default_home_layout.json5).
The layout is defined under [playlet-lib/src/config/default_home_layout.yaml](/playlet-lib/src/config/default_home_layout.yaml).
This could allow users to define custom layouts, so they can see what they find relevant in the home page. This can include Subscription, Trending, Popular videos, Search per keywords, or Playlists.
Additionally each feed has information on how it is fetched. For now, only Invidious can be data source, but other systems should be configured in the same way.
Invidious API definitions are defined under [playlet-lib/src/config/invidious_video_api.json5](/playlet-lib/src/config/invidious_video_api.json5), and Playlet parses these at runtime and make the right API calls to fetch the data.
Invidious API definitions are defined under [playlet-lib/src/config/invidious_video_api.yaml](/playlet-lib/src/config/invidious_video_api.yaml), and Playlet parses these at runtime and make the right API calls to fetch the data.
Finally, this layout system is what allows both the BrightScript app and the Web app to display the same homepage.
+3 -1
View File
@@ -43,6 +43,8 @@ These are mostly the steps when releasing a new version:
For releasing to the store (when needed), this is done following a Playlet lib release:
- Switch to main branch and pull changes - **match commit corresponding to the release.**
- `npm run build: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)
+48
View File
@@ -0,0 +1,48 @@
<!-- TODO:P1 document models better -->
# Models
ApiEndpoint:
- id
- url
- queryParams
- pathParams
- cacheSeconds
- paginationType
- authenticated
- responseHandler
FeedSource:
- id
- title
- apiType: string ("Invidious")
- endpoint: ApiEndpoint
- pathParams
- queryParams
- state:
- paginationtype (Runtime field)
- page (Runtime field)
- continuation (Runtime field)
- queryParams.page (Runtime field)
- queryParams.continuation (Runtime field)
Feed/FeedContentNode:
- Title
- feedSources: FeedSource[]
- feedSourceIndex (Runtime field)
RowListLayout
- Feed[]
Bookmarks
- BookmarkGroup[]
BookmarkGroup
- title
- feedSources: FeedSource[]
+24 -1
View File
@@ -2,7 +2,7 @@ openapi: 3.0.0
info:
title: Playlet Web API
version: 0.12.1
version: 0.14.0
description:
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
@@ -204,6 +204,29 @@ paths:
responses:
"204":
description: No Content
/api/view/open:
get:
summary: Open a channel view or a playlist view
description: Open a channel view or a playlist view. If a video is playing in full screen, it is shrinked.
operationId: openView
parameters:
- name: channelId
in: query
description: The ID of the channel to open
required: false
schema:
type: string
- name: playlistId
in: query
description: The ID of the playlist to open
required: false
schema:
type: string
responses:
"204":
description: No Content
"400":
description: Bad Request
/api/playlet-lib-urls:
get:
summary: Get Playlet lib URLs
+16
View File
@@ -1,6 +1,7 @@
# Playlet Brighterscript Plugins
- [Json5/Yaml support](#json5yaml-support)
- [Convert images](#convert-images)
- [Manifest editing](#manifest-editing)
- [Validation](#validation)
- [Includes](#includes)
@@ -27,6 +28,21 @@ Brightscript can only parse json natively using [ParseJson](https://developer.ro
At the end of the build, the plugin scans for certain files (`jsonc`, `json`, `json5` and `yaml`), and converts them to plain json, while keeping the original file name. That way they are all parsable by the [ParseJson](https://developer.roku.com/en-ca/docs/references/brightscript/language/global-utility-functions.md#parsejsonjsonstring-as-string-flags---as-string-as-object) function, even though their original format is not compatible.
## Convert images
**[Source](/tools/bs-plugins/image-gen-plugin.ts)**
This plugin allows us to convert svg files to png files.
### Why
This is used to convert splash screen, app poster, as well as icons in the app. Having svg images (or vector images in general) as the source of truth is better, in case images need to be modified or resized. Since Roku can't load them, we convert them to png.
### How
Each `.svg` file found will have an associated `.svg.meta.json5` file, which will contain the hash (MD5) of the svg, conversion paramters, and the hash of the output files. This allows us to hash existing files and see if a conversion is needed.
Notice how each `.svg` file can be configured to generate multiple png files. This is especially the case to generate the app artwork (splash screen/poster) with different sizes from the same logo `.svg` file.
## Manifest editing
**[Source](/tools/bs-plugins/manifest-edit-plugin.ts)**
+56 -33
View File
@@ -1,27 +1,29 @@
{
"name": "playlet",
"version": "0.12.1",
"version": "0.14.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "playlet",
"version": "0.12.1",
"version": "0.14.0",
"hasInstallScript": true,
"devDependencies": {
"@rokucommunity/bslint": "^0.8.9",
"@types/fs-extra": "^11.0.1",
"@types/node": "^20.5.9",
"@rokucommunity/bslint": "^0.8.11",
"@types/crypto-js": "^4.1.2",
"@types/fs-extra": "^11.0.2",
"@types/node": "^20.8.4",
"@types/xml2js": "^0.4.12",
"argparse": "^2.0.1",
"brighterscript": "^0.65.5",
"brighterscript-formatter": "^1.6.31",
"brighterscript": "^0.65.8",
"brighterscript-formatter": "^1.6.34",
"convert-svg-to-png": "^0.6.4",
"cross-fetch": "^4.0.0",
"crypto-js": "^4.1.1",
"dotenv": "^16.3.1",
"express": "^4.18.2",
"fs-extra": "^11.1.1",
"glob": "^10.3.4",
"glob": "^10.3.10",
"ip": "^1.1.8",
"json5": "^2.2.3",
"roku-deploy": "^3.10.3",
@@ -272,9 +274,9 @@
"dev": true
},
"node_modules/@rokucommunity/bslint": {
"version": "0.8.9",
"resolved": "https://registry.npmjs.org/@rokucommunity/bslint/-/bslint-0.8.9.tgz",
"integrity": "sha512-7rXHcGL8XVguqzjKtsUoRvnm/g6ySJwV+xGO9n8Mc1r1zNIvjMi9Spfz1Kh8zJTXwfxOkG1X68lMAtp9bk/gxA==",
"version": "0.8.11",
"resolved": "https://registry.npmjs.org/@rokucommunity/bslint/-/bslint-0.8.11.tgz",
"integrity": "sha512-PKtYRngih4oybTN7IEZ4aQp2Bm6a1P4GyKo+F6eJkUmzbCN2glVXvWq+REHBinqEAYyL/3YiSsD4brFWCVPHcw==",
"dev": true,
"dependencies": {
"fs-extra": "^10.0.0",
@@ -327,10 +329,16 @@
"integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==",
"dev": true
},
"node_modules/@types/crypto-js": {
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/@types/crypto-js/-/crypto-js-4.1.2.tgz",
"integrity": "sha512-t33RNmTu5ufG/sorROIafiCVJMx3jz95bXUMoPAZcUD14fxMXnuTzqzXZoxpR0tNx2xpw11Dlmem9vGCsrSOfA==",
"dev": true
},
"node_modules/@types/fs-extra": {
"version": "11.0.1",
"resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-11.0.1.tgz",
"integrity": "sha512-MxObHvNl4A69ofaTRU8DFqvgzzv8s9yRtaPPm5gud9HDNvpB3GPQFvNuTWAI59B9huVGV5jXYJwbCsmBsOGYWA==",
"version": "11.0.2",
"resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-11.0.2.tgz",
"integrity": "sha512-c0hrgAOVYr21EX8J0jBMXGLMgJqVf/v6yxi0dLaJboW9aQPh16Id+z6w2Tx1hm+piJOLv8xPfVKZCLfjPw/IMQ==",
"dev": true,
"dependencies": {
"@types/jsonfile": "*",
@@ -347,10 +355,13 @@
}
},
"node_modules/@types/node": {
"version": "20.5.9",
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.5.9.tgz",
"integrity": "sha512-PcGNd//40kHAS3sTlzKB9C9XL4K0sTup8nbG5lC14kzEteTNuAFh9u5nA0o5TWnSG2r/JNPRXFVcHJIIeRlmqQ==",
"dev": true
"version": "20.8.4",
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.8.4.tgz",
"integrity": "sha512-ZVPnqU58giiCjSxjVUESDtdPk4QR5WQhhINbc9UBrKLU68MX5BF6kbQzTrkwbolyr0X8ChBpXfavr5mZFKZQ5A==",
"dev": true,
"dependencies": {
"undici-types": "~5.25.1"
}
},
"node_modules/@types/xml2js": {
"version": "0.4.12",
@@ -702,9 +713,9 @@
}
},
"node_modules/brighterscript": {
"version": "0.65.5",
"resolved": "https://registry.npmjs.org/brighterscript/-/brighterscript-0.65.5.tgz",
"integrity": "sha512-xDkWIZhjTLhp6dVZ6lX7zWRyNvjdiAwZncJRnErSbqRhteNJFL7ic2UDJew9zCOYTQDrG7B85lpPpXc/1JlV+Q==",
"version": "0.65.8",
"resolved": "https://registry.npmjs.org/brighterscript/-/brighterscript-0.65.8.tgz",
"integrity": "sha512-mqarSnGCl/VSTRj1oY9wRMZJV9s8dH+rZZ2P1yE7d1nZQucVpAIGICW83G9AJHQYUDjrGsKHn5UfAfaZaE1KCA==",
"dev": true,
"dependencies": {
"@rokucommunity/bslib": "^0.1.1",
@@ -745,12 +756,12 @@
}
},
"node_modules/brighterscript-formatter": {
"version": "1.6.31",
"resolved": "https://registry.npmjs.org/brighterscript-formatter/-/brighterscript-formatter-1.6.31.tgz",
"integrity": "sha512-XOc1LVAUXrWtCwAZeOUS/7gH5TbiEqZ0IwyAJcM7J5CxrFpMrw6NKg/Yox1oKaH1m11kcLR7KgckK5CTha0eYQ==",
"version": "1.6.34",
"resolved": "https://registry.npmjs.org/brighterscript-formatter/-/brighterscript-formatter-1.6.34.tgz",
"integrity": "sha512-qGjoiIVrbvgit4RkSF4iNZKFCaavzQG/7G9ZgJs87rBHeCOvqBy+e264cD/KwDnhg4kMdvty45zZ+Um8Oeo2UQ==",
"dev": true,
"dependencies": {
"brighterscript": "^0.65.4",
"brighterscript": "^0.65.8",
"glob-all": "^3.3.0",
"jsonc-parser": "^3.0.0",
"source-map": "^0.7.3",
@@ -1507,6 +1518,12 @@
"node": ">= 8"
}
},
"node_modules/crypto-js": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-4.1.1.tgz",
"integrity": "sha512-o2JlM7ydqd3Qk9CA0L4NL6mTzU2sdx96a+oOfPu8Mkl/PK51vSyoi8/rQ8NknZtk44vq15lmhAj9CIAGwgeWKw==",
"dev": true
},
"node_modules/css-select": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/css-select/-/css-select-5.1.0.tgz",
@@ -2192,19 +2209,19 @@
}
},
"node_modules/glob": {
"version": "10.3.4",
"resolved": "https://registry.npmjs.org/glob/-/glob-10.3.4.tgz",
"integrity": "sha512-6LFElP3A+i/Q8XQKEvZjkEWEOTgAIALR9AO2rwT8bgPhDd1anmqDJDZ6lLddI4ehxxxR1S5RIqKe1uapMQfYaQ==",
"version": "10.3.10",
"resolved": "https://registry.npmjs.org/glob/-/glob-10.3.10.tgz",
"integrity": "sha512-fa46+tv1Ak0UPK1TOy/pZrIybNNt4HCv7SDzwyfiOZkvZLEbjsZkJBPtDHVshZjbecAoAGSC20MjLDG/qr679g==",
"dev": true,
"dependencies": {
"foreground-child": "^3.1.0",
"jackspeak": "^2.0.3",
"jackspeak": "^2.3.5",
"minimatch": "^9.0.1",
"minipass": "^5.0.0 || ^6.0.2 || ^7.0.0",
"path-scurry": "^1.10.1"
},
"bin": {
"glob": "dist/cjs/src/bin.js"
"glob": "dist/esm/bin.mjs"
},
"engines": {
"node": ">=16 || 14 >=14.17"
@@ -2616,9 +2633,9 @@
"dev": true
},
"node_modules/jackspeak": {
"version": "2.2.1",
"resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-2.2.1.tgz",
"integrity": "sha512-MXbxovZ/Pm42f6cDIDkl3xpwv1AGwObKwfmjs2nQePiy85tP3fatofl3FC1aBsOtP/6fq5SbtgHwWcMsLP+bDw==",
"version": "2.3.6",
"resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-2.3.6.tgz",
"integrity": "sha512-N3yCS/NegsOBokc8GAdM8UcmfsKiSS8cipheD/nivzr700H+nsMOxJjQnvwOcRYVuFkdH0wGUvW2WbXGmrZGbQ==",
"dev": true,
"dependencies": {
"@isaacs/cliui": "^8.0.2"
@@ -4338,6 +4355,12 @@
"integrity": "sha512-vohX7ywgBjRxDNw+f3wHclSXmO0z9HsEfmGObOuG7G0yi7kZ6OtCG8kAxtDSNklmua5KR6ev2drTFqMGqpYEbg==",
"dev": true
},
"node_modules/undici-types": {
"version": "5.25.3",
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.25.3.tgz",
"integrity": "sha512-Ga1jfYwRn7+cP9v8auvEXN1rX3sWqlayd4HP7OKk4mZWylEmu3KzXDUGrQUN6Ol7qo1gPvB2e5gX6udnyEPgdA==",
"dev": true
},
"node_modules/universalify": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz",
+10 -8
View File
@@ -1,21 +1,23 @@
{
"name": "playlet",
"version": "0.12.1",
"version": "0.14.0",
"description": "Unofficial Youtube client for Roku",
"devDependencies": {
"@rokucommunity/bslint": "^0.8.9",
"@types/fs-extra": "^11.0.1",
"@types/node": "^20.5.9",
"@rokucommunity/bslint": "^0.8.11",
"@types/crypto-js": "^4.1.2",
"@types/fs-extra": "^11.0.2",
"@types/node": "^20.8.4",
"@types/xml2js": "^0.4.12",
"argparse": "^2.0.1",
"brighterscript": "^0.65.5",
"brighterscript-formatter": "^1.6.31",
"brighterscript": "^0.65.8",
"brighterscript-formatter": "^1.6.34",
"convert-svg-to-png": "^0.6.4",
"cross-fetch": "^4.0.0",
"crypto-js": "^4.1.1",
"dotenv": "^16.3.1",
"express": "^4.18.2",
"fs-extra": "^11.1.1",
"glob": "^10.3.4",
"glob": "^10.3.10",
"ip": "^1.1.8",
"json5": "^2.2.3",
"roku-deploy": "^3.10.3",
@@ -52,10 +54,10 @@
"test:build:app": "cd playlet-app && npm run test:build",
"test:lib": "cd playlet-lib && npm run test",
"test:build:lib": "cd playlet-lib && npm run test:build",
"generate-images": "node tools/generate-images.js",
"version-sync": "node tools/version-sync.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",
"screenshot": "node tools/screenshot.js",
"profile-sync": "node tools/profile-sync.js",
"generate-sponsorblock-config": "node tools/generate-sponsorblock-config.js",
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "playlet-app",
"version": "0.12.1",
"version": "0.14.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "playlet-app",
"version": "0.12.1"
"version": "0.14.0"
}
}
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "playlet-app",
"version": "0.12.1",
"version": "0.14.0",
"description": "Unofficial Youtube client for Roku",
"scripts": {
"prebuild": "rm -rf build/playlet-app",
@@ -1,12 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<component name="BootstrapScene" extends="Scene">
<interface>
<field id="exitChannel" type="bool" alwaysNotify="true" />
<field id="launchArgs" type="assocarray" />
<field id="inputArgs" type="assocarray" alwaysNotify="true" />
<field id="playletLibLoadedUrl" type="assocarray" />
<field id="systemLogEvent" type="assocarray" />
<field id="systemLogEvent" type="assocarray" alwaysNotify="true" />
</interface>
<script type="text/brightscript" uri="pkg:/source/Dialog.bs" />
<script type="text/brightscript" uri="pkg:/source/Manifest.bs" />
@@ -1,5 +1,3 @@
<?xml version="1.0" encoding="UTF-8"?>
<component name="LoadingIndicator" extends="Group">
<children>
<Rectangle
@@ -0,0 +1,26 @@
{
inputHash: '0536f51fa72c2e4e368ea0e901aadfc1',
outputs: [
{
outputFilePath: 'images/splash-screen_fhd.jpg',
outputHash: 'b15f3a3f1ccc459cbca12cb828b78d16',
width: 1920,
height: 1080,
background: '#242424',
},
{
outputFilePath: 'images/splash-screen_hd.jpg',
outputHash: '25e9c4220f8a42101d6333e548e33aa8',
width: 1280,
height: 720,
background: '#242424',
},
{
outputFilePath: 'images/splash-screen_sd.jpg',
outputHash: 'c54a2f7fa65f443263806962450f2c04',
width: 720,
height: 480,
background: '#242424',
},
],
}
@@ -0,0 +1,4 @@
{
inputHash: 'd61131ccc714d8df0b4514ca76883494',
outputs: [],
}
@@ -0,0 +1,26 @@
{
inputHash: '3452c6ea1c84f59aedf5530bf86a7a51',
outputs: [
{
outputFilePath: 'images/channel-poster_fhd.png',
outputHash: 'd644a0db84deed0bcc41a41d08a4ef75',
width: 540,
height: 405,
background: '#FFFFFF',
},
{
outputFilePath: 'images/channel-poster_hd.png',
outputHash: 'd07a4ffaa021b55528bee91710f4e9d2',
width: 290,
height: 218,
background: '#FFFFFF',
},
{
outputFilePath: 'images/channel-poster_sd.png',
outputHash: '66a311c639f89ff009e4624468282b2f',
width: 246,
height: 140,
background: '#FFFFFF',
},
],
}
+4 -4
View File
@@ -2,14 +2,14 @@ title=Playlet
# Do not update version manually, it is auto updated from package.json
major_version=0
minor_version=12
build_version=00001
minor_version=14
build_version=00000
ui_resolutions=hd
## Channel Assets
### Main Menu Icons / Channel Poster Artwork
#### Image sizes are FHD: 540x405px | HD: 290x218px | SD: 214x144px
#### Image sizes are FHD: 540x405px | HD: 290x218px | SD: 246x140px
mm_icon_focus_fhd=pkg:/images/channel-poster_fhd.png
mm_icon_focus_hd=pkg:/images/channel-poster_hd.png
mm_icon_focus_sd=pkg:/images/channel-poster_sd.png
@@ -29,7 +29,7 @@ supports_input_launch=1
playlet_lib_remote_url=https://github.com/iBicha/playlet/releases/latest/download/playlet-lib.zip
playlet_lib_embedded_url=pkg:/lib/playlet-lib.zip
playlet_lib_debug_url=http://DEBUG_HOST_IP_ADDRESS:8080/playlet-lib.zip
playlet_lib_debug_url=http://DEBUG_HOST_IP_ADDRESS:8086/playlet-lib.zip
git_commit_sha=unknown
+3 -1
View File
@@ -66,7 +66,9 @@ function Main(args as object) as void
msg = wait(0, port)
msgType = type(msg)
if msgType = "roSystemLogEvent"
scene.systemLogEvent = msg.GetInfo()
info = msg.GetInfo()
info.DateTime = info.DateTime.ToISOString()
scene.systemLogEvent = info
else if msgType = "roSGScreenEvent"
if msg.isScreenClosed()
return
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "playlet-lib",
"version": "0.12.1",
"version": "0.14.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "playlet-lib",
"version": "0.12.1"
"version": "0.14.0"
}
}
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "playlet-lib",
"version": "0.12.1",
"version": "0.14.0",
"description": "Unofficial Youtube client for Roku",
"scripts": {
"prebuild": "rm -rf build/playlet-lib",
@@ -1,9 +1,9 @@
import "pkg:/source/utils/Types.bs"
import "pkg:/source/utils/StringUtils.bs"
import "pkg:/source/utils/FocusManagement.bs"
import "pkg:/components/Dialog/DialogUtils.bs"
import "pkg:/source/utils/Logging.bs"
import "pkg:/components/VideoPlayer/VideoUtils.bs"
import "pkg:/source/utils/FocusManagement.bs"
import "pkg:/source/utils/Logging.bs"
import "pkg:/source/utils/StringUtils.bs"
import "pkg:/source/utils/Types.bs"
function Init()
m.screens = {}
@@ -83,7 +83,22 @@ function onKeyEvent(key as string, press as boolean) as boolean
end if
if key = "options"
VideoUtils.ToggleVideoPictureInPicture()
else if key = "back"
return true
end if
if key = "play"
VideoUtils.TogglePause()
end if
if key = "pause"
VideoUtils.PauseVideo()
end if
if key = "playonly"
VideoUtils.ResumeVideo()
end if
if key = "back"
dialog = DialogUtils.ShowDialogButtons("Do you want to exit Playlet?", "Exit", ["Exit", "Cancel"])
dialog.observeField("buttonSelected", FuncName(OnExitDialog), ["buttonSelected"])
return true
@@ -1,5 +1,3 @@
<?xml version="1.0" encoding="UTF-8"?>
<component name="AppController" extends="Group" includes="AutoBind">
<interface>
<field id="root" type="node" />
@@ -1,4 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<component name="AppRoot" extends="Group" includes="Focus">
</component>
@@ -1,7 +1,10 @@
namespace ChannelUtils
function Open(contentNode as object)
function Open(contentNode as object, appController = invalid as object)
channelView = CreateObject("roSGNode", "ChannelView")
m.appController@.PushScreen(channelView)
if appController = invalid
appController = m.appController
end if
appController@.PushScreen(channelView)
channelView@.BindNode(invalid)
channelView.content = contentNode
end function
@@ -1,14 +1,24 @@
import "pkg:/source/utils/FocusManagement.bs"
import "pkg:/source/utils/Types.bs"
import "pkg:/source/utils/StringUtils.bs"
import "pkg:/source/utils/Types.bs"
function Init()
m.container = m.top.findNode("container")
m.scrollAnimation = m.top.findNode("scrollAnimation")
m.containerTranslation = m.scrollAnimation.findNode("containerTranslation")
m.bannerTranslation = m.scrollAnimation.findNode("bannerTranslation")
m.banner = m.top.findNode("banner")
m.thumbnail = m.top.findNode("thumbnail")
m.authorLabel = m.top.findNode("authorLabel")
m.rowList = m.top.FindNode("rowList")
m.rowList.screen = m.top
m.banner.ObserveField("loadStatus", FuncName(OnBannerLoadStatus))
m.author = ""
m.authorId = ""
InitializeTabs()
end function
function OnNodeready()
@@ -31,7 +41,6 @@ function OnContentSet() as void
' NOTE: "_author" not "author". See PlaylistContentNode.xml for explanation.
m.authorLabel.text = content._author
' TODO:P1 handle case where there's no banner - a big portion of the screen is blank
m.banner.uri = content.banner
if StringUtils.IsNullOrEmpty(content.thumbnail)
m.thumbnail.uri = ""
@@ -42,9 +51,30 @@ function OnContentSet() as void
end if
end if
m.rowList.content = content
content@.LoadChannel(m.invidious)
authorId = ValidString(content.authorId)
author = ValidString(content._author)
if (authorId <> m.authorId or author <> m.author) and IsArray(content.tabs)
m.authorId = authorId
m.author = author
m.rowList.feeds = CreateChannelFeeds(m.authorId, author, content.tabs)
end if
end function
function CreateChannelFeeds(authorId as string, author as string, tabs as object) as object
if authorId = ""
return invalid
end if
feeds = []
for i = 0 to tabs.count() - 1
tabName = tabs[i]
if m.tabs.DoesExist(tabName)
feeds.Push(m.tabs[tabName](authorId, author))
end if
end for
return feeds
end function
function OnkeyEvent(key as string, press as boolean) as boolean
@@ -69,6 +99,70 @@ function OnBannerLoadStatus() as void
return
end if
aspect = m.banner.bitmapWidth / m.banner.bitmapHeight
m.banner.height = m.banner.width / aspect
bannerAspect = m.banner.bitmapWidth / m.banner.bitmapHeight
bannerHeight = m.banner.width / bannerAspect
m.banner.height = bannerHeight
m.banner.translation = [0, -bannerHeight]
m.banner.visible = true
startPos = [0, -bannerHeight]
endPos = [0, 0]
midPos = [0, (startPos[1] + endPos[1]) / 2]
m.bannerTranslation.keyValue = [startPos, midPos, endPos]
startPos = [0, 0]
endPos = [0, bannerHeight - m.thumbnail.height * 0.4]
midPos = [0, (startPos[1] + endPos[1]) / 2]
m.containerTranslation.keyValue = [startPos, midPos, endPos]
m.scrollAnimation.control = "start"
end function
function InitializeTabs()
m.tabs = {
videos: function(authorId as string, author as string) as object
return CreateChannelFeed("Latest videos", "channel_videos", authorId, author)
end function,
shorts: function(authorId as string, author as string) as object
return CreateChannelFeed("Shorts", "channel_shorts", authorId, author)
end function,
streams: function(authorId as string, author as string) as object
return CreateChannelFeed("Live", "channel_streams", authorId, author)
end function,
podcasts: function(authorId as string, author as string) as object
return CreateChannelFeed("Podcasts", "channel_podcasts", authorId, author)
end function,
playlists: function(authorId as string, author as string) as object
return CreateChannelFeed("Playlists", "channel_playlists", authorId, author)
end function,
channels: function(authorId as string, author as string) as object
return CreateChannelFeed("Channels", "channel_channels", authorId, author)
end function
}
end function
function CreateChannelFeed(title as string, endpoint as string, ucid as string, author as string) as object
return {
title: title,
feedSources: [{
"id": `inv_${endpoint}_${ucid}`,
"title": `${author} - ${title}`,
"apiType": "Invidious",
"endpoint": endpoint,
"pathParams": {
"ucid": ucid
}
}]
}
end function
function GetContextMenuOptionsForItem(video as object) as object
content = m.top.content
if content = invalid or StringUtils.IsNullOrEmpty(content.authorId)
return []
end if
return m.bookmarks@.GetMenuForChannel(content)
end function
@@ -1,8 +1,9 @@
<component name="ChannelView" extends="Group" includes="AutoBind,Focus">
<component name="ChannelView" extends="Group" includes="AutoBind,Focus,ContextMenuProvider">
<interface>
<field id="content" type="node" onChange="OnContentSet" />
<field id="appController" type="node" bind="/AppController" />
<field id="invidious" type="node" bind="/Invidious" />
<field id="bookmarks" type="node" bind="/Bookmarks" />
</interface>
<children>
<Rectangle
@@ -13,42 +14,60 @@
<Poster
id="banner"
translation="[0,0]"
width="1280" />
width="1280"
visible="false" />
<Poster
translation="[115,180]"
width="104"
height="104"
uri="pkg:/images/circle-mask-500.png">
<Group id="container">
<Poster
translation="[115,20]"
width="104"
height="104"
uri="pkg:/images/circle-mask-500.png">
<CirclePoster
id="thumbnail"
width="100"
height="100"
translation="[2,2]" />
</Poster>
<CirclePoster
id="thumbnail"
width="100"
height="100"
translation="[2,2]"
failedBitmapUri="pkg:/images/thumbnail-missing.jpg" />
<Label
id="authorLabel"
translation="[228,226]"
font="font:MediumBoldSystemFont" />
<Label
id="authorLabel"
translation="[115,40]"
font="font:MediumBoldSystemFont" />
</Poster>
<VideoRowList
itemComponentName="RowCell"
id="rowList"
focusable="false"
translation="[0,320]"
numRows="1"
rowitemSize="[[350,196]]"
rowItemSpacing="[[25,0]]"
itemSize="[1280,326]"
itemSpacing="[0,65]"
rowLabelOffset="[[115,20]]"
focusXOffset="[115]"
showRowLabel="[true]"
rowFocusAnimationStyle="floatingfocus"
variableWidthItems="true"
focusBitmapUri="pkg:/images/focus_grid.9.png" />
<VideoRowList
itemComponentName="RowCell"
id="rowList"
focusable="false"
translation="[0,160]"
numRows="2"
rowitemSize="[[350,196]]"
rowItemSpacing="[[25,0]]"
itemSize="[1280,326]"
itemSpacing="[0,65]"
rowLabelOffset="[[115,20]]"
focusXOffset="[115]"
showRowLabel="[true]"
rowFocusAnimationStyle="floatingfocus"
variableWidthItems="true"
focusBitmapUri="pkg:/images/focus_grid.9.png" />
<Animation
id="scrollAnimation"
delay="0.3"
duration="0.6">
<Vector2DFieldInterpolator
id="bannerTranslation"
key="[ 0.0, 0.5, 1.0 ]"
fieldToInterp="banner.translation" />
<Vector2DFieldInterpolator
id="containerTranslation"
key="[ 0.0, 0.5, 1.0 ]"
fieldToInterp="container.translation" />
</Animation>
</Group>
</children>
</component>
@@ -4,11 +4,10 @@ function Init()
end function
function UpdateMaskSize()
width = m.top.poster.width
height = m.top.poster.height
width = m.top.width
height = m.top.height
maskSize = [width * GetScaleFactor(), height * GetScaleFactor()]
m.top.maskGroup.maskSize = maskSize
m.top.maskSize = [width * GetScaleFactor(), height * GetScaleFactor()]
end function
' MaskGroup component do not scale with with UI resolution
@@ -11,6 +11,7 @@
<field id="loadStatus" type="string" alias="Poster.loadStatus" />
<field id="maskUri" type="uri" value="pkg:/images/circle-mask-500.png" alias="MaskGroup.maskuri" />
<field id="maskSize" type="vector2d" alias="MaskGroup.maskSize" />
</interface>
<children>
<MaskGroup
@@ -0,0 +1,5 @@
<component name="BookmarkContentNode" extends="ContentNode">
<interface>
<field id="feedSource" type="assocarray" />
</interface>
</component>
@@ -1,10 +1,9 @@
import "pkg:/source/asyncTask/asyncTask.bs"
import "pkg:/components/ContentNode/ChannelContentTask.bs"
import "pkg:/source/utils/ErrorUtils.bs"
import "pkg:/components/Dialog/DialogUtils.bs"
import "pkg:/source/asyncTask/asyncTask.bs"
import "pkg:/source/utils/ErrorUtils.bs"
function Init()
m.top.latestVideos = m.top.findNode("latestVideos")
end function
function LoadChannel(invidiousNode as object) as void
@@ -40,9 +39,9 @@ function OnChannelContentTaskResult(output as object) as void
end if
error = ErrorUtils.Format(error)
LogError(error)
playlistId = output.task.input.content.playlistId
message = `Failed to load playlist ${playlistId}\n${error}`
DialogUtils.ShowDialog(message, "Playlist load fail", true)
authorId = output.task.input.content.authorId
message = `Failed to load channel ${authorId}\n${error}`
DialogUtils.ShowDialog(message, "Channel load fail", true)
return
end if
end function
@@ -3,10 +3,12 @@
<field id="type" type="string" value="channel" />
<field id="loadState" type="string" />
<function name="LoadChannel" />
<!-- index in a feed -->
<field id="feedSourcesIndex" type="integer" value="-1" />
<!-- NOTE: "_author" not "author". See PlaylistContentNode.xml for explanation -->
<field id="_author" type="string" />
<field id="authorId" type="string" />
<field id="channelHandle" type="string" />
<field id="description" type="string" />
<field id="subCount" type="integer" />
<field id="subCountText" type="string" />
@@ -14,15 +16,8 @@
<field id="videoCountText" type="string" />
<field id="thumbnail" type="string" />
<field id="banner" type="string" />
<field id="latestVideos" type="node" />
<field id="tabs" type="array" />
<field id="HDItemWidth" type="float" value="196" />
</interface>
<children>
<ContentNode id="latestVideos" title="Latest Videos">
</ContentNode>
</children>
</component>
@@ -0,0 +1,7 @@
<component name="ContextMenuItemContentNode" extends="ContentNode">
<interface>
<field id="node" type="node" />
<field id="func" type="string" />
<field id="args" type="array" />
</interface>
</component>
@@ -1,8 +1,7 @@
<component name="FeedContentNode" extends="ContentNode">
<interface>
<field id="feed" type="assocarray" />
<field id="feedSources" type="array" />
<field id="feedSourcesIndex" type="integer" />
<field id="loadState" type="string" />
<field id="pagination" type="boolean" />
<field id="page" type="integer" value="0" />
</interface>
</component>
@@ -2,6 +2,8 @@
<interface>
<field id="type" type="string" value="playlist" />
<field id="loadState" type="string" />
<!-- index in a feed -->
<field id="feedSourcesIndex" type="integer" value="-1" />
<!--
For some strange reason, the "author" field can only be set once.
If you try to set it again, it will not be updated, with type mismatch warning:
@@ -22,6 +24,7 @@
we can query it's original owner)
-->
<field id="_author" type="string" />
<field id="authorId" type="string" />
<field id="playlistId" type="string" />
<field id="thumbnail" type="uri" />
<field id="thumbnailBackground" type="uri" />
@@ -3,9 +3,12 @@
<field id="type" type="string" value="video" />
<field id="author" type="string" />
<field id="authorId" type="string" />
<field id="hlsUrl" type="uri" />
<!-- index in a playlist -->
<field id="index" type="integer" value="-1" />
<!-- index in a feed -->
<field id="feedSourcesIndex" type="integer" value="-1" />
<field id="isUpcoming" type="boolean" />
<field id="lengthSeconds" type="integer" />
<field id="lengthText" type="string" />
@@ -0,0 +1,171 @@
import "pkg:/source/utils/FocusManagement.bs"
import "pkg:/source/utils/Logging.bs"
import "pkg:/source/utils/StringUtils.bs"
import "pkg:/source/utils/Types.bs"
' TODO:P0 Web app support
' TODO:P0 Web apis and open api spec updates
'
' From the main screen:
' When a video is selected:
' - "Play" - DONE
' - "Queue" - DONE
' - "Open Channel" - DONE
' - "Add to "Videos" bookmark" - DONE
' - If video is already in a bookmark, "Remove from Bookmarks" - DONE
'
' When a channel is selected:
' - "Open" - DONE
' - "Add to "Channels" bookmark" - DONE
' - "Add to <ChannelName> bookmark" - DONE
' - If channel is already in a bookmark, "Remove from Bookmarks" - DONE
' - PlaylistId starting with "IV" cannot be added to a bookmark - DONE
'
' When a playlist is selected:
' - "Play" - DONE
' - "Queue" - DONE
' - "Open" - DONE
' - "Add to "Playlists" bookmark" - DONE
' - "Add to <PlaylistName> bookmark" - DONE
' - If playlist is already in a bookmark, "Remove from Bookmarks" - DONE
' When any:
' - "Reload feed" - DONE
'
' From Playlist view:
' When a video is selected:
' - "Play" - DONE
' - "Queue" - DONE
' - "Play video" - DONE
' - "Queue video" - DONE
' - "Open Channel" - DONE
' - "Add to "Playlists" bookmark" - DONE
' - "Add to <PlaylistName> bookmark" - DONE
' - "Add to "Videos" bookmark" - DONE
'
' From Channel view:
' When a video is selected:
' - "Play" - DONE
' - "Queue" - DONE
' - "Add to "Channels" bookmark" - DONE
' - "Add to <ChannelName> - <feed> bookmark" feed being latest videos, live, shorts, etc - DONE
' - "Add to "Videos" bookmark" - DONE
'
' When a playlist is selected:
' - "Play" - DONE
' - "Queue" - DONE
' - "Open" - DONE
' - "Add to "Channels" bookmark" - DONE
' - "Add to <ChannelName> - <feed> bookmark" feed being latest videos, live, shorts, etc - DONE
' - "Add to "Playlists" bookmark" - DONE
' - "Add to <PlaylistName> bookmark" - DONE
'
' From search view:
' When a video/channel/playlist is selected:
' - Inherit options - DONE
' - "Add to "Search - ${q}" bookmark" - this includes the search filters used - DONE
'
' From bookmarks view:
' When a video/channel/playlist is selected:
' - Inherit options
' - "Remove item from Bookmarks"
' - "Remove group from Bookmarks"
' - "Reload bookmarks" - DONE
'
' TODO:P1 Playlist item seletected from the bookmarks need to play as a playlist, not as a single video
' TODO:P1 Context menu might need to be scrollable (both horizontally and vertically)
' TODO:P1 Context menu might need sections. Example:
' In a Channel view, while selecting a playlist:
' - Channel
' - Add to "Channels" bookmark
' - Other "Channels" related context menu items
' - Playlist
' - Add to "Playlists" bookmark
' - "Play/Queue"
' - Other "Playlists" related context menu items
function Init()
m.optionsList = m.top.findNode("optionsList")
m.showAnimation = m.top.findNode("showAnimation")
end function
function Show(unsued as dynamic)
m.optionsList.ObserveField("itemSelected", FuncName(OnItemSelected))
m.showAnimation.control = "start"
end function
function OnFocusChange() as void
if not m.top.focus
return
end if
NodeSetFocus(m.optionsList, true)
end function
function OnOptionsSet() as void
options = m.top.options
if options = invalid
return
end if
content = CreateObject("roSGNode", "ContentNode")
for each option in options
optionNode = CreateObject("roSGNode", "ContentNode")
optionNode.title = option.title
content.appendChild(optionNode)
end for
m.optionsList.content = content
end function
function OnItemSelected(event as object) as void
index = event.getData()
button = m.optionsList.content.getChild(index)
Close()
LogInfo("Menu button selected:", button.title)
options = m.top.options
if index >= options.count()
LogError("Menu button index out of range:", index)
return
end if
option = options[index]
node = option.node
func = option.func
args = option.args
if node = invalid or StringUtils.IsNullOrEmpty(func) or args = invalid
LogError("Menu button action is invalid")
return
end if
if args.count() = 1
node.callFunc(func, args[0])
else if args.count() = 2
node.callFunc(func, args[0], args[1])
else if args.count() = 3
node.callFunc(func, args[0], args[1], args[2])
else if args.count() = 4
node.callFunc(func, args[0], args[1], args[2], args[3])
else if args.count() = 5
node.callFunc(func, args[0], args[1], args[2], args[3], args[4])
else
LogError("Menu button action has too many arguments")
end if
end function
function OnkeyEvent(key as string, press as boolean) as boolean
if press = false
return false
end if
if key = "back"
Close()
return true
end if
return false
end function
function Close()
m.top.appController@.PopScreen(invalid)
end function
@@ -0,0 +1,70 @@
<component name="ContextMenu" extends="Group" includes="Focus">
<interface>
<field id="thumbnail" type="uri" alias="thumbnail.uri" />
<field id="title" type="string" alias="titleLabel.text" />
<field id="subtitle" type="string" alias="subtitleLabel.text" />
<field id="options" type="nodearray" onChange="OnOptionsSet" />
<field id="appController" type="node" />
<function name="Show" />
</interface>
<children>
<Rectangle
id="background"
width="1280"
height="720"
color="#000000"
opacity="0" />
<Rectangle
id="container"
width="470"
height="720"
translation="[-470,0]"
color="0x242424">
<Poster
id="thumbnail"
width="190"
height="110"
loadDisplayMode="scaleToFit"
translation="[40,50]" />
<LayoutGroup
translation="[40,180]"
itemSpacings="[10]">
<Label
id="titleLabel"
width="390"
maxLines="2"
font="font:MediumBoldSystemFont"
wrap="true" />
<Label
id="subtitleLabel"
width="390"
font="font:SmallestBoldSystemFont"
wrap="true" />
</LayoutGroup>
<MarkupList
id="optionsList"
itemSize="[420,50]"
translation="[25,310]"
itemComponentName="ContextMenuRow"
vertFocusAnimationStyle="floatingFocus"
numRows="8" />
</Rectangle>
<Animation id="showAnimation"
duration="0.3"
optional="true">
<FloatFieldInterpolator
id="fadeInterpolator"
key="[0.0, 0.5, 1.0]"
keyValue="[0.0, 0.4, 0.8]"
fieldToInterp="background.opacity" />
<Vector2DFieldInterpolator
id="translationInterpolator"
key="[0.0, 0.5, 1.0]"
keyValue="[[-470,0], [-235,0], [0,0]]"
fieldToInterp="container.translation" />
</Animation>
</children>
</component>
@@ -0,0 +1,29 @@
function OnContentSet() as void
content = m.top.itemContent
if content = invalid
return
end if
m.top.text = content.title
end function
function OnItemHasFocus()
hasFocus = m.top.itemHasFocus
if hasFocus
m.top.font = "font:SmallestBoldSystemFont"
m.top.color = "0x262626ff"
else
m.top.font = "font:SmallestSystemFont"
m.top.color = "0xddddddff"
end if
end function
function OnFocusPercent()
if m.top.focusPercent > 0.5
m.top.font = "font:SmallestBoldSystemFont"
m.top.color = "0x262626ff"
else
m.top.font = "font:SmallestSystemFont"
m.top.color = "0xddddddff"
end if
end function
@@ -0,0 +1,19 @@
<component name="ContextMenuRow" extends="Group">
<interface>
<field id="text" type="string" alias="label.text" />
<field id="font" type="node" alias="label.font" />
<field id="color" type="color" alias="label.color" />
<field id="itemContent" type="node" onChange="OnContentSet" />
<field id="itemHasFocus" type="boolean" onChange="OnItemHasFocus" />
<field id="listHasFocus" type="boolean" />
<field id="focusPercent" type="float" onChange="OnFocusPercent" />
</interface>
<children>
<ScrollingLabel
id="label"
maxWidth="420"
height="50"
vertAlign="center"
font="font:SmallestSystemFont" />
</children>
</component>
@@ -0,0 +1,76 @@
import "pkg:/source/utils/Logging.bs"
namespace ContextMenuUtils
function Open(providers as object, appController as object, item as object) as object
if item = invalid
return invalid
end if
options = GetOptions(item, providers)
if options.Count() = 0
LogWarn("No context menu options available for item")
return invalid
end if
contextMenu = CreateObject("roSGNode", "ContextMenu")
contextMenu.appController = appController
appController@.PushScreen(contextMenu)
ContextMenuUtils.SetItem(contextMenu, item)
contextMenu.options = options
contextMenu@.Show(invalid)
return contextMenu
end function
function SetItem(contextMenu as object, item as object)
title = ""
subtitle = ""
thumbnail = ""
if item.type = "video"
LogInfo("Opening context menu for video:", item.videoId)
title = item.title
subtitle = item.author
thumbnail = item.thumbnail
else if item.type = "playlist"
LogInfo("Opening context menu for playlist:", item.playlistId)
title = item.title
subtitle = item._author
thumbnail = item.thumbnail
else if item.type = "channel"
LogInfo("Opening context menu for channel:", item.authorId)
title = item._author
thumbnail = item.thumbnail
end if
contextMenu.title = title
contextMenu.subtitle = subtitle
contextMenu.thumbnail = thumbnail
end function
function GetOptions(item as object, providers as object) as object
allOptions = []
for each provider in providers
if provider <> invalid and provider.hasField("supportsContextMenu") and provider.supportsContextMenu = true
options = provider@.GetContextMenuOptionsForItem(item)
if options <> invalid
allOptions.append(options)
end if
end if
end for
return allOptions
end function
function CreateOption(title as string, node as object, func as string, args as object) as object
option = CreateObject("roSGNode", "ContextMenuItemContentNode")
option.title = title
option.node = node
option.func = func
option.args = args
return option
end function
end namespace
@@ -12,9 +12,12 @@ namespace DialogUtils
dialog.title = title
dialog.buttons = buttons
if large
deviceInfo = CreateObject("roDeviceInfo")
displaySize = deviceInfo.GetDisplaySize()
dialog.width = displaySize.w - 100
if m._deviceDisplayWidth = invalid
deviceInfo = CreateObject("roDeviceInfo")
displaySize = deviceInfo.GetDisplaySize()
m._deviceDisplayWidth = displaySize.w
end if
dialog.width = m._deviceDisplayWidth - 100
end if
m.top.getScene().dialog = dialog
return dialog
@@ -1,7 +1,7 @@
import "pkg:/source/utils/Types.bs"
import "pkg:/source/asyncTask/asyncTask.bs"
import "pkg:/components/Screens/WebAppScreen/GenerateQrCodeTask.bs"
import "pkg:/source/asyncTask/asyncTask.bs"
import "pkg:/source/utils/StringUtils.bs"
import "pkg:/source/utils/Types.bs"
function Init()
m.urlLabel = m.top.findNode("urlLabel")
@@ -26,11 +26,11 @@
<Font role="font" uri="font:SystemFontFile" size="24" />
</Label>
<Poster
id='QrCodePoster'
width='300'
height='300'
loadWidth='300'
loadHeight='300'
id="QrCodePoster"
width="300"
height="300"
loadWidth="300"
loadHeight="300"
translation="[50, 50]" />
<Label
id="urlLabel"
@@ -1,4 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<component name="SimpleDialog" extends="StandardMessageDialog">
</component>
+2 -1
View File
@@ -1,5 +1,6 @@
import "pkg:/source/utils/StringUtils.bs"
import "pkg:/components/VideoPlayer/VideoUtils.bs"
import "pkg:/source/utils/Logging.bs"
import "pkg:/source/utils/StringUtils.bs"
import "pkg:/source/utils/Types.bs"
function InitEcpArgs()
+14 -1
View File
@@ -1,3 +1,4 @@
import "pkg:/source/utils/Logging.bs"
import "pkg:/source/utils/Types.bs"
function Init()
@@ -13,6 +14,18 @@ function Init()
end if
m.port = port
StartLogger(m.top)
end function
function StartLogger(logger as object, logLevel = LogLevel.Info as LogLevel) as void
if m.global.logger <> invalid
return
end if
logger.logLevel = logLevel
m.global.addFields({ logger: logger })
logger.control = "run"
end function
function LoggerLoop()
@@ -54,7 +67,7 @@ function OnLineSysLog(event as object, logsFile as string, buffer as object) as
if info.LogType <> "http.error"
return
end if
line = `[SysLog] ${FormatJson(info)}`
line = "[ERROR][SysLog] " + ToString(info)
' bs:disable-next-line LINT3012
print line
+6 -7
View File
@@ -1,10 +1,9 @@
<?xml version='1.0' encoding='UTF-8'?>
<component name='Logger' extends='Task'>
<component name="Logger" extends="Task">
<interface>
<field id='logLevel' type='int' value='2' />
<field id='logLine' type='string' />
<field id='folder' type='string' value='cachefs:/logs' />
<field id='filename' type='string' value='app_logs.txt' />
<field id='filenamePrevious' type='string' value='app_logs_previous.txt' />
<field id="logLevel" type="int" value="2" />
<field id="logLine" type="string" alwaysNotify="true" />
<field id="folder" type="string" value="cachefs:/logs" />
<field id="filename" type="string" value="app_logs.txt" />
<field id="filenamePrevious" type="string" value="app_logs_previous.txt" />
</interface>
</component>
+1 -4
View File
@@ -1,11 +1,8 @@
import "pkg:/components/EcpArgs.bs"
import "pkg:/components/parts/AutoBind/AutoBind.part.bs"
import "pkg:/source/utils/LoadingScreen.bs"
import "pkg:/source/utils/Logging.bs"
import "pkg:/components/EcpArgs.bs"
function Init()
InitializeLogger()
m.scene = m.top.getScene()
' At this point, the "MainScene" node is not yet added to the scene, and does not have a parent yet.
' Let's wait until it has one.
@@ -1,11 +1,9 @@
'import "pkg:/components/EcpArgs.bs"
'import "pkg:/components/parts/AutoBind/AutoBind.part.bs"
'import "pkg:/source/utils/LoadingScreen.bs"
'import "pkg:/source/utils/Logging.bs"
'import "pkg:/components/EcpArgs.bs"
function Init()
InitializeBindings() ' auto-generated!
InitializeLogger()
m.scene = m.top.getScene()
' At this point, the "MainScene" node is not yet added to the scene, and does not have a parent yet.
' Let's wait until it has one.
@@ -1,4 +1,3 @@
<?xml version="1.0" encoding="UTF-8" ?>
<component name="MainScene" extends="Group">
<interface>
<field id="bindings" type="assocarray" onChange="OnBindingSetRegisterAutoBind" />
@@ -10,23 +9,26 @@
<script type="text/brightscript" uri="pkg:/components/parts/AutoBind/AutoBind.part.brs" />
<script type="text/brightscript" uri="pkg:/components/MainScene_bindings.brs" />
<script type="text/brightscript" uri="pkg:/components/MainScene.brs" />
<script type="text/brightscript" uri="pkg:/source/utils/Logging.brs" />
<script type="text/brightscript" uri="pkg:/source/utils/LoadingScreen.brs" />
<script type="text/brightscript" uri="pkg:/components/EcpArgs.brs" />
<script type="text/brightscript" uri="pkg:/source/utils/Types.brs" />
<script type="text/brightscript" uri="pkg:/source/utils/StringUtils.brs" />
<script type="text/brightscript" uri="pkg:/source/utils/Logging.brs" />
<script type="text/brightscript" uri="pkg:/components/VideoPlayer/VideoUtils.brs" />
<script type="text/brightscript" uri="pkg:/source/utils/FocusManagement.brs" />
<script type="text/brightscript" uri="pkg:/components/Dialog/DialogUtils.brs" />
<script type="text/brightscript" uri="pkg:/source/bslib.brs" />
<children>
<Logger id="Logger" />
<AppController id="AppController">
<Group id="Stack">
<AppRoot id="AppRoot">
<NavBar id="NavBar" focusIndex="1">
<ContentNode role="items">
<NavBarItem screen="SearchScreen" text="Search" icon="pkg:/images/icons/search.png" canFocus="true" />
<NavBarItem screen="HomeScreen" text="Home" icon="pkg:/images/icons/home.png" canFocus="true" />
<NavBarItem screen="SettingsScreen" text="Settings" icon="pkg:/images/icons/settings.png" canFocus="true" />
<NavBarItem screen="SearchScreen" text="Search" icon="pkg:/images/icons/search.png" />
<NavBarItem screen="HomeScreen" text="Home" icon="pkg:/images/icons/home.png" />
<NavBarItem screen="BookmarksScreen" text="Bookmarks" icon="pkg:/images/icons/star.png" />
<NavBarItem screen="SettingsScreen" text="Settings" icon="pkg:/images/icons/settings.png" />
<NavBarItem screen="WebAppScreen" text="Web App" icon="pkg:/images/icons/phone.png" />
<NavBarItem screen="AppInfoScreen" text="Info" icon="pkg:/images/icons/info.png" />
</ContentNode>
@@ -38,6 +40,7 @@
<PlayQueue id="PlayQueue" />
<ApplicationInfo id="ApplicationInfo" />
<Preferences id="Preferences" />
<Bookmarks id="Bookmarks" />
<Invidious id="Invidious" />
<PlayletWebServer id="WebServer" port="8888" />
</AppController>
+14 -9
View File
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<component name="MainScene" extends="Group" includes="AutoBind">
<children>
<!-- Logger should remain the first child, to make sure it is initialized first in the scene -->
<Logger id="Logger" />
<AppController id="AppController" root="bind:./AppRoot" stack="bind:./Stack">
<Group id="Stack">
<AppRoot id="AppRoot">
@@ -10,20 +10,22 @@
<NavBarItem
screen="SearchScreen"
text="Search"
icon="pkg:/images/icons/search.png"
canFocus="true">
icon="pkg:/images/icons/search.png">
</NavBarItem>
<NavBarItem
screen="HomeScreen"
text="Home"
icon="pkg:/images/icons/home.png"
canFocus="true">
icon="pkg:/images/icons/home.png">
</NavBarItem>
<NavBarItem
screen="BookmarksScreen"
text="Bookmarks"
icon="pkg:/images/icons/star.png">
</NavBarItem>
<NavBarItem
screen="SettingsScreen"
text="Settings"
icon="pkg:/images/icons/settings.png"
canFocus="true">
icon="pkg:/images/icons/settings.png">
</NavBarItem>
<NavBarItem
screen="WebAppScreen"
@@ -48,6 +50,7 @@
invidious="bind:../Invidious" />
<ApplicationInfo id="ApplicationInfo" />
<Preferences id="Preferences" />
<Bookmarks id="Bookmarks" />
<Invidious id="Invidious"
webServer="bind:../WebServer"
@@ -57,10 +60,12 @@
<PlayletWebServer
id="WebServer"
port="8888"
appController="bind:/AppController"
applicationInfo="bind:../ApplicationInfo"
invidious="bind:../Invidious"
preferences="bind:../Preferences"
playQueue="bind:../PlayQueue" />
playQueue="bind:../PlayQueue"
bookmarks="bind:../Bookmarks" />
</AppController>
</children>
</component>
@@ -21,10 +21,12 @@ function InitializeBindings()
"preferences": "../Preferences"
},
"WebServer": {
"appController": "/AppController",
"applicationInfo": "../ApplicationInfo",
"invidious": "../Invidious",
"preferences": "../Preferences",
"playQueue": "../PlayQueue"
"playQueue": "../PlayQueue",
"bookmarks": "../Bookmarks"
}
}
}
@@ -50,8 +50,8 @@ function setIconSize()
m.buttonIcon.width = m.buttonIcon.height
m.buttonIcon.translation = [((width - m.buttonIcon.width) / 2), ((height - m.buttonIcon.height) / 2)]
m.buttonText.translation = [0, height]
m.buttonText.width = width
m.buttonText.translation = [-5, height]
m.buttonText.width = width + 10
end if
end function
@@ -1,4 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<component name="IconButton" extends="Group" includes="Focus">
<children>
<Poster id="buttonBackground" uri="pkg:/images/white.9.png" visible="false" />
+3 -3
View File
@@ -74,13 +74,13 @@ function onKeyEvent(key as string, press as boolean) as boolean
return false
end if
navBarItem = m.top.items.getChild(m.top.focusIndex)
if navBarItem.canFocus <> true
return false
end if
screen = m.appController@.GetRootScreen(navBarItem.screen)
if screen = invalid
return false
end if
if not screen.focusable
return false
end if
NodeSetFocus(screen, true)
return true
end if
+1 -3
View File
@@ -1,5 +1,3 @@
<?xml version="1.0" encoding="UTF-8"?>
<component name="NavBar" extends="Group" includes="AutoBind">
<interface>
<field id="appController" type="node" />
@@ -10,7 +8,7 @@
<children>
<Rectangle
height="720"
width="105"
width="115"
color="#242424"
opacity="0.9">
<LayoutGroup
@@ -1,10 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<component name="NavBarItem" extends="ContentNode">
<interface>
<field id="screen" type="string" />
<field id="icon" type="string" />
<field id="text" type="string" />
<field id="canFocus" type="boolean" value="false" />
</interface>
</component>
@@ -0,0 +1,49 @@
const LONG_PRESS_KEY = "OK_LONG_PRESS"
function InitializeLongPressTimer(duration = 1.0 as float)
m._longPressTimer = CreateObject("roSGNode", "Timer")
m._longPressTimer.duration = duration
m._longPressFired = false
m._longPressTimer.ObserveField("fire", FuncName(LongPressTimerFired))
end function
function LongPressHandler(key as string, press as boolean) as boolean
#if DEBUG
if key = "Lit_l"
LogInfo("Simulating long press using key:", key, "press:", press)
m._longPressFired = true
return OnkeyEvent(LONG_PRESS_KEY, press)
end if
#end if
if key = "OK" and press
m._longPressTimer.control = "stop"
m._longPressTimer.control = "start"
m._longPressFired = false
m._okPressed = true
return true
end if
if key = "OK" and not press
m._longPressTimer.control = "stop"
if m._longPressFired = true
m._longPressFired = false
m._okPressed = false
return true
end if
' This case is for handling a dialog: The dialog will be dismissed with the OK down event,
' and we would trigger the action with the OK up event. The action should only happen if
' we detected both down and up events.
wasOkPressed = m._okPressed
m._okPressed = false
if wasOkPressed <> true
return true
end if
end if
return false
end function
function LongPressTimerFired()
m._longPressFired = true
OnkeyEvent(LONG_PRESS_KEY, true)
end function
@@ -1,5 +1,3 @@
<?xml version="1.0" encoding="UTF-8"?>
<component name="NavigationTestNode" extends="Node">
<interface>
<function name="SetNavigation" />
@@ -1,12 +1,12 @@
import "pkg:/source/utils/Types.bs"
import "pkg:/components/Dialog/DialogUtils.bs"
import "pkg:/components/PlaylistView/PlaylistContentTask.bs"
import "pkg:/components/VideoFeed/FeedLoadState.bs"
import "pkg:/components/VideoPlayer/VideoUtils.bs"
import "pkg:/source/asyncTask/asyncTask.bs"
import "pkg:/components/VideoFeed/FeedLoadState.bs"
import "pkg:/components/PlaylistView/PlaylistContentTask.bs"
import "pkg:/source/utils/Logging.bs"
import "pkg:/source/utils/ErrorUtils.bs"
import "pkg:/components/Dialog/DialogUtils.bs"
import "pkg:/source/utils/ArrayUtils.bs"
import "pkg:/source/utils/ErrorUtils.bs"
import "pkg:/source/utils/Logging.bs"
import "pkg:/source/utils/Types.bs"
function Init()
m.pendingLoadTasks = {}
@@ -1,5 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<component name="PlayQueue" extends="Node">
<interface>
<field id="queue" type="array" />
@@ -1,7 +1,10 @@
namespace PlaylistUtils
function Open(contentNode as object)
function Open(contentNode as object, appController = invalid as object)
playlistView = CreateObject("roSGNode", "PlaylistView")
m.appController@.PushScreen(playlistView)
if appController = invalid
appController = m.appController
end if
appController@.PushScreen(playlistView)
playlistView@.BindNode(invalid)
playlistView.content = contentNode
end function
@@ -1,13 +1,16 @@
import "pkg:/source/utils/FocusManagement.bs"
import "pkg:/source/utils/Types.bs"
import "pkg:/source/utils/StringUtils.bs"
import "pkg:/components/VideoPlayer/VideoUtils.bs"
import "pkg:/source/utils/Logging.bs"
import "pkg:/source/asyncTask/asyncTask.bs"
import "pkg:/components/ChannelView/ChannelUtils.bs"
import "pkg:/components/ContextMenu/ContextMenuUtils.bs"
import "pkg:/components/Dialog/DialogUtils.bs"
import "pkg:/components/Navigation/LongPress.bs"
import "pkg:/components/PlaylistView/PlaylistContentTask.bs"
import "pkg:/components/VideoFeed/FeedLoadState.bs"
import "pkg:/components/VideoPlayer/VideoUtils.bs"
import "pkg:/source/asyncTask/asyncTask.bs"
import "pkg:/source/utils/ErrorUtils.bs"
import "pkg:/components/Dialog/DialogUtils.bs"
import "pkg:/source/utils/FocusManagement.bs"
import "pkg:/source/utils/Logging.bs"
import "pkg:/source/utils/StringUtils.bs"
import "pkg:/source/utils/Types.bs"
function Init()
m.background = m.top.findNode("background")
@@ -21,7 +24,7 @@ end function
function OnNodeReady()
m.list.ObserveField("itemFocused", FuncName(OnItemFocused))
m.list.observeField("itemSelected", FuncName(OnItemSelected))
InitializeLongPressTimer()
end function
function OnFocusChange() as void
@@ -58,6 +61,20 @@ function OnContentSet() as void
end function
function OnkeyEvent(key as string, press as boolean) as boolean
if LongPressHandler(key, press)
return true
end if
if key = LONG_PRESS_KEY and press
OnItemLongPressed(m.list.itemFocused)
return true
end if
if key = "OK" and not press
OnItemSelected(m.list.itemFocused)
return true
end if
if press = false
return false
end if
@@ -81,18 +98,94 @@ function OnItemFocused()
LoadPlaylistIfNeeded()
end function
function OnItemSelected(event as object)
index = event.getData()
function OnItemSelected(index as integer) as void
playlist = m.list.content
if playlist = invalid
return
end if
if index < 0 or index >= playlist.getChildCount()
return
end if
playlistId = playlist.playlistId
video = playlist.getChild(index)
videoId = video.videoId
if not StringUtils.IsNullOrEmpty(videoId)
LogInfo("Play playlist: " + playlistId + " video: " + videoId)
LogInfo("Play playlist:", playlistId, "video:", videoId)
m.playQueue@.Play(playlist, index)
end if
end function
function OnItemLongPressed(index as integer) as void
playlist = m.list.content
if playlist = invalid
return
end if
if index < 0 or index >= playlist.getChildCount()
return
end if
playlistId = playlist.playlistId
video = playlist.getChild(index)
videoId = video.videoId
if StringUtils.IsNullOrEmpty(videoId)
LogWarn("Long press video with no id in playlist/ playlist:", playlistId, "video:", videoId)
return
end if
LogInfo("Long press: playlist:", playlistId, "video:", videoId)
contextMenuProviders = [m.top]
ContextMenuUtils.Open(contextMenuProviders, m.appController, video)
end function
function GetContextMenuOptionsForItem(video as object) as object
playlist = m.list.content
if playlist = invalid
return []
end if
index = m.list.itemFocused
if index < 0 or index >= playlist.getChildCount()
return []
end if
selectedVideo = playlist.getChild(m.list.itemFocused)
if selectedVideo = invalid or not selectedVideo.isSameNode(video)
return []
end if
options = [
ContextMenuUtils.CreateOption("Play", m.playQueue, "Play", [playlist, index]),
ContextMenuUtils.CreateOption("Queue", m.playQueue, "AddToQueue", [playlist])
ContextMenuUtils.CreateOption("Play video", m.playQueue, "Play", [video, -1]),
ContextMenuUtils.CreateOption("Queue video", m.playQueue, "AddToQueue", [video]),
]
if not StringUtils.IsNullOrEmpty(playlist.authorId)
options.push(ContextMenuUtils.CreateOption("Open channel", m.top, "OpenPlaylistChannel", [playlist]))
end if
options.append(m.bookmarks@.GetMenuForPlaylist(playlist))
options.append(m.bookmarks@.GetMenuForVideo(video))
return options
end function
function OpenPlaylistChannel(playlist as object) as void
authorId = playlist.authorId
if StringUtils.IsNullOrEmpty(authorId)
LogWarn("Invalid authorId:", authorId)
return
end if
channel = InvidiousContent.ToChannelContentNode(invalid, { authorId: authorId }, invalid)
ChannelUtils.Open(channel)
end function
'TODO:P1 a playlist could have been opened from the bookmarks, which can be as old as 3 days
' We should make a request in this case, and let the cache handle freshness.
function LoadPlaylistIfNeeded() as void
content = m.top.content
if content = invalid
@@ -1,16 +1,17 @@
<component name="PlaylistView" extends="Group" includes="AutoBind,Focus">
<component name="PlaylistView" extends="Group" includes="AutoBind,Focus,ContextMenuProvider">
<interface>
<field id="content" type="node" onChange="OnContentSet" />
<field id="appController" type="node" bind="/AppController" />
<field id="invidious" type="node" bind="/Invidious" />
<field id="playQueue" type="node" bind="/PlayQueue" />
<field id="bookmarks" type="node" bind="/Bookmarks" />
<function name="OpenPlaylistChannel" />
</interface>
<children>
<Rectangle
width="1280"
height="720"
color="0x242424">
</Rectangle>
color="0x242424" />
<Poster
id="backgroundSmall"
width="1280"
@@ -1,14 +1,9 @@
import "pkg:/source/utils/Types.bs"
import "pkg:/source/utils/TimeUtils.bs"
import "pkg:/source/utils/Types.bs"
function Init()
m.titleLabel = m.top.findNode("titleLabel")
m.authorLabel = m.top.findNode("authorLabel")
m.thumbnail = m.top.findNode("thumbnail")
m.durationRect = m.top.FindNode("durationRect")
m.durationLabel = m.top.FindNode("durationLabel")
m.thumbnail.failedBitmapUri = "pkg:/images/thumbnail-missing.jpg"
end function
function OnContentSet() as void
@@ -18,25 +13,29 @@ function OnContentSet() as void
return
end if
m.titleLabel.text = content.title
m.authorLabel.text = content.author
m.top.title = content.title
m.top.author = content.author
m.top.thumbnailUri = content.thumbnail
m.thumbnail.uri = content.thumbnail
if ValidInt(content.lengthSeconds) <> 0
SetDurationText(content.lengthText)
m.durationRect.visible = true
m.top.durationRectVisible = true
else
m.durationRect.visible = false
m.top.durationRectVisible = false
end if
end function
function SetDurationText(text as string)
function SetDurationText(text as string) as void
m.top.duration = text
label = m.durationLabel
rect = m.durationRect
rectParent = rect.getParent()
if label = invalid or rect = invalid
return
end if
label.text = text
rectParent = rect.getParent()
size = label.localBoundingRect()
rect.width = size.width + 16
@@ -1,13 +1,19 @@
<component name="PlaylistViewCell" extends="Group">
<interface>
<field id="itemContent" type="node" onChange="OnContentSet" />
<field id="title" type="string" alias="titleLabel.text" />
<field id="author" type="string" alias="authorLabel.text" />
<field id="thumbnailUri" type="uri" alias="thumbnailPoster.uri" />
<field id="duration" type="string" alias="durationLabel.text" />
<field id="durationRectVisible" type="boolean" alias="durationRect.visible" />
</interface>
<children>
<Poster
id="thumbnail"
id="thumbnailPoster"
loadDisplayMode="scaleToZoom"
width="190"
height="106">
height="106"
failedBitmapUri="pkg:/images/thumbnail-missing.jpg">
<Rectangle
id="durationRect"
width="60"
@@ -1,5 +1,3 @@
<?xml version="1.0" encoding="UTF-8"?>
<component name="AppInfoScreen" extends="Group" includes="AutoBind">
<interface>
<field id="applicationInfo" type="node" bind="/ApplicationInfo" />
@@ -0,0 +1,100 @@
import "pkg:/components/ContextMenu/ContextMenuUtils.bs"
import "pkg:/components/Navigation/Navigation.bs"
import "pkg:/source/utils/FocusManagement.bs"
import "pkg:/source/utils/Types.bs"
function Init()
m.noBookmarks = m.top.findNode("noBookmarks")
m.yesBookmarks = m.top.findNode("yesBookmarks")
m.rowList = m.top.FindNode("rowList")
m.rowList.screen = m.top
m.isDirty = true
m.top.ObserveField("visible", FuncName(OnVisibleChange))
end function
function OnNodeReady()
SetNavigation(invalid, "back", m.navBar)
SetNavigation(invalid, "left", m.navBar)
m.rowList@.BindNode(invalid)
OnBookmarksChange()
m.bookmarks.ObserveField("contentChange", FuncName(OnBookmarksChange))
end function
function OnFocusChange() as void
if not m.top.focus
return
end if
if m.yesBookmarks.visible
NodeSetFocus(m.rowList, true)
else
NodeSetFocus(m.navBar, true)
end if
end function
function OnVisibleChange()
if m.top.visible and m.isDirty
OnBookmarksChange()
end if
end function
function Refresh(unused as dynamic)
m.isDirty = true
OnBookmarksChange()
end function
function OnBookmarksChange() as void
if not m.top.visible
m.isDirty = true
return
end if
m.isDirty = false
hasBookmarks = m.bookmarks.content.getChildCount() > 0
m.noBookmarks.visible = not hasBookmarks
m.yesBookmarks.visible = hasBookmarks
m.top.focusable = hasBookmarks
if hasBookmarks
SetRowListContent(m.bookmarks.content)
else
if m.rowList.hasFocus()
NodeSetFocus(m.navBar, true)
end if
end if
end function
function SetRowListContent(bookmarksContent as object)
bookmarkGroupNodes = bookmarksContent.getChildren(-1, 0)
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
function OnkeyEvent(key as string, press as boolean) as boolean
if NavigationKeyHandler(key, press).handled
return true
end if
return false
end function
function GetContextMenuOptionsForItem(rowItem as object) as object
refreshItem = ContextMenuUtils.CreateOption("Refresh Bookmarks", m.top, "Refresh", [invalid])
return [refreshItem]
end function
@@ -0,0 +1,38 @@
<component name="BookmarksScreen" extends="Group" includes="AutoBind,Focus,ContextMenuProvider">
<interface>
<field id="navBar" type="node" bind="/NavBar" />
<field id="applicationInfo" type="node" bind="/ApplicationInfo" />
<field id="bookmarks" type="node" bind="/Bookmarks" />
<function name="Refresh" />
</interface>
<children>
<Group id="noBookmarks" visible="false">
<Label
height="720"
width="1280"
font="font:MediumBoldSystemFont"
horizAlign="center"
vertAlign="center"
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" />
</Group>
<Group id="yesBookmarks" visible="false">
<VideoRowList
itemComponentName="RowCell"
id="rowList"
translation="[0,50]"
numRows="2"
rowitemSize="[[350,196]]"
rowItemSpacing="[[25,0]]"
itemSize="[1280,326]"
itemSpacing="[0,65]"
rowLabelOffset="[[125,20]]"
focusXOffset="[125]"
showRowLabel="[true]"
rowFocusAnimationStyle="floatingfocus"
variableWidthItems="true"
focusBitmapUri="pkg:/images/focus_grid.9.png"
/>
</Group>
</children>
</component>
@@ -1,8 +1,11 @@
import "pkg:/source/utils/FocusManagement.bs"
import "pkg:/components/ContextMenu/ContextMenuUtils.bs"
import "pkg:/components/Navigation/Navigation.bs"
import "pkg:/source/utils/FocusManagement.bs"
function Init()
m.top.focusable = true
m.rowList = m.top.FindNode("rowList")
m.rowList.screen = m.top
m.pendingLoadTasks = {}
end function
@@ -11,7 +14,7 @@ function OnNodeReady()
SetNavigation(invalid, "left", m.navBar)
m.rowList@.BindNode(invalid)
m.rowList.contentData = ParseJson(ReadAsciiFile(m.top.feedFile))
m.rowList.feeds = ParseJson(ReadAsciiFile(m.top.feedFile))
end function
function OnFocusChange() as void
@@ -27,3 +30,8 @@ function OnkeyEvent(key as string, press as boolean) as boolean
end if
return false
end function
function GetContextMenuOptionsForItem(rowItem as object) as object
refresh = ContextMenuUtils.CreateOption("Refresh Home", m.rowList, "Refresh", [invalid])
return [refresh]
end function
@@ -1,10 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<component name="HomeScreen" extends="Group" includes="AutoBind,Focus">
<component name="HomeScreen" extends="Group" includes="AutoBind,Focus,ContextMenuProvider">
<interface>
<field id="navBar" type="node" bind="/NavBar" />
<field id="invidious" type="node" bind="/Invidious" />
<field id="feedFile" type="string" value="libpkg:/config/default_home_layout.json5" />
<field id="feedFile" type="string" value="libpkg:/config/default_home_layout.yaml" />
</interface>
<children>
<VideoRowList
@@ -16,8 +14,8 @@
rowItemSpacing="[[25,0]]"
itemSize="[1280,326]"
itemSpacing="[0,65]"
rowLabelOffset="[[115,20]]"
focusXOffset="[115]"
rowLabelOffset="[[125,20]]"
focusXOffset="[125]"
showRowLabel="[true]"
rowFocusAnimationStyle="floatingfocus"
variableWidthItems="true"
@@ -1,6 +1,6 @@
import "pkg:/components/Navigation/Navigation.bs"
import "pkg:/source/utils/Types.bs"
import "pkg:/source/utils/ArrayUtils.bs"
import "pkg:/source/utils/Types.bs"
function Init()
options = {
@@ -1,5 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<component name="SearchFilters" extends="Group" includes="AutoBind,Focus">
<interface>
<field id="searchScreen" type="node" />
@@ -2,12 +2,13 @@ import "pkg:/components/Navigation/Navigation.bs"
import "pkg:/components/Screens/SearchScreen/SearchSuggestionsTask.bs"
import "pkg:/source/asyncTask/asyncTask.bs"
import "pkg:/source/services/SearchHistory.bs"
import "pkg:/source/utils/LoadingScreen.bs"
import "pkg:/source/utils/FocusManagement.bs"
import "pkg:/source/utils/Logging.bs"
import "pkg:/source/utils/ErrorUtils.bs"
import "pkg:/source/utils/FocusManagement.bs"
import "pkg:/source/utils/LoadingScreen.bs"
import "pkg:/source/utils/Logging.bs"
function Init()
m.top.focusable = true
m.container = m.top.FindNode("container")
m.keyboard = m.top.FindNode("keyboard")
m.rowList = m.top.FindNode("rowList")
@@ -16,6 +17,8 @@ function Init()
m.suggestions = m.top.FindNode("suggestions")
m.filtersButton = m.top.FindNode("filtersButton")
m.rowList.screen = m.top
textEditBox = m.keyboard.textEditBox
textEditBox.voiceEntryType = "generic"
textEditBox.voiceEnabled = true
@@ -200,12 +203,13 @@ function Search(text as string)
m.rowlist.ObserveFieldScoped("someContentReady", FuncName(OnSearchContentReady))
ShowLoadingScreen()
requestData = {
title: `Search - ${text}`,
apiType: "Invidious",
endpoint: "search",
queryParams: {
q: text
feedSource = {
"id": `inv_search_${CryptoUtils.GetMd5(text)}`,
"title": `Search - ${text}`,
"apiType": "Invidious",
"endpoint": "search",
"queryParams": {
"q": text
}
}
@@ -213,18 +217,21 @@ function Search(text as string)
for each filter in filters
value = filters[filter]
if IsString(value) and value.len() > 0
requestData.queryParams[filter] = value
feedSource.queryParams[filter] = value
else if IsArray(value) and value.Count() > 0
' TODO:P1 this is http client implementation details leaking
' We need a declarative way to set array types
requestData.queryParams[filter] = {
feedSource.queryParams[filter] = {
value: value,
__arrayType: HttpClient.QueryParamArrayType.CommaSeparated
}
end if
end for
m.rowList.contentData = [requestData]
m.rowList.feeds = [{
"title": `Search - ${text}`,
"feedSources": [feedSource]
}]
end function
function OnSearchContentReady() as void
@@ -243,7 +250,7 @@ function OnSearchContentReady() as void
end function
function OnSearchError()
m.rowlist.contentData = invalid
m.rowlist.feeds = invalid
m.rowlist.focusable = false
HideLoadingScreen()
end function
@@ -258,7 +265,7 @@ end function
function ClearSearch()
m.keyboard.text = ""
m.rowlist.contentData = invalid
m.rowlist.feeds = invalid
m.rowlist.focusable = false
ScrollUp()
end function
@@ -1,5 +1,3 @@
<?xml version="1.0" encoding="UTF-8"?>
<component name="SearchScreen" extends="Group" includes="AutoBind,Focus">
<interface>
<field id="navBar" type="node" bind="/NavBar" />
@@ -12,7 +10,7 @@
<Button
id="filtersButton"
translation="[160,40]"
minWidth="0"
minWidth="240"
height="48"
showFocusFootprint="true"
iconUri="pkg:/images/icons/filters-white.png"
@@ -42,8 +40,8 @@
rowItemSpacing="[[25,0]]"
itemSize="[1280,326]"
itemSpacing="[0,65]"
rowLabelOffset="[[115,20]]"
focusXOffset="[115]"
rowLabelOffset="[[125,20]]"
focusXOffset="[125]"
showRowLabel="[true]"
rowFocusAnimationStyle="floatingfocus"
variableWidthItems="true"
@@ -1,5 +1,5 @@
import "pkg:/source/services/SearchHistory.bs"
import "pkg:/components/Services/Invidious/InvidiousService.bs"
import "pkg:/source/services/SearchHistory.bs"
@asynctask
function SearchSuggestionsTask(input as object) as object
@@ -1,5 +1,3 @@
<?xml version="1.0" encoding="UTF-8"?>
<component name="BooleanControl" extends="LayoutGroup" includes="Focus">
<interface>
<field id="displayText" type="string" alias="Checkbox.title" />
@@ -1,5 +1,3 @@
<?xml version="1.0" encoding="UTF-8"?>
<component name="Checkbox" extends="CheckList">
<interface>
<field id="title" type="string" alias="checkboxNode.title" />
@@ -1,6 +1,6 @@
import "pkg:/components/Dialog/DialogUtils.bs"
import "pkg:/source/services/SearchHistory.bs"
import "pkg:/source/utils/FocusManagement.bs"
import "pkg:/components/Dialog/DialogUtils.bs"
function Init()
m.top.focusable = true
@@ -1,5 +1,3 @@
<?xml version="1.0" encoding="UTF-8"?>
<component name="ClearSearchHistoryControl" extends="LayoutGroup" includes="Focus">
<interface>
<field id="displayText" type="string" alias="Button.text" />
@@ -9,6 +7,7 @@
<children>
<Button
id="Button"
minWidth="340"
showFocusFootprint="true" />
<Label id="DescriptionLabel"
width="450"
@@ -1,5 +1,5 @@
import "pkg:/source/utils/Types.bs"
import "pkg:/source/utils/FocusManagement.bs"
import "pkg:/source/utils/Types.bs"
function Init()
m.top.focusable = true
@@ -1,5 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<component name="InvidiousInstanceControl" extends="LayoutGroup" includes="AutoBind,Focus">
<interface>
<field id="displayText" type="string" alias="DisplayTextLabel.text" />
@@ -1,4 +1,5 @@
import "pkg:/components/Navigation/Navigation.bs"
import "pkg:/components/Services/Invidious/InvidiousService.bs"
import "pkg:/source/utils/Types.bs"
function Init()
@@ -29,6 +30,7 @@ function Init()
SetNavigation(m.testButton, "right", m.saveButton)
m.currentNavigtionNode = m.editButton
m.textEditBox.hintText = `e.g. ${Invidious.DEFAULT_INSTANCE}`
end function
function OnFocusChange() as void
@@ -76,7 +78,7 @@ end function
function OnEditButtonSelected()
keyboardDialog = createObject("roSGNode", "StandardKeyboardDialog")
keyboardDialog.title = "Edit Instance"
keyboardDialog.message = ["Enter the instance url (e.g. https://vid.puffyan.us)"]
keyboardDialog.message = [`Enter the instance url (e.g. ${Invidious.DEFAULT_INSTANCE})`]
keyboardDialog.text = m.top.text
keyboardDialog.buttons = ["OK", "Cancel"]
keyboardDialog.observeField("buttonSelected", FuncName(OnKeyboardButton))
@@ -1,5 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<component name="InvidiousInstanceSettings" extends="Group" includes="AutoBind,Focus">
<interface>
<field id="text" type="string" alias="textEditBox.text" />
@@ -23,7 +21,6 @@
translation="[326,13]" />
<TextEditBox
id="textEditBox"
hintText="e.g. https://https://vid.puffyan.us"
width="480"
height="50"
translation="[200,50]" />
@@ -1,9 +1,9 @@
import "pkg:/components/Dialog/DialogUtils.bs"
import "pkg:/components/Navigation/Navigation.bs"
import "pkg:/components/Screens/SettingsScreen/InvidiousInstance/InvidiousInstanceTesting/InvidiousInstanceTestingTask.bs"
import "pkg:/source/asyncTask/asyncTask.bs"
import "pkg:/source/utils/FocusManagement.bs"
import "pkg:/source/utils/Types.bs"
import "pkg:/source/asyncTask/asyncTask.bs"
import "pkg:/components/Screens/SettingsScreen/InvidiousInstance/InvidiousInstanceTesting/InvidiousInstanceTestingTask.bs"
import "pkg:/components/Navigation/Navigation.bs"
import "pkg:/components/Dialog/DialogUtils.bs"
function Init()
m.titleLabel = m.top.findNode("titleLabel")
@@ -1,5 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<component name="InvidiousInstanceTesting" extends="Group" includes="AutoBind,Focus">
<interface>
<field id="instance" type="string" />
@@ -37,9 +35,9 @@
<Button
id="closeButton"
text="Close"
minWidth="0"
minWidth="160"
showFocusFootprint="true"
translation="[404,506]" />
translation="[400,506]" />
</Rectangle>
</children>
</component>
@@ -1,5 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<component name="InvidiousInstanceTestingItem" extends="Group">
<interface>
<field id="itemContent" type="node" onChange="OnContentSet" />
@@ -22,6 +22,8 @@ end function
function PrepareTests() as object
content = CreateObject("roSGNode", "ContentNode")
' TODO:P2 test if video data is reachable (head?)
' TODO:P2 test if video data is reachable in proxy mode (local=true)
content.AppendChild(CreateTestNode("Valid url", IsValidUrl))
content.AppendChild(CreateTestNode("Instance reachable", IsReachable))
content.AppendChild(CreateTestNode("Fetch video details", CanFetchVideoDetails))
@@ -51,7 +53,13 @@ function RunTests(instance as string, content as object) as void
for each testNode in testNodes
timer.Mark()
m[testNode.func](instance, testNode)
testNode.duration = timer.TotalMilliseconds()
testNode.title = `${testNode.title} (${testNode.duration}ms)`
if testNode.state = "failed"
LogError(testNode.details)
end if
if m.top.cancel
return
@@ -1,9 +1,9 @@
import "pkg:/source/asyncTask/asyncTask.bs"
import "pkg:/components/Dialog/DialogUtils.bs"
import "pkg:/components/Screens/SettingsScreen/InvidiousInstance/InvidiousPublicInstances/InvidiousPublicInstancesTask.bs"
import "pkg:/source/asyncTask/asyncTask.bs"
import "pkg:/source/utils/ErrorUtils.bs"
import "pkg:/source/utils/FocusManagement.bs"
import "pkg:/source/utils/Logging.bs"
import "pkg:/source/utils/ErrorUtils.bs"
import "pkg:/components/Dialog/DialogUtils.bs"
function Init()
m.failedLabel = m.top.findNode("failedLabel")
@@ -1,5 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<component name="InvidiousPublicInstances" extends="Group" includes="Focus">
<interface>
<field id="instance" type="string" />
@@ -1,5 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<component name="InvidiousPublicInstancesListItem" extends="Group">
<interface>
<field id="itemContent" type="node" onChange="OnContentSet" />
@@ -1,5 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<component name="InvidiousPublicInstancesListItemContent" extends="ContentNode">
<interface>
<field id="name" type="string" />
@@ -1,5 +1,5 @@
import "pkg:/source/services/HttpClient.bs"
import "pkg:/components/Services/Invidious/InvidiousService.bs"
import "pkg:/source/services/HttpClient.bs"
@asynctask
function InvidiousPublicInstancesTask(input as object) as object
@@ -1,5 +1,3 @@
<?xml version="1.0" encoding="UTF-8"?>
<component name="RadioControl" extends="LayoutGroup" includes="Focus">
<interface>
<field id="displayText" type="string" alias="DisplayTextLabel.text" />
@@ -1,5 +1,3 @@
<?xml version="1.0" encoding="UTF-8"?>
<component name="SettingCategory" extends="Button">
<interface>
<field id="padding" type="integer" value="10" onChange="Resize" />
Loaded 100 of 222 files, more files were not shown because too many files have changed in this diff. Show more