Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9df1b70e49 | ||
|
|
bb471a5cde | ||
|
|
b68aad7d4a | ||
|
|
73b6314ec7 | ||
|
|
29969db3e4 | ||
|
|
5335a0273b | ||
|
|
641c9ef5bf | ||
|
|
b0257d97e0 | ||
|
|
5c9c1c204f | ||
|
|
11afc34ecc | ||
|
|
3edfce1366 | ||
|
|
5ff02af7ac | ||
|
|
0cc8cdf2be | ||
|
|
3ecac831bf | ||
|
|
86d5710969 | ||
|
|
575935f5ac | ||
|
|
7eb20dfe2c | ||
|
|
0b01830ad9 | ||
|
|
33fdf796a2 | ||
|
|
fd7bdde733 | ||
|
|
e7324495fe | ||
|
|
2e7b3d0aa5 | ||
|
|
20f345593e | ||
|
|
754da7e836 | ||
|
|
85c3eb8321 | ||
|
|
e59e45e310 | ||
|
|
2548fb9097 | ||
|
|
1cb80f71b5 | ||
|
|
0a7a6c65e2 | ||
|
|
529b915d7f | ||
|
|
a76a2cb77f | ||
|
|
707739b901 | ||
|
|
8c72258879 | ||
|
|
d245c072e9 | ||
|
|
0f000590a0 | ||
|
|
93c1e48d39 | ||
|
|
d6c7d81347 | ||
|
|
331f2ff3cb | ||
|
|
6c42fbe056 | ||
|
|
7e8c828007 | ||
|
|
ba59aad767 | ||
|
|
36ae525154 | ||
|
|
5ef130bc51 | ||
|
|
39591abc34 | ||
|
|
84bd50d970 | ||
|
|
fd0259615b | ||
|
|
e53ad785c6 | ||
|
|
cbda8dbf9b | ||
|
|
242298911c | ||
|
|
8f1d3778d8 | ||
|
|
192401c847 | ||
|
|
132e3ec3e3 | ||
|
|
3570f011c4 | ||
|
|
482daf5e12 | ||
|
|
64f5985aae | ||
|
|
a1aed7d253 | ||
|
|
f581d568d9 | ||
|
|
54b0acbe8f | ||
|
|
6e4262e6a5 | ||
|
|
4c90cf1e98 | ||
|
|
72f547cc22 | ||
|
|
1cee5d61ab | ||
|
|
d87337d389 | ||
|
|
2ba2115da7 | ||
|
|
49be599c32 |
No files matched your search
@@ -64,6 +64,11 @@ jobs:
|
|||||||
latest_release=$(awk 'BEGIN { RS="## \\[" } NR==2 { print "## ["$0 }' CHANGELOG.md)
|
latest_release=$(awk 'BEGIN { RS="## \\[" } NR==2 { print "## ["$0 }' CHANGELOG.md)
|
||||||
echo -e "\n$latest_release" >> docs/canary-changelog.md
|
echo -e "\n$latest_release" >> docs/canary-changelog.md
|
||||||
|
|
||||||
|
# A bug in gh cli causes the release to be created as a draft, and not released.
|
||||||
|
# See https://github.com/cli/cli/issues/8458
|
||||||
|
- name: Wait 10 seconds
|
||||||
|
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-lib.zip --notes-file docs/canary-changelog.md --prerelease --title Canary
|
||||||
env:
|
env:
|
||||||
|
|||||||
@@ -5,6 +5,56 @@ All notable changes to this project will be documented in this file.
|
|||||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
## [0.19.0] - 2024-01-10
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- A home screen editor allowing to enable/disable feeds, and change their order.
|
||||||
|
- The editor can be accessed from the Settings screen.
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- `HTTP/0.9 when not allowed` errors by adding a retry to web requests
|
||||||
|
- Issue where a bookmarked video is no longer valid (such as a video made private, or a live stream that ended)
|
||||||
|
- [Perf] App loads slightly faster (~500ms)
|
||||||
|
|
||||||
|
## [0.18.1] - 2024-01-02
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- A rare bug that causes the app to crash when displaying video cells
|
||||||
|
- A rare bug where a long press can cause a crash
|
||||||
|
- [Attempt] to fix a crash caused by execution timeout when stopping a video takes too long
|
||||||
|
- Unsupported subtitles (subtitles that can't be rendered will not be used)
|
||||||
|
|
||||||
|
### Removed
|
||||||
|
|
||||||
|
- `Funny` and `News` from the Home screen.
|
||||||
|
- These are not standard feeds (like `Trending`), and are just search results for `Funny` and `News`. They were added in earlier Playlet versions to have more content in the Home screen.
|
||||||
|
- If you like to add these two feeds to your bookmarks:
|
||||||
|
- Search for `Funny` (or `News`)
|
||||||
|
- Set the `Sort by` filter to `Upload date`
|
||||||
|
- Press and hold the `Ok` button while a video from the search result is selected
|
||||||
|
- Choose the `Add to "Search - Funny"` option
|
||||||
|
|
||||||
|
## [0.18.0] - 2023-12-28
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- Medium video quality in the settings (For most videos, this is 360p)
|
||||||
|
- Invidious watch history feed
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- (Regression) Issue where auto-play keeps playing the same videos in a loop
|
||||||
|
- Small search box styling bug for Safari
|
||||||
|
- A bug where the skipping of a sponsored section at the end of a video leads to an infinite loop
|
||||||
|
- A couple of bugs when listing Invidious public instances
|
||||||
|
|
||||||
|
### Removed
|
||||||
|
|
||||||
|
- Xmas theme logo - can't publish it before end of year... ([link](https://blog.roku.com/developer/channel-store-blackouts-2023))
|
||||||
|
|
||||||
## [0.17.3] - 2023-12-13
|
## [0.17.3] - 2023-12-13
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|||||||
@@ -3,9 +3,13 @@
|
|||||||
"createPackage": false,
|
"createPackage": false,
|
||||||
"diagnosticFilters": [
|
"diagnosticFilters": [
|
||||||
{
|
{
|
||||||
"src": "**/roku_modules/**/*.*"
|
"src": "**/*.part.xml",
|
||||||
},
|
"codes": [
|
||||||
1090
|
// 1067 - Cannot find function with name '${name}' in component scope
|
||||||
|
// This is to prevent errors where the onChange function is not found in the component scope
|
||||||
|
1067
|
||||||
|
]
|
||||||
|
}
|
||||||
],
|
],
|
||||||
"diagnosticLevel": "error",
|
"diagnosticLevel": "error",
|
||||||
// The validation regex rules are validated using the validation-plugin.ts plugin
|
// The validation regex rules are validated using the validation-plugin.ts plugin
|
||||||
@@ -27,6 +31,15 @@
|
|||||||
"regex": "@\\.\\w+\\(invalid\\)",
|
"regex": "@\\.\\w+\\(invalid\\)",
|
||||||
"regexFlags": "ig",
|
"regexFlags": "ig",
|
||||||
"message": "the arg invalid in @.func(invalid) is not needed. Just use @.func() instead."
|
"message": "the arg invalid in @.func(invalid) is not needed. Just use @.func() instead."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// Tagging unused variables (Available since Roku OS 11.0) – Variables can explicitly
|
||||||
|
// be marked as unused by prepending an underscore to the value (for example, sub myTask(_x)).
|
||||||
|
// https://developer.roku.com/en-ca/docs/references/brightscript/language/expressions-variables-types.md#types
|
||||||
|
"code": "UNUSED_ARG_STARTS_WITH_UNDERSCORE",
|
||||||
|
"regex": "\\b(?!_unused)unused\\b",
|
||||||
|
"regexFlags": "ig",
|
||||||
|
"message": "unused args should start with _ (e.g. _unused)"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"files": [
|
"files": [
|
||||||
@@ -57,11 +70,13 @@
|
|||||||
"../tools/bs-plugins/json-yaml-plugin.ts",
|
"../tools/bs-plugins/json-yaml-plugin.ts",
|
||||||
"../tools/bs-plugins/validation-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"
|
"../tools/bs-plugins/image-gen-plugin.ts",
|
||||||
|
"../tools/bs-plugins/type-gen-plugin.ts"
|
||||||
],
|
],
|
||||||
"retainStagingDir": true,
|
"retainStagingDir": true,
|
||||||
"require": [
|
"require": [
|
||||||
"ts-node/register"
|
"ts-node/register"
|
||||||
],
|
],
|
||||||
"sourceMap": true
|
"sourceMap": true,
|
||||||
|
"pruneEmptyCodeFiles": true
|
||||||
}
|
}
|
||||||
@@ -26,7 +26,8 @@
|
|||||||
"../tools/bs-plugins/json-yaml-plugin.ts",
|
"../tools/bs-plugins/json-yaml-plugin.ts",
|
||||||
"../tools/bs-plugins/validation-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"
|
"../tools/bs-plugins/image-gen-plugin.ts",
|
||||||
|
"../tools/bs-plugins/type-gen-plugin.ts"
|
||||||
],
|
],
|
||||||
"rooibos": {
|
"rooibos": {
|
||||||
"logLevel": 2,
|
"logLevel": 2,
|
||||||
|
|||||||
@@ -5,23 +5,32 @@
|
|||||||
"**/bslib.brs"
|
"**/bslib.brs"
|
||||||
],
|
],
|
||||||
"rules": {
|
"rules": {
|
||||||
"aa-comma-style": "no-dangling",
|
// Code style
|
||||||
"anon-function-style": "no-sub",
|
|
||||||
"assign-all-paths": "warn",
|
|
||||||
"block-if-style": "no-then",
|
|
||||||
"case-sensitivity": "warn",
|
|
||||||
"condition-style": "no-group",
|
|
||||||
"consistent-return": "error",
|
|
||||||
"eol-last": "always",
|
|
||||||
"inline-if-style": "never",
|
"inline-if-style": "never",
|
||||||
|
"block-if-style": "no-then",
|
||||||
|
"condition-style": "no-group",
|
||||||
"named-function-style": "no-sub",
|
"named-function-style": "no-sub",
|
||||||
|
"anon-function-style": "no-sub",
|
||||||
|
"aa-comma-style": "never",
|
||||||
"no-print": "warn",
|
"no-print": "warn",
|
||||||
"no-stop": "error",
|
|
||||||
"no-todo": "off",
|
"no-todo": "off",
|
||||||
|
"no-stop": "error",
|
||||||
|
"eol-last": "always",
|
||||||
|
// Strictness
|
||||||
"type-annotations": "all",
|
"type-annotations": "all",
|
||||||
"unreachable-code": "warn",
|
// Color
|
||||||
|
"color-format": "hash-hex",
|
||||||
|
"color-case": "upper",
|
||||||
|
"color-alpha": "always",
|
||||||
|
"color-alpha-defaults": "allowed",
|
||||||
|
"color-cert": "always",
|
||||||
|
// Code flow
|
||||||
|
"assign-all-paths": "error",
|
||||||
|
"unsafe-path-loop": "error",
|
||||||
"unsafe-iterators": "error",
|
"unsafe-iterators": "error",
|
||||||
"unsafe-path-loop": "warn",
|
"unreachable-code": "warn",
|
||||||
"unused-variable": "warn"
|
"case-sensitivity": "error",
|
||||||
|
"unused-variable": "error",
|
||||||
|
"consistent-return": "error"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -163,7 +163,7 @@ Playlet lib comes equipped with a web server that runs on port 8888 when the app
|
|||||||
- Allows remotely casting videos, change preferences, etc.
|
- Allows remotely casting videos, change preferences, etc.
|
||||||
- Authentication using Invidious
|
- Authentication using Invidious
|
||||||
|
|
||||||
The web server runs on a continiously running [Task](https://developer.roku.com/en-ca/docs/references/scenegraph/control-nodes/task.md) and uses a middeware system to manage routes, serve static files, [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS), and more.
|
The web server runs on a continuously running [Task](https://developer.roku.com/en-ca/docs/references/scenegraph/control-nodes/task.md) and uses a middeware system to manage routes, serve static files, [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS), and more.
|
||||||
|
|
||||||
The server's API enpoints are described through the Open API spec file [playlet-web-api.yml](./playlet-web-api.yml)
|
The server's API enpoints are described through the Open API spec file [playlet-web-api.yml](./playlet-web-api.yml)
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ openapi: 3.0.0
|
|||||||
|
|
||||||
info:
|
info:
|
||||||
title: Playlet Web API
|
title: Playlet Web API
|
||||||
version: 0.17.3
|
version: 0.19.0
|
||||||
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
|
||||||
@@ -153,7 +153,7 @@ paths:
|
|||||||
properties:
|
properties:
|
||||||
index:
|
index:
|
||||||
type: integer
|
type: integer
|
||||||
playlistIndex
|
playlistIndex:
|
||||||
type: integer
|
type: integer
|
||||||
items:
|
items:
|
||||||
type: array
|
type: array
|
||||||
@@ -178,7 +178,7 @@ paths:
|
|||||||
properties:
|
properties:
|
||||||
index:
|
index:
|
||||||
type: integer
|
type: integer
|
||||||
playlistIndex
|
playlistIndex:
|
||||||
type: integer
|
type: integer
|
||||||
items:
|
items:
|
||||||
type: array
|
type: array
|
||||||
@@ -227,6 +227,41 @@ paths:
|
|||||||
description: No Content
|
description: No Content
|
||||||
"400":
|
"400":
|
||||||
description: Bad Request
|
description: Bad Request
|
||||||
|
/api/home-layout:
|
||||||
|
get:
|
||||||
|
summary: Get home layout
|
||||||
|
description: Get the current home layout. This is the layout of the home screen, based on user preferences.
|
||||||
|
operationId: getHomeLayout
|
||||||
|
responses:
|
||||||
|
"200":
|
||||||
|
description: OK
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
id:
|
||||||
|
type: string
|
||||||
|
title:
|
||||||
|
type: string
|
||||||
|
feedSources:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
apiType:
|
||||||
|
type: string
|
||||||
|
endpoint:
|
||||||
|
type: string
|
||||||
|
id:
|
||||||
|
type: string
|
||||||
|
queryParams:
|
||||||
|
type: object
|
||||||
|
additionalProperties: true
|
||||||
|
title:
|
||||||
|
type: string
|
||||||
/api/playlet-lib-urls:
|
/api/playlet-lib-urls:
|
||||||
get:
|
get:
|
||||||
summary: Get Playlet lib URLs
|
summary: Get Playlet lib URLs
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
- [Async Task Generator](#async-task-generator)
|
- [Async Task Generator](#async-task-generator)
|
||||||
- [Tracking transpilied files](#tracking-transpilied-files)
|
- [Tracking transpilied files](#tracking-transpilied-files)
|
||||||
- [Logger](#logger)
|
- [Logger](#logger)
|
||||||
|
- [Type Gen](#type-gen)
|
||||||
|
|
||||||
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:
|
||||||
|
|
||||||
@@ -469,7 +470,10 @@ end function
|
|||||||
And use the function like so
|
And use the function like so
|
||||||
|
|
||||||
```brighterscript
|
```brighterscript
|
||||||
StartAsyncTask(MyBackgroundTask, {myVar: "some input"}, function(output as object) as void
|
import "pkg:/source/AsyncTask/Tasks.bs"
|
||||||
|
import "pkg:/source/AsyncTask/AsyncTask.bs"
|
||||||
|
|
||||||
|
AsyncTask.Start(Tasks.MyBackgroundTask, {myVar: "some input"}, function(output as object) as void
|
||||||
if output.success
|
if output.success
|
||||||
print(output.result.value)
|
print(output.result.value)
|
||||||
end if
|
end if
|
||||||
@@ -478,7 +482,7 @@ end function)
|
|||||||
|
|
||||||
The rest will be taken care of by the plugin, which will generate an `xml` file containing the task component, and a script that handles calling the function.
|
The rest will be taken care of by the plugin, which will generate an `xml` file containing the task component, and a script that handles calling the function.
|
||||||
|
|
||||||
Although very useful, this pattern might not be the best for long running tasks (like the Web Server) or other tasks that require task reuse. This is because `StartAsyncTask` create a new instance of the task every time.
|
Although very useful, this pattern might not be the best for long running tasks (like the Web Server) or other tasks that require task reuse. This is because `AsyncTask.Start` create a new instance of the task every time.
|
||||||
|
|
||||||
## Tracking transpilied files
|
## Tracking transpilied files
|
||||||
|
|
||||||
@@ -517,7 +521,7 @@ The logger plugin searches for calls to the predefined functions `LogError`, `Lo
|
|||||||
- For example, it replaces `LogError("Cannot complete operation:", error)` with `LogError2("Cannot complete operation:", error)`
|
- For example, it replaces `LogError("Cannot complete operation:", error)` with `LogError2("Cannot complete operation:", error)`
|
||||||
- Based on usage, it generates `LogErrorX` functions used. Example:
|
- Based on usage, it generates `LogErrorX` functions used. Example:
|
||||||
|
|
||||||
```
|
```brs
|
||||||
function LogError2(arg0, arg1) as void
|
function LogError2(arg0, arg1) as void
|
||||||
logger = m.global.logger
|
logger = m.global.logger
|
||||||
if logger.logLevel < 0
|
if logger.logLevel < 0
|
||||||
@@ -537,3 +541,33 @@ This is implemented to make it easy to identify where logs came from, and to gen
|
|||||||
To understand more about what's being generated, download `playlet-lib.zip` from [releases](https://github.com/iBicha/playlet/releases), extract, and inspect the file `source/utils/Logging.brs`. You will see it contains log functions in the form `LogVerbX`, that are generated based on usage.
|
To understand more about what's being generated, download `playlet-lib.zip` from [releases](https://github.com/iBicha/playlet/releases), extract, and inspect the file `source/utils/Logging.brs`. You will see it contains log functions in the form `LogVerbX`, that are generated based on usage.
|
||||||
|
|
||||||
To give credit where credit is due, some of the ideas here (like adding the source location to the log) came from [roku-log](https://github.com/georgejecook/roku-log)
|
To give credit where credit is due, some of the ideas here (like adding the source location to the log) came from [roku-log](https://github.com/georgejecook/roku-log)
|
||||||
|
|
||||||
|
## Type Gen
|
||||||
|
|
||||||
|
**[Source](/tools/bs-plugins/type-gen-plugin.ts)**
|
||||||
|
|
||||||
|
### Why
|
||||||
|
|
||||||
|
I found myself implementing type checking functions like `IsBool`, `IsInt`, and `IsString`, and functions for getting a valid type, like `ValidBool`, `ValidInt`, and `ValidString`. The implementation is the same, why not generate them?
|
||||||
|
|
||||||
|
### How
|
||||||
|
|
||||||
|
Simply we declare them in an object describing the type, the interface, and the default value, and generate all corresponding functions.
|
||||||
|
|
||||||
|
Sample output:
|
||||||
|
|
||||||
|
```brs
|
||||||
|
' Returns true if the given object is of type Bool, false otherwise
|
||||||
|
function IsBool(obj as dynamic) as boolean
|
||||||
|
return obj <> invalid and GetInterface(obj, "ifBoolean") <> invalid
|
||||||
|
end function
|
||||||
|
|
||||||
|
' Returns the given object if it is of type Bool, otherwise returns the default value `false`
|
||||||
|
function ValidBool(obj as dynamic) as boolean
|
||||||
|
if obj <> invalid and GetInterface(obj, "ifBoolean") <> invalid
|
||||||
|
return obj
|
||||||
|
else
|
||||||
|
return false
|
||||||
|
end if
|
||||||
|
end function
|
||||||
|
```
|
||||||
@@ -1,30 +1,37 @@
|
|||||||
# Screenshots
|
# Screenshots
|
||||||
|
|
||||||
## Home
|
## Playlet
|
||||||
|
|
||||||

|
| Home | Search |
|
||||||
|
| ------------------- | ----------------------- |
|
||||||
|
|  |  |
|
||||||
|
|
||||||
## Search
|
| Bookmarks | Queue + Picture-in-picture |
|
||||||
|
| ----------------------------- | ----------------------------------------------------- |
|
||||||
|
|  |  |
|
||||||
|
|
||||||

|
| Channel | Playlist |
|
||||||
|
| ------------------------- | --------------------------- |
|
||||||
|
|  |  |
|
||||||
|
|
||||||
## Settings
|
| Settings | Invidious instances | Invidious testing |
|
||||||
|
| --------------------------- | ------------------------------------------------ | --------------------------------------------- |
|
||||||
|
|  |  |  |
|
||||||
|
|
||||||

|
| Link to web app | App info |
|
||||||
|
| ----------------------------------- | --------------------------- |
|
||||||
|
|  |  |
|
||||||
|
|
||||||
## Playlist
|
## Playlet web app
|
||||||
|
|
||||||

|
| Home | Search | Settings |
|
||||||
|
|
||||||
## Link to web app
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
## App info
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
## Web app
|
|
||||||
|
|
||||||
|  |  |  |
|
|
||||||
| ---------------------------------- | -------------------------------------- | ------------------------------------------ |
|
| ---------------------------------- | -------------------------------------- | ------------------------------------------ |
|
||||||
|
|  |  |  |
|
||||||
|
|
||||||
|
| Bookmarks | Remote | Cast video |
|
||||||
|
| ------------------------------------ | ------------------------------ | -------------------------------- |
|
||||||
|
|  |  |  |
|
||||||
|
|
||||||
|
| App info | | |
|
||||||
|
| ------------------------------ | --- | --- |
|
||||||
|
|  | | |
|
||||||
|
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 37 KiB |
|
After Width: | Height: | Size: 78 KiB |
|
After Width: | Height: | Size: 123 KiB |
|
Before Width: | Height: | Size: 83 KiB After Width: | Height: | Size: 124 KiB |
|
After Width: | Height: | Size: 62 KiB |
|
After Width: | Height: | Size: 41 KiB |
|
After Width: | Height: | Size: 106 KiB |
|
Before Width: | Height: | Size: 80 KiB After Width: | Height: | Size: 83 KiB |
|
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 39 KiB |
|
After Width: | Height: | Size: 639 KiB |
|
After Width: | Height: | Size: 982 KiB |
|
Before Width: | Height: | Size: 358 KiB After Width: | Height: | Size: 1.2 MiB |
|
After Width: | Height: | Size: 244 KiB |
|
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 52 KiB |
|
After Width: | Height: | Size: 154 KiB |
|
Before Width: | Height: | Size: 362 KiB After Width: | Height: | Size: 751 KiB |
|
Before Width: | Height: | Size: 99 KiB After Width: | Height: | Size: 256 KiB |
@@ -1,22 +1,22 @@
|
|||||||
{
|
{
|
||||||
"name": "playlet",
|
"name": "playlet",
|
||||||
"version": "0.17.3",
|
"version": "0.19.0",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "playlet",
|
"name": "playlet",
|
||||||
"version": "0.17.3",
|
"version": "0.19.0",
|
||||||
"hasInstallScript": true,
|
"hasInstallScript": true,
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@rokucommunity/bslint": "^0.8.13",
|
"@rokucommunity/bslint": "^0.8.14",
|
||||||
"@types/crypto-js": "^4.2.1",
|
"@types/crypto-js": "^4.2.1",
|
||||||
"@types/fs-extra": "^11.0.4",
|
"@types/fs-extra": "^11.0.4",
|
||||||
"@types/node": "^20.10.4",
|
"@types/node": "^20.10.7",
|
||||||
"@types/xml2js": "^0.4.14",
|
"@types/xml2js": "^0.4.14",
|
||||||
"argparse": "^2.0.1",
|
"argparse": "^2.0.1",
|
||||||
"brighterscript": "0.65.13",
|
"brighterscript": "0.65.16",
|
||||||
"brighterscript-formatter": "^1.6.36",
|
"brighterscript-formatter": "^1.6.37",
|
||||||
"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",
|
||||||
@@ -27,9 +27,9 @@
|
|||||||
"imap": "^0.8.19",
|
"imap": "^0.8.19",
|
||||||
"ip": "^1.1.8",
|
"ip": "^1.1.8",
|
||||||
"json5": "^2.2.3",
|
"json5": "^2.2.3",
|
||||||
"mailparser": "^3.6.5",
|
"mailparser": "^3.6.6",
|
||||||
"roku-deploy": "^3.11.1",
|
"roku-deploy": "^3.11.2",
|
||||||
"rooibos-roku": "^5.8.0",
|
"rooibos-roku": "^5.10.0",
|
||||||
"semver": "^7.5.4",
|
"semver": "^7.5.4",
|
||||||
"shelljs": "^0.8.5",
|
"shelljs": "^0.8.5",
|
||||||
"ts-node": "^10.9.2",
|
"ts-node": "^10.9.2",
|
||||||
@@ -276,9 +276,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/@rokucommunity/bslint": {
|
"node_modules/@rokucommunity/bslint": {
|
||||||
"version": "0.8.13",
|
"version": "0.8.14",
|
||||||
"resolved": "https://registry.npmjs.org/@rokucommunity/bslint/-/bslint-0.8.13.tgz",
|
"resolved": "https://registry.npmjs.org/@rokucommunity/bslint/-/bslint-0.8.14.tgz",
|
||||||
"integrity": "sha512-EC5tQdtRFTJxOo+9lnZz6yLcsyctuchCzUNJX391ZgCN0EKJTjGigyqTsdsFprINmr0pBojUiys/ZpS/Bv3ROQ==",
|
"integrity": "sha512-vKD2weW5I8jOXe+2xHN9FZ9GUCkbE/FOTbWcziLXrObraXJZcNRqk+fWDvi7go79ourQ/9DmYfmFH0bocjOMqg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"fs-extra": "^10.0.0",
|
"fs-extra": "^10.0.0",
|
||||||
@@ -370,9 +370,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@types/node": {
|
"node_modules/@types/node": {
|
||||||
"version": "20.10.4",
|
"version": "20.10.7",
|
||||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.10.4.tgz",
|
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.10.7.tgz",
|
||||||
"integrity": "sha512-D08YG6rr8X90YB56tSIuBaddy/UXAA9RKJoFvrsnogAum/0pmjkgi4+2nx96A330FmioegBWmEYQ+syqCFaveg==",
|
"integrity": "sha512-fRbIKb8C/Y2lXxB5eVMj4IU7xpdox0Lh8bUPEdtLysaylsml1hOOx1+STloRs/B9nf7C6kPRmmg/V7aQW7usNg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"undici-types": "~5.26.4"
|
"undici-types": "~5.26.4"
|
||||||
@@ -728,9 +728,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/brighterscript": {
|
"node_modules/brighterscript": {
|
||||||
"version": "0.65.13",
|
"version": "0.65.16",
|
||||||
"resolved": "https://registry.npmjs.org/brighterscript/-/brighterscript-0.65.13.tgz",
|
"resolved": "https://registry.npmjs.org/brighterscript/-/brighterscript-0.65.16.tgz",
|
||||||
"integrity": "sha512-f2Mvdpl+RRuVGLnwXvydpVjftSJl0n9L0HCBQlLZPQelksGV7n0ahIBcbPavqhXaZj/wB4wOKn2vQwWJI0G+tA==",
|
"integrity": "sha512-2RJMF8itkrPXtZ92JkJf3emvzcCl5ETXGVyPsdO/hMKbUGinEGMRFG07FR0bzjRotbALzsozGE/Hjzw412Sjww==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@rokucommunity/bslib": "^0.1.1",
|
"@rokucommunity/bslib": "^0.1.1",
|
||||||
@@ -756,7 +756,7 @@
|
|||||||
"parse-ms": "^2.1.0",
|
"parse-ms": "^2.1.0",
|
||||||
"readline": "^1.3.0",
|
"readline": "^1.3.0",
|
||||||
"require-relative": "^0.8.7",
|
"require-relative": "^0.8.7",
|
||||||
"roku-deploy": "^3.11.1",
|
"roku-deploy": "^3.11.2",
|
||||||
"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": "7.0.0",
|
||||||
@@ -771,12 +771,12 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/brighterscript-formatter": {
|
"node_modules/brighterscript-formatter": {
|
||||||
"version": "1.6.36",
|
"version": "1.6.37",
|
||||||
"resolved": "https://registry.npmjs.org/brighterscript-formatter/-/brighterscript-formatter-1.6.36.tgz",
|
"resolved": "https://registry.npmjs.org/brighterscript-formatter/-/brighterscript-formatter-1.6.37.tgz",
|
||||||
"integrity": "sha512-f9Y3Re6egB1MCUftph8AT8RxWTtXmeMjwigRv1biNGmEuGeSOipoBnCbwY4U1CFz46L7W39/TL4n1JMV9URD6w==",
|
"integrity": "sha512-jIlqRjPVIp2WwB9Pe0YwK4KU4G3WqhRsqRluuOFY1sTDVW0R/AKXMvCfTsu99L2W7CbpeWA4UjOPzl9JOqN5hw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"brighterscript": "^0.65.12",
|
"brighterscript": "^0.65.16",
|
||||||
"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",
|
||||||
@@ -1997,9 +1997,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/fastq": {
|
"node_modules/fastq": {
|
||||||
"version": "1.15.0",
|
"version": "1.16.0",
|
||||||
"resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz",
|
"resolved": "https://registry.npmjs.org/fastq/-/fastq-1.16.0.tgz",
|
||||||
"integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==",
|
"integrity": "sha512-ifCoaXsDrsdkWTtiNJX5uzHDsrck5TzfKKDcuFFTIrrc/BS076qgEIfoIy1VeZqViznfKiysPYTh/QeHtnIsYA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"reusify": "^1.0.4"
|
"reusify": "^1.0.4"
|
||||||
@@ -2902,12 +2902,12 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/linkify-it": {
|
"node_modules/linkify-it": {
|
||||||
"version": "4.0.1",
|
"version": "5.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-4.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-5.0.0.tgz",
|
||||||
"integrity": "sha512-C7bfi1UZmoj8+PQx22XyeXCuBlokoyWQL5pWSP+EI6nzRylyThouddufc2c1NDIcP9k5agmN9fLpA7VNJfIiqw==",
|
"integrity": "sha512-5aHCbzQRADcdP+ATqnDuhhJ/MRIqDkZX5pyjFHRRysS8vZ5AbqGEoFIb6pYHPZ+L/OC2Lc+xT8uHVVR5CAK/wQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"uc.micro": "^1.0.1"
|
"uc.micro": "^2.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/locate-path": {
|
"node_modules/locate-path": {
|
||||||
@@ -2980,9 +2980,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/mailparser": {
|
"node_modules/mailparser": {
|
||||||
"version": "3.6.5",
|
"version": "3.6.6",
|
||||||
"resolved": "https://registry.npmjs.org/mailparser/-/mailparser-3.6.5.tgz",
|
"resolved": "https://registry.npmjs.org/mailparser/-/mailparser-3.6.6.tgz",
|
||||||
"integrity": "sha512-nteTpF0Khm5JLOnt4sigmzNdUH/6mO7PZ4KEnvxf4mckyXYFFhrtAWZzbq/V5aQMH+049gA7ZjfLdh+QiX2Uqg==",
|
"integrity": "sha512-noCjBl3FToxmqTP2fp7z17hQsiCroWNntfTd8O+UejOAF59xeN5WGZK27ilexXV2e2X/cbUhG3L8sfEKaz0/sw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"encoding-japanese": "2.0.0",
|
"encoding-japanese": "2.0.0",
|
||||||
@@ -2990,10 +2990,10 @@
|
|||||||
"html-to-text": "9.0.5",
|
"html-to-text": "9.0.5",
|
||||||
"iconv-lite": "0.6.3",
|
"iconv-lite": "0.6.3",
|
||||||
"libmime": "5.2.1",
|
"libmime": "5.2.1",
|
||||||
"linkify-it": "4.0.1",
|
"linkify-it": "5.0.0",
|
||||||
"mailsplit": "5.4.0",
|
"mailsplit": "5.4.0",
|
||||||
"nodemailer": "6.9.3",
|
"nodemailer": "6.9.8",
|
||||||
"tlds": "1.240.0"
|
"tlds": "1.248.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/mailparser/node_modules/iconv-lite": {
|
"node_modules/mailparser/node_modules/iconv-lite": {
|
||||||
@@ -3200,9 +3200,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/nodemailer": {
|
"node_modules/nodemailer": {
|
||||||
"version": "6.9.3",
|
"version": "6.9.8",
|
||||||
"resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-6.9.3.tgz",
|
"resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-6.9.8.tgz",
|
||||||
"integrity": "sha512-fy9v3NgTzBngrMFkDsKEj0r02U7jm6XfC3b52eoNV+GCrGj+s8pt5OqhiJdWKuw51zCTdiNR/IUD1z33LIIGpg==",
|
"integrity": "sha512-cfrYUk16e67Ks051i4CntM9kshRYei1/o/Gi8K1d+R34OIs21xdFnW7Pt7EucmVKA0LKtqUGNcjMZ7ehjl49mQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=6.0.0"
|
"node": ">=6.0.0"
|
||||||
@@ -3923,9 +3923,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/roku-deploy": {
|
"node_modules/roku-deploy": {
|
||||||
"version": "3.11.1",
|
"version": "3.11.2",
|
||||||
"resolved": "https://registry.npmjs.org/roku-deploy/-/roku-deploy-3.11.1.tgz",
|
"resolved": "https://registry.npmjs.org/roku-deploy/-/roku-deploy-3.11.2.tgz",
|
||||||
"integrity": "sha512-ri3eJKGyPMexI+pwvBQxpi6I7I3z9670yOidTcVEohpbYhXpnaIHnKdLb2l87kuC+iTtIEsElgmx3fyEdI5Cjg==",
|
"integrity": "sha512-3JDlnbTxv6Xk5GVolQoA3+d34MLZXXwZWMySprHwazZoWLP3LvulYHP92YvFOJAo/aI4IZp/TFA8kR82IrmHKA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"chalk": "^2.4.2",
|
"chalk": "^2.4.2",
|
||||||
@@ -3994,9 +3994,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/rooibos-roku": {
|
"node_modules/rooibos-roku": {
|
||||||
"version": "5.8.0",
|
"version": "5.10.0",
|
||||||
"resolved": "https://registry.npmjs.org/rooibos-roku/-/rooibos-roku-5.8.0.tgz",
|
"resolved": "https://registry.npmjs.org/rooibos-roku/-/rooibos-roku-5.10.0.tgz",
|
||||||
"integrity": "sha512-mPAszwOH1VdxMgSaoXQ/CgpAZ3RQ0A+d3BoxyY8axMsYS5kPO/8dL8fa7iFTGEZYA7803Ur52zlyN8GXqV5nLg==",
|
"integrity": "sha512-Idiv3nWQOEr5V8z8oHcIovjcoBffgqRtTQ5B6K+x/cGAouKxyVJp0fsZ80xQvUul9IwHQ0XIPUYbNWCR3RQ3sA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"source-map": "^0.7.3",
|
"source-map": "^0.7.3",
|
||||||
@@ -4477,9 +4477,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/tlds": {
|
"node_modules/tlds": {
|
||||||
"version": "1.240.0",
|
"version": "1.248.0",
|
||||||
"resolved": "https://registry.npmjs.org/tlds/-/tlds-1.240.0.tgz",
|
"resolved": "https://registry.npmjs.org/tlds/-/tlds-1.248.0.tgz",
|
||||||
"integrity": "sha512-1OYJQenswGZSOdRw7Bql5Qu7uf75b+F3HFBXbqnG/ifHa0fev1XcG+3pJf3pA/KC6RtHQzfKgIf1vkMlMG7mtQ==",
|
"integrity": "sha512-noj0KdpWTBhwsKxMOXk0rN9otg4kTgLm4WohERRHbJ9IY+kSDKr3RmjitaQ3JFzny+DyvBOQKlFZhp0G0qNSfg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"bin": {
|
"bin": {
|
||||||
"tlds": "bin.js"
|
"tlds": "bin.js"
|
||||||
@@ -4612,9 +4612,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/uc.micro": {
|
"node_modules/uc.micro": {
|
||||||
"version": "1.0.6",
|
"version": "2.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.6.tgz",
|
"resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-2.0.0.tgz",
|
||||||
"integrity": "sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==",
|
"integrity": "sha512-DffL94LsNOccVn4hyfRe5rdKa273swqeA5DJpMOeFmEn1wCDc7nAbbB0gXlgBCL7TNzeTv6G7XVWzan7iJtfig==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/unbzip2-stream": {
|
"node_modules/unbzip2-stream": {
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
{
|
{
|
||||||
"name": "playlet",
|
"name": "playlet",
|
||||||
"version": "0.17.3",
|
"version": "0.19.0",
|
||||||
"description": "Unofficial Youtube client for Roku",
|
"description": "Unofficial Youtube client for Roku",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@rokucommunity/bslint": "^0.8.13",
|
"@rokucommunity/bslint": "^0.8.14",
|
||||||
"@types/crypto-js": "^4.2.1",
|
"@types/crypto-js": "^4.2.1",
|
||||||
"@types/fs-extra": "^11.0.4",
|
"@types/fs-extra": "^11.0.4",
|
||||||
"@types/node": "^20.10.4",
|
"@types/node": "^20.10.7",
|
||||||
"@types/xml2js": "^0.4.14",
|
"@types/xml2js": "^0.4.14",
|
||||||
"argparse": "^2.0.1",
|
"argparse": "^2.0.1",
|
||||||
"brighterscript": "0.65.13",
|
"brighterscript": "0.65.16",
|
||||||
"brighterscript-formatter": "^1.6.36",
|
"brighterscript-formatter": "^1.6.37",
|
||||||
"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",
|
||||||
@@ -21,9 +21,9 @@
|
|||||||
"imap": "^0.8.19",
|
"imap": "^0.8.19",
|
||||||
"ip": "^1.1.8",
|
"ip": "^1.1.8",
|
||||||
"json5": "^2.2.3",
|
"json5": "^2.2.3",
|
||||||
"mailparser": "^3.6.5",
|
"mailparser": "^3.6.6",
|
||||||
"roku-deploy": "^3.11.1",
|
"roku-deploy": "^3.11.2",
|
||||||
"rooibos-roku": "^5.8.0",
|
"rooibos-roku": "^5.10.0",
|
||||||
"semver": "^7.5.4",
|
"semver": "^7.5.4",
|
||||||
"shelljs": "^0.8.5",
|
"shelljs": "^0.8.5",
|
||||||
"ts-node": "^10.9.2",
|
"ts-node": "^10.9.2",
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "playlet-app",
|
"name": "playlet-app",
|
||||||
"version": "0.17.3",
|
"version": "0.19.0",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "playlet-app",
|
"name": "playlet-app",
|
||||||
"version": "0.17.3"
|
"version": "0.19.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "playlet-app",
|
"name": "playlet-app",
|
||||||
"version": "0.17.3",
|
"version": "0.19.0",
|
||||||
"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",
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
import "LoadingMessages.bs"
|
import "LoadingMessages.bs"
|
||||||
|
import "pkg:/source/Logger.bs"
|
||||||
|
|
||||||
function Init() as void
|
function Init() as void
|
||||||
m.scene = m.top.getScene()
|
m.scene = m.top.getScene()
|
||||||
m.top.backgroundColor = "0x242424FF"
|
m.top.backgroundColor = "#242424FF"
|
||||||
m.top.backgroundURI = ""
|
m.top.backgroundURI = ""
|
||||||
|
|
||||||
m.loadingIndicator = m.top.findNode("LoadingIndicator")
|
m.loadingIndicator = m.top.findNode("LoadingIndicator")
|
||||||
@@ -21,17 +22,17 @@ end function
|
|||||||
|
|
||||||
function GetPlayletLibUrls() as object
|
function GetPlayletLibUrls() as object
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
debug = { type: "debug", link: ReadManifestValue("playlet_lib_debug_url") }
|
debug = { type: "debug", link: Manifest.ReadValue("playlet_lib_debug_url") }
|
||||||
return [debug]
|
return [debug]
|
||||||
#else
|
#else
|
||||||
savedUrls = GetPlayletLibUrlsFromRegistry()
|
savedUrls = Registry.GetPlayletLibUrlsFromRegistry()
|
||||||
if savedUrls <> invalid
|
if savedUrls <> invalid
|
||||||
m.shouldClearRegistryOnLoadFail = true
|
m.shouldClearRegistryOnLoadFail = true
|
||||||
return savedUrls
|
return savedUrls
|
||||||
end if
|
end if
|
||||||
|
|
||||||
github = { type: "github", link: ReadManifestValue("playlet_lib_remote_url") }
|
github = { type: "github", link: Manifest.ReadValue("playlet_lib_remote_url") }
|
||||||
embedded = { type: "embedded", link: ReadManifestValue("playlet_lib_embedded_url") }
|
embedded = { type: "embedded", link: Manifest.ReadValue("playlet_lib_embedded_url") }
|
||||||
return [github, embedded]
|
return [github, embedded]
|
||||||
#end if
|
#end if
|
||||||
end function
|
end function
|
||||||
@@ -40,7 +41,7 @@ function LoadPlayletLib() as void
|
|||||||
if m.playletLibUrlIndex >= m.playletLibUrls.Count()
|
if m.playletLibUrlIndex >= m.playletLibUrls.Count()
|
||||||
m.loadingIndicator.visible = false
|
m.loadingIndicator.visible = false
|
||||||
if m.shouldClearRegistryOnLoadFail = true
|
if m.shouldClearRegistryOnLoadFail = true
|
||||||
DeleteRegistryKey("playlet_lib_urls", "Playlet")
|
Registry.DeleteKey("playlet_lib_urls", "Playlet")
|
||||||
end if
|
end if
|
||||||
ShowPlayletLibLoadErrorDialog()
|
ShowPlayletLibLoadErrorDialog()
|
||||||
return
|
return
|
||||||
@@ -55,8 +56,8 @@ function OnLoadStatusChanged() as void
|
|||||||
libUrl = m.playletLibUrls[m.playletLibUrlIndex]
|
libUrl = m.playletLibUrls[m.playletLibUrlIndex]
|
||||||
if m.lib.loadStatus = "ready"
|
if m.lib.loadStatus = "ready"
|
||||||
RemoveComponentLibrary()
|
RemoveComponentLibrary()
|
||||||
' bs:disable-next-line LINT3012
|
Logger.Log(`Playlet lib loaded from ${libUrl.link} in ${m.timer.TotalMilliseconds()} ms`)
|
||||||
?"Playlet lib loaded from " libUrl.link
|
m.timer = invalid
|
||||||
m.scene.playletLibLoadedUrl = libUrl
|
m.scene.playletLibLoadedUrl = libUrl
|
||||||
container = m.scene.findNode("MainSceneContainer")
|
container = m.scene.findNode("MainSceneContainer")
|
||||||
container.createChild("PlayletLib:MainScene")
|
container.createChild("PlayletLib:MainScene")
|
||||||
@@ -64,8 +65,7 @@ function OnLoadStatusChanged() as void
|
|||||||
end if
|
end if
|
||||||
|
|
||||||
if m.lib.loadStatus = "failed"
|
if m.lib.loadStatus = "failed"
|
||||||
' bs:disable-next-line LINT3012
|
Logger.Log(`Playlet lib failed to load from ${libUrl.link}`)
|
||||||
?"Playlet lib failed to load from " libUrl.link
|
|
||||||
' Try next url
|
' Try next url
|
||||||
m.playletLibUrlIndex += 1
|
m.playletLibUrlIndex += 1
|
||||||
LoadPlayletLib()
|
LoadPlayletLib()
|
||||||
@@ -83,11 +83,14 @@ function RemoveComponentLibrary() as void
|
|||||||
end function
|
end function
|
||||||
|
|
||||||
function LoadComponentLibrary(uri as string)
|
function LoadComponentLibrary(uri as string)
|
||||||
|
m.timer = CreateObject("roTimespan")
|
||||||
|
m.timer.mark()
|
||||||
|
|
||||||
m.lib = m.scene.createChild("ComponentLibrary")
|
m.lib = m.scene.createChild("ComponentLibrary")
|
||||||
' bs:disable-next-line NO_OBSERVE_STRING_CALLBACK
|
' bs:disable-next-line NO_OBSERVE_STRING_CALLBACK
|
||||||
m.lib.observeField("loadStatus", "OnLoadStatusChanged")
|
m.lib.observeField("loadStatus", "OnLoadStatusChanged")
|
||||||
' bs:disable-next-line LINT3012
|
|
||||||
?"Loading Playlet lib from " uri
|
Logger.Log(`Loading Playlet lib from ${uri}`)
|
||||||
m.lib.uri = uri
|
m.lib.uri = uri
|
||||||
end function
|
end function
|
||||||
|
|
||||||
@@ -106,5 +109,5 @@ function ShowPlayletLibLoadErrorDialog()
|
|||||||
"If the problem persist, contact Playlet authors."
|
"If the problem persist, contact Playlet authors."
|
||||||
]
|
]
|
||||||
|
|
||||||
ShowErrorDialog(message, bulletText, bottomText)
|
Dialog.ShowError(message, bulletText, bottomText)
|
||||||
end function
|
end function
|
||||||
|
Before Width: | Height: | Size: 9.5 KiB After Width: | Height: | Size: 9.9 KiB |
|
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 5.1 KiB |
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 89 KiB After Width: | Height: | Size: 36 KiB |
|
Before Width: | Height: | Size: 67 KiB After Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 11 KiB |
@@ -1,5 +1,26 @@
|
|||||||
{
|
{
|
||||||
inputHash: "0536f51fa72c2e4e368ea0e901aadfc1",
|
inputHash: '0536f51fa72c2e4e368ea0e901aadfc1',
|
||||||
// Temporarily removed outputs for chrismas theme
|
outputs: [
|
||||||
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',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
}
|
||||||
@@ -3,24 +3,24 @@
|
|||||||
outputs: [
|
outputs: [
|
||||||
{
|
{
|
||||||
outputFilePath: 'images/channel-poster_fhd.png',
|
outputFilePath: 'images/channel-poster_fhd.png',
|
||||||
outputHash: 'd644a0db84deed0bcc41a41d08a4ef75',
|
outputHash: '50729b5bdd2a7c0fd4a1d502812117d4',
|
||||||
width: 540,
|
width: 540,
|
||||||
height: 405,
|
height: 405,
|
||||||
background: '#FFFFFF',
|
background: '#EEEEEE',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
outputFilePath: 'images/channel-poster_hd.png',
|
outputFilePath: 'images/channel-poster_hd.png',
|
||||||
outputHash: 'd07a4ffaa021b55528bee91710f4e9d2',
|
outputHash: '8022dc6fa993ce3194c5aea37d6ea49a',
|
||||||
width: 290,
|
width: 290,
|
||||||
height: 218,
|
height: 218,
|
||||||
background: '#FFFFFF',
|
background: '#EEEEEE',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
outputFilePath: 'images/channel-poster_sd.png',
|
outputFilePath: 'images/channel-poster_sd.png',
|
||||||
outputHash: '66a311c639f89ff009e4624468282b2f',
|
outputHash: '63b8f12ac155c29b4e85db17a2886817',
|
||||||
width: 246,
|
width: 246,
|
||||||
height: 140,
|
height: 140,
|
||||||
background: '#FFFFFF',
|
background: '#EEEEEE',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
@@ -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=17
|
minor_version=19
|
||||||
build_version=00003
|
build_version=00000
|
||||||
|
|
||||||
ui_resolutions=hd
|
ui_resolutions=hd
|
||||||
|
|
||||||
|
|||||||
@@ -1,26 +1,45 @@
|
|||||||
function ShowErrorDialog(message as object, bulletText as object, bottomMessage as object)
|
namespace Dialog
|
||||||
' Note: dialog can be null since StandardMessageDialog is only available on 10.0 and later
|
|
||||||
dialog = CreateObject("roSGNode", "StandardMessageDialog")
|
|
||||||
dialog.message = message
|
|
||||||
dialog.bulletText = bulletText
|
|
||||||
dialog.bottomMessage = bottomMessage
|
|
||||||
dialog.title = "Error loading Playlet"
|
|
||||||
dialog.buttons = ["Exit"]
|
|
||||||
|
|
||||||
' bs:disable-next-line NO_OBSERVE_STRING_CALLBACK
|
function ShowError(message as object, bulletText as object, bottomMessage as object)
|
||||||
dialog.observeField("buttonSelected", "OnButtonSelected")
|
' Note: dialog can be null since StandardMessageDialog is only available on 10.0 and later
|
||||||
' bs:disable-next-line NO_OBSERVE_STRING_CALLBACK
|
msgDialog = CreateObject("roSGNode", "StandardMessageDialog")
|
||||||
dialog.observeField("wasClosed", "OnDialogClosed")
|
SetPalette(msgDialog)
|
||||||
|
msgDialog.message = message
|
||||||
|
msgDialog.bulletText = bulletText
|
||||||
|
msgDialog.bottomMessage = bottomMessage
|
||||||
|
msgDialog.title = "Error loading Playlet"
|
||||||
|
msgDialog.buttons = ["Exit"]
|
||||||
|
|
||||||
m.top.getScene().dialog = dialog
|
' bs:disable-next-line NO_OBSERVE_STRING_CALLBACK
|
||||||
end function
|
msgDialog.observeField("buttonSelected", "OnButtonSelected")
|
||||||
|
' bs:disable-next-line NO_OBSERVE_STRING_CALLBACK
|
||||||
|
msgDialog.observeField("wasClosed", "OnDialogClosed")
|
||||||
|
|
||||||
function OnButtonSelected()
|
m.top.getScene().dialog = msgDialog
|
||||||
m.top.getScene().dialog.close = true
|
end function
|
||||||
end function
|
|
||||||
|
function SetPalette(msgDialog as object)
|
||||||
|
palette = createObject("roSGNode", "RSGPalette")
|
||||||
|
palette.colors = {
|
||||||
|
DialogBackgroundColor: "#242424FF"
|
||||||
|
DialogFocusColor: "#CECECEFF"
|
||||||
|
DialogFocusItemColor: "#202020FF"
|
||||||
|
DialogSecondaryTextColor: "#DBDBDBFF"
|
||||||
|
DialogSecondaryItemColor: "#FF1C30FF"
|
||||||
|
DialogTextColor: "#DBDBDBFF"
|
||||||
|
}
|
||||||
|
msgDialog.palette = palette
|
||||||
|
end function
|
||||||
|
|
||||||
|
function OnButtonSelected()
|
||||||
|
m.top.getScene().dialog.close = true
|
||||||
|
end function
|
||||||
|
|
||||||
|
function OnDialogClosed()
|
||||||
|
' TODO:P1 throw an exception to cause a crash report to be generated
|
||||||
|
' Should include which playlet lib failed to load
|
||||||
|
m.top.getScene().exitChannel = true
|
||||||
|
end function
|
||||||
|
|
||||||
|
end namespace
|
||||||
|
|
||||||
function OnDialogClosed()
|
|
||||||
' TODO:P1 throw an exception to cause a crash report to be generated
|
|
||||||
' Should include which playlet lib failed to load
|
|
||||||
m.top.getScene().exitChannel = true
|
|
||||||
end function
|
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
namespace Logger
|
||||||
|
|
||||||
|
' Put the file at the root directry to avoid needing to create a folder
|
||||||
|
const LOGS_FILE_PATH = "cachefs:/playlet_startup_logs.txt"
|
||||||
|
|
||||||
|
function Init()
|
||||||
|
DeleteFile(LOGS_FILE_PATH)
|
||||||
|
end function
|
||||||
|
|
||||||
|
function Log(msg as string)
|
||||||
|
msg = "[APP] " + msg
|
||||||
|
' bs:disable-next-line LINT3012
|
||||||
|
print(msg)
|
||||||
|
|
||||||
|
buffer = CreateObject("roByteArray")
|
||||||
|
buffer.FromAsciiString(msg + `\n`)
|
||||||
|
buffer.AppendFile(LOGS_FILE_PATH)
|
||||||
|
end function
|
||||||
|
|
||||||
|
end namespace
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
' Playlet (App to play videos from an Invidious server on Roku TVs)
|
' Playlet (App to play videos from an Invidious server on Roku TVs)
|
||||||
' Copyright (C) 2023 Brahim Hadriche
|
' Copyright (C) 2024 Brahim Hadriche
|
||||||
|
|
||||||
' This program is free software: you can redistribute it and/or modify
|
' This program is free software: you can redistribute it and/or modify
|
||||||
' it under the terms of the GNU Affero General Public License as published by
|
' it under the terms of the GNU Affero General Public License as published by
|
||||||
@@ -19,8 +19,9 @@ function Main(args as object) as void
|
|||||||
port = CreateObject("roMessagePort")
|
port = CreateObject("roMessagePort")
|
||||||
screen.setMessagePort(port)
|
screen.setMessagePort(port)
|
||||||
m.global = screen.getGlobalNode()
|
m.global = screen.getGlobalNode()
|
||||||
|
Logger.Init()
|
||||||
|
|
||||||
ClearPlayletLibUrlsIfNeeded(args)
|
Registry.ClearPlayletLibUrlsIfNeeded(args)
|
||||||
|
|
||||||
scene = screen.CreateScene("BootstrapScene")
|
scene = screen.CreateScene("BootstrapScene")
|
||||||
screen.show()
|
screen.show()
|
||||||
@@ -77,7 +78,7 @@ function Main(args as object) as void
|
|||||||
field = msg.getField()
|
field = msg.getField()
|
||||||
data = msg.getData()
|
data = msg.getData()
|
||||||
if field = "exitChannel" and data = true
|
if field = "exitChannel" and data = true
|
||||||
END
|
return
|
||||||
end if
|
end if
|
||||||
else if msgType = "roInputEvent"
|
else if msgType = "roInputEvent"
|
||||||
scene.inputArgs = msg.getInfo()
|
scene.inputArgs = msg.getInfo()
|
||||||
|
|||||||
@@ -1,4 +1,9 @@
|
|||||||
function ReadManifestValue(key as string) as string
|
namespace Manifest
|
||||||
appInfo = CreateObject("roAppInfo")
|
|
||||||
return appInfo.GetValue(key)
|
function ReadValue(key as string) as string
|
||||||
end function
|
appInfo = CreateObject("roAppInfo")
|
||||||
|
return appInfo.GetValue(key)
|
||||||
|
end function
|
||||||
|
|
||||||
|
end namespace
|
||||||
|
|
||||||
@@ -11,7 +11,7 @@ namespace Tests
|
|||||||
@params("playlet_lib_remote_url", "https://github.com/iBicha/playlet/releases/latest/download/playlet-lib.zip")
|
@params("playlet_lib_remote_url", "https://github.com/iBicha/playlet/releases/latest/download/playlet-lib.zip")
|
||||||
@params("playlet_lib_embedded_url", "pkg:/lib/playlet-lib.zip")
|
@params("playlet_lib_embedded_url", "pkg:/lib/playlet-lib.zip")
|
||||||
function _(key as string, expectedValue as string)
|
function _(key as string, expectedValue as string)
|
||||||
m.assertEqual(ReadManifestValue(key), expectedValue)
|
m.assertEqual(Manifest.ReadValue(key), expectedValue)
|
||||||
end function
|
end function
|
||||||
|
|
||||||
end class
|
end class
|
||||||
|
|||||||
@@ -1,29 +1,34 @@
|
|||||||
function ReadRegistryKey(key as string, section as string) as dynamic
|
namespace Registry
|
||||||
sec = CreateObject("roRegistrySection", section)
|
|
||||||
if not sec.Exists(key)
|
|
||||||
return invalid
|
|
||||||
end if
|
|
||||||
return sec.Read(key)
|
|
||||||
end function
|
|
||||||
|
|
||||||
function DeleteRegistryKey(key as string, section as string)
|
function ReadKey(key as string, section as string) as dynamic
|
||||||
sec = CreateObject("roRegistrySection", section)
|
sec = CreateObject("roRegistrySection", section)
|
||||||
sec.Delete(key)
|
if not sec.Exists(key)
|
||||||
sec.Flush()
|
return invalid
|
||||||
end function
|
end if
|
||||||
|
return sec.Read(key)
|
||||||
|
end function
|
||||||
|
|
||||||
function GetPlayletLibUrlsFromRegistry() as object
|
function DeleteKey(key as string, section as string)
|
||||||
urlsJson = ReadRegistryKey("playlet_lib_urls", "Playlet")
|
sec = CreateObject("roRegistrySection", section)
|
||||||
if urlsJson = invalid
|
sec.Delete(key)
|
||||||
return invalid
|
sec.Flush()
|
||||||
end if
|
end function
|
||||||
urls = ParseJson(urlsJson)
|
|
||||||
return urls
|
|
||||||
end function
|
|
||||||
|
|
||||||
function ClearPlayletLibUrlsIfNeeded(launchArgs as object) as void
|
function GetPlayletLibUrlsFromRegistry() as object
|
||||||
if launchArgs = invalid or launchArgs.clearPlayletLibUrls = invalid
|
urlsJson = ReadKey("playlet_lib_urls", "Playlet")
|
||||||
return
|
if urlsJson = invalid
|
||||||
end if
|
return invalid
|
||||||
DeleteRegistryKey("playlet_lib_urls", "Playlet")
|
end if
|
||||||
end function
|
urls = ParseJson(urlsJson)
|
||||||
|
return urls
|
||||||
|
end function
|
||||||
|
|
||||||
|
function ClearPlayletLibUrlsIfNeeded(launchArgs as object) as void
|
||||||
|
if launchArgs = invalid or launchArgs.clearPlayletLibUrls = invalid
|
||||||
|
return
|
||||||
|
end if
|
||||||
|
DeleteKey("playlet_lib_urls", "Playlet")
|
||||||
|
Logger.Log("Cleared key playlet_lib_urls from registry")
|
||||||
|
end function
|
||||||
|
|
||||||
|
end namespace
|
||||||
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "playlet-lib",
|
"name": "playlet-lib",
|
||||||
"version": "0.17.3",
|
"version": "0.19.0",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "playlet-lib",
|
"name": "playlet-lib",
|
||||||
"version": "0.17.3"
|
"version": "0.19.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "playlet-lib",
|
"name": "playlet-lib",
|
||||||
"version": "0.17.3",
|
"version": "0.19.0",
|
||||||
"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",
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ function PushScreen(node as object)
|
|||||||
FocusTopScreen(invalid)
|
FocusTopScreen(invalid)
|
||||||
end function
|
end function
|
||||||
|
|
||||||
function PopScreen(unused as dynamic)
|
function PopScreen(_unused as dynamic)
|
||||||
childCount = m.stack.getChildCount()
|
childCount = m.stack.getChildCount()
|
||||||
if childCount > 1
|
if childCount > 1
|
||||||
m.stack.removeChildIndex(childCount - 1)
|
m.stack.removeChildIndex(childCount - 1)
|
||||||
@@ -29,7 +29,7 @@ function PopScreen(unused as dynamic)
|
|||||||
end if
|
end if
|
||||||
end function
|
end function
|
||||||
|
|
||||||
function FocusTopScreen(unused as dynamic)
|
function FocusTopScreen(_unused as dynamic)
|
||||||
childCount = m.stack.getChildCount()
|
childCount = m.stack.getChildCount()
|
||||||
topScreen = m.stack.getChild(childCount - 1)
|
topScreen = m.stack.getChild(childCount - 1)
|
||||||
NodeSetFocus(topScreen, true)
|
NodeSetFocus(topScreen, true)
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
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/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/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"
|
||||||
import "SubscribeTask.bs"
|
|
||||||
|
|
||||||
function Init()
|
function Init()
|
||||||
m.container = m.top.findNode("container")
|
m.container = m.top.findNode("container")
|
||||||
@@ -134,9 +134,9 @@ function OnSubscribeButtonSelected()
|
|||||||
end if
|
end if
|
||||||
|
|
||||||
isSubbed = IsSubscribed()
|
isSubbed = IsSubscribed()
|
||||||
m.subscribeTask = StartAsyncTask(SubscribeTask, {
|
m.subscribeTask = AsyncTask.Start(Tasks.SubscribeTask, {
|
||||||
invidious: m.invidious,
|
invidious: m.invidious
|
||||||
ucid: m.authorId,
|
ucid: m.authorId
|
||||||
subscribe: not isSubbed
|
subscribe: not isSubbed
|
||||||
})
|
})
|
||||||
end function
|
end function
|
||||||
@@ -172,33 +172,30 @@ 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("Latest 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
|
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,
|
|
||||||
channels: function(authorId as string, author as string) as object
|
|
||||||
return CreateChannelFeed("Channels", "channel_channels", authorId, author)
|
|
||||||
end function
|
end function
|
||||||
}
|
}
|
||||||
end function
|
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
|
||||||
return {
|
return {
|
||||||
title: title,
|
title: title
|
||||||
feedSources: [{
|
feedSources: [{
|
||||||
"id": `inv_${endpoint}_${ucid}`,
|
"id": `inv_${endpoint}_${ucid}`
|
||||||
"title": `${author} - ${title}`,
|
"title": `${author} - ${title}`
|
||||||
"apiType": "Invidious",
|
"apiType": "Invidious"
|
||||||
"endpoint": endpoint,
|
"endpoint": endpoint
|
||||||
"pathParams": {
|
"pathParams": {
|
||||||
"ucid": ucid
|
"ucid": ucid
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ function SubscribeTask(input as object) as object
|
|||||||
error = response.ErrorMessage()
|
error = response.ErrorMessage()
|
||||||
LogError("Failed to subscribe/unsubscribe to channel:", error)
|
LogError("Failed to subscribe/unsubscribe to channel:", error)
|
||||||
return {
|
return {
|
||||||
success: false,
|
success: false
|
||||||
error: error
|
error: error
|
||||||
}
|
}
|
||||||
end if
|
end if
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
import "pkg:/components/ContentNode/ChannelContentTask.bs"
|
|
||||||
import "pkg:/components/Dialog/DialogUtils.bs"
|
import "pkg:/components/Dialog/DialogUtils.bs"
|
||||||
import "pkg:/source/asyncTask/asyncTask.bs"
|
import "pkg:/components/VideoFeed/FeedLoadState.bs"
|
||||||
|
import "pkg:/source/AsyncTask/AsyncTask.bs"
|
||||||
|
import "pkg:/source/AsyncTask/Tasks.bs"
|
||||||
import "pkg:/source/utils/ErrorUtils.bs"
|
import "pkg:/source/utils/ErrorUtils.bs"
|
||||||
|
import "pkg:/source/utils/Logging.bs"
|
||||||
|
|
||||||
function Init()
|
function Init()
|
||||||
end function
|
end function
|
||||||
@@ -17,8 +19,8 @@ function LoadChannel(invidiousNode as object) as void
|
|||||||
end if
|
end if
|
||||||
|
|
||||||
m.top.loadState = FeedLoadState.Loading
|
m.top.loadState = FeedLoadState.Loading
|
||||||
m.contentTask = StartAsyncTask(ChannelContentTask, {
|
m.contentTask = AsyncTask.Start(Tasks.ChannelContentTask, {
|
||||||
content: m.top,
|
content: m.top
|
||||||
invidious: invidiousNode
|
invidious: invidiousNode
|
||||||
}, OnChannelContentTaskResult)
|
}, OnChannelContentTaskResult)
|
||||||
end function
|
end function
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ function ChannelContentTask(input as object) as object
|
|||||||
if not response.IsSuccess() or metadata = invalid
|
if not response.IsSuccess() or metadata = invalid
|
||||||
contentNode.loadState = FeedLoadState.Error
|
contentNode.loadState = FeedLoadState.Error
|
||||||
return {
|
return {
|
||||||
success: false,
|
success: false
|
||||||
error: response.ErrorMessage()
|
error: response.ErrorMessage()
|
||||||
}
|
}
|
||||||
end if
|
end if
|
||||||
|
|||||||
@@ -11,19 +11,19 @@ function OnItemHasFocus()
|
|||||||
hasFocus = m.top.itemHasFocus
|
hasFocus = m.top.itemHasFocus
|
||||||
if hasFocus
|
if hasFocus
|
||||||
m.top.font = "font:SmallestBoldSystemFont"
|
m.top.font = "font:SmallestBoldSystemFont"
|
||||||
m.top.color = "0x262626ff"
|
m.top.color = "#262626ff"
|
||||||
else
|
else
|
||||||
m.top.font = "font:SmallestSystemFont"
|
m.top.font = "font:SmallestSystemFont"
|
||||||
m.top.color = "0xddddddff"
|
m.top.color = "#DBDBDBFF"
|
||||||
end if
|
end if
|
||||||
end function
|
end function
|
||||||
|
|
||||||
function OnFocusPercent()
|
function OnFocusPercent()
|
||||||
if m.top.focusPercent > 0.5
|
if m.top.focusPercent > 0.5
|
||||||
m.top.font = "font:SmallestBoldSystemFont"
|
m.top.font = "font:SmallestBoldSystemFont"
|
||||||
m.top.color = "0x262626ff"
|
m.top.color = "#262626FF"
|
||||||
else
|
else
|
||||||
m.top.font = "font:SmallestSystemFont"
|
m.top.font = "font:SmallestSystemFont"
|
||||||
m.top.color = "0xddddddff"
|
m.top.color = "#DBDBDBFF"
|
||||||
end if
|
end if
|
||||||
end function
|
end function
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
function SetPalette(dialog as object)
|
||||||
|
palette = createObject("roSGNode", "RSGPalette")
|
||||||
|
palette.colors = {
|
||||||
|
DialogBackgroundColor: "#242424FF"
|
||||||
|
DialogFocusColor: "#CECECEFF"
|
||||||
|
DialogFocusItemColor: "#202020FF"
|
||||||
|
DialogSecondaryTextColor: "#DBDBDBFF"
|
||||||
|
DialogSecondaryItemColor: "#FF1C30FF"
|
||||||
|
DialogTextColor: "#DBDBDBFF"
|
||||||
|
}
|
||||||
|
dialog.palette = palette
|
||||||
|
end function
|
||||||
@@ -1,9 +1,11 @@
|
|||||||
import "pkg:/components/Screens/WebAppScreen/GenerateQrCodeTask.bs"
|
import "DialogPalette.bs"
|
||||||
import "pkg:/source/asyncTask/asyncTask.bs"
|
import "pkg:/source/AsyncTask/AsyncTask.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"
|
||||||
|
|
||||||
function Init()
|
function Init()
|
||||||
|
SetPalette(m.top)
|
||||||
m.urlLabel = m.top.findNode("urlLabel")
|
m.urlLabel = m.top.findNode("urlLabel")
|
||||||
m.qrCode = m.top.findNode("QrCodePoster")
|
m.qrCode = m.top.findNode("QrCodePoster")
|
||||||
|
|
||||||
@@ -31,10 +33,10 @@ function OnUrlSet()
|
|||||||
url = m.top.url
|
url = m.top.url
|
||||||
|
|
||||||
m.urlLabel.text = url
|
m.urlLabel.text = url
|
||||||
StartAsyncTask(GenerateQrCodeTask, {
|
AsyncTask.Start(Tasks.GenerateQrCodeTask, {
|
||||||
poster: m.qrCode,
|
poster: m.qrCode
|
||||||
text: url,
|
text: url
|
||||||
size: m.qrCode.loadWidth,
|
size: m.qrCode.loadWidth
|
||||||
padding: 10
|
padding: 10
|
||||||
})
|
})
|
||||||
end function
|
end function
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
horizAlign="right"
|
horizAlign="right"
|
||||||
width="400"
|
width="400"
|
||||||
extendToDialogEdge="false"
|
extendToDialogEdge="false"
|
||||||
showDivider="true">
|
showDivider="false">
|
||||||
<Label
|
<Label
|
||||||
text="Scan the QR Code"
|
text="Scan the QR Code"
|
||||||
horizAlign="center"
|
horizAlign="center"
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
|
import "DialogPalette.bs"
|
||||||
import "pkg:/source/utils/Types.bs"
|
import "pkg:/source/utils/Types.bs"
|
||||||
|
|
||||||
function Init()
|
function Init()
|
||||||
|
SetPalette(m.top)
|
||||||
m.top.observeField("buttonSelected", FuncName(CloseDialog))
|
m.top.observeField("buttonSelected", FuncName(CloseDialog))
|
||||||
end function
|
end function
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import "pkg:/source/utils/Logging.bs"
|
import "pkg:/source/utils/Logging.bs"
|
||||||
import "pkg:/source/utils/Types.bs"
|
import "pkg:/source/utils/StringUtils.bs"
|
||||||
|
|
||||||
function Init()
|
function Init()
|
||||||
m.top.functionName = "LoggerLoop"
|
m.top.functionName = "LoggerLoop"
|
||||||
@@ -32,13 +32,23 @@ function LoggerLoop()
|
|||||||
port = m.port
|
port = m.port
|
||||||
|
|
||||||
buffer = CreateObject("roByteArray")
|
buffer = CreateObject("roByteArray")
|
||||||
previousLogsFile = m.top.folder + "/" + m.top.filenamePrevious
|
|
||||||
logsFile = m.top.folder + "/" + m.top.filename
|
logsFile = m.top.folder + "/" + m.top.filename
|
||||||
|
previousLogsFile = m.top.folder + "/" + m.top.filenamePrevious
|
||||||
|
filenameStartup = m.top.filenameStartup
|
||||||
|
|
||||||
CreateDirectory(m.top.folder)
|
CreateDirectory(m.top.folder)
|
||||||
DeleteFile(previousLogsFile)
|
DeleteFile(previousLogsFile)
|
||||||
MoveFile(logsFile, previousLogsFile)
|
MoveFile(logsFile, previousLogsFile)
|
||||||
|
|
||||||
|
startUpLogs = ReadAsciiFile(filenameStartup)
|
||||||
|
if not StringUtils.IsNullOrEmpty(startUpLogs)
|
||||||
|
line = `************* Startup Logs *************\n${startUpLogs}*********** End Startup Logs ***********\n`
|
||||||
|
' bs:disable-next-line LINT3012
|
||||||
|
print line
|
||||||
|
buffer.FromAsciiString(line)
|
||||||
|
buffer.AppendFile(logsFile)
|
||||||
|
end if
|
||||||
|
|
||||||
while true
|
while true
|
||||||
msg = wait(0, port)
|
msg = wait(0, port)
|
||||||
msgType = type(msg)
|
msgType = type(msg)
|
||||||
|
|||||||
@@ -5,5 +5,6 @@
|
|||||||
<field id="folder" type="string" value="cachefs:/logs" />
|
<field id="folder" type="string" value="cachefs:/logs" />
|
||||||
<field id="filename" type="string" value="app_logs.txt" />
|
<field id="filename" type="string" value="app_logs.txt" />
|
||||||
<field id="filenamePrevious" type="string" value="app_logs_previous.txt" />
|
<field id="filenamePrevious" type="string" value="app_logs_previous.txt" />
|
||||||
|
<field id="filenameStartup" type="string" value="cachefs:/playlet_startup_logs.txt" />
|
||||||
</interface>
|
</interface>
|
||||||
</component>
|
</component>
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
import "pkg:/components/EcpArgs.bs"
|
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:/source/utils/LoadingScreen.bs"
|
import "pkg:/source/utils/LoadingScreen.bs"
|
||||||
|
|
||||||
function Init()
|
function Init()
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
'import "pkg:/components/EcpArgs.bs"
|
'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:/source/utils/LoadingScreen.bs"
|
'import "pkg:/source/utils/LoadingScreen.bs"
|
||||||
|
|
||||||
function Init()
|
function Init()
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
<script type="text/brightscript" uri="pkg:/components/MainScene_bindings.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:/components/MainScene.brs" />
|
||||||
<script type="text/brightscript" uri="pkg:/source/utils/LoadingScreen.brs" />
|
<script type="text/brightscript" uri="pkg:/source/utils/LoadingScreen.brs" />
|
||||||
|
<script type="text/brightscript" uri="pkg:/components/parts/AutoBind/OnNodeReadyNoOp.brs" />
|
||||||
<script type="text/brightscript" uri="pkg:/components/EcpArgs.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/Types.brs" />
|
||||||
<script type="text/brightscript" uri="pkg:/source/utils/StringUtils.brs" />
|
<script type="text/brightscript" uri="pkg:/source/utils/StringUtils.brs" />
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import "pkg:/source/utils/ColorUtils.bs"
|
|
||||||
import "pkg:/source/utils/FocusManagement.bs"
|
import "pkg:/source/utils/FocusManagement.bs"
|
||||||
import "pkg:/source/utils/Types.bs"
|
import "pkg:/source/utils/Types.bs"
|
||||||
|
|
||||||
@@ -31,8 +30,8 @@ function PopulateButtons() as void
|
|||||||
buttons = []
|
buttons = []
|
||||||
for each item in navBarItems
|
for each item in navBarItems
|
||||||
button = CreateObject("roSGNode", "IconButton")
|
button = CreateObject("roSGNode", "IconButton")
|
||||||
button.background = ColorUtils.HexToInt("242424")
|
button.background = "#242424FF"
|
||||||
button.focusBackground = ColorUtils.HexToInt("ff1c30")
|
button.focusBackground = "#FF1C30FF"
|
||||||
button.padding = 20
|
button.padding = 20
|
||||||
button.height = 50
|
button.height = 50
|
||||||
button.width = 90
|
button.width = 90
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ const OPTIONS_LONG_PRESS_KEY = "OPTIONS_LONG_PRESS"
|
|||||||
|
|
||||||
function InitializeLongPress(keys as object, duration = 1.0 as float)
|
function InitializeLongPress(keys as object, duration = 1.0 as float)
|
||||||
longPressKeyMap = {
|
longPressKeyMap = {
|
||||||
"OK": OK_LONG_PRESS_KEY,
|
"OK": OK_LONG_PRESS_KEY
|
||||||
"options": OPTIONS_LONG_PRESS_KEY
|
"options": OPTIONS_LONG_PRESS_KEY
|
||||||
}
|
}
|
||||||
m._longPressKeyMap = {}
|
m._longPressKeyMap = {}
|
||||||
@@ -17,7 +17,7 @@ function InitializeLongPress(keys as object, duration = 1.0 as float)
|
|||||||
' - press K to simulate an "OK" long press on the remote.
|
' - press K to simulate an "OK" long press on the remote.
|
||||||
' - press O to simulate an "options" long press on the remote.
|
' - press O to simulate an "options" long press on the remote.
|
||||||
simulatedLongPressKeyMap = {
|
simulatedLongPressKeyMap = {
|
||||||
"OK": "Lit_k",
|
"OK": "Lit_k"
|
||||||
"options": "Lit_o"
|
"options": "Lit_o"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,8 +10,8 @@ function SetNavigation(fromNode as object, direction as string, toNode as object
|
|||||||
end if
|
end if
|
||||||
|
|
||||||
m._navigation[direction].push({
|
m._navigation[direction].push({
|
||||||
fromNode: fromNode,
|
fromNode: fromNode
|
||||||
toNode: toNode,
|
toNode: toNode
|
||||||
callback: callback
|
callback: callback
|
||||||
})
|
})
|
||||||
end function
|
end function
|
||||||
@@ -19,7 +19,7 @@ end function
|
|||||||
function NavigationKeyHandler(key as string, press as boolean) as object
|
function NavigationKeyHandler(key as string, press as boolean) as object
|
||||||
if not press
|
if not press
|
||||||
return {
|
return {
|
||||||
handled: false,
|
handled: false
|
||||||
node: invalid
|
node: invalid
|
||||||
}
|
}
|
||||||
end if
|
end if
|
||||||
@@ -27,7 +27,7 @@ function NavigationKeyHandler(key as string, press as boolean) as object
|
|||||||
navigations = m._navigation[key]
|
navigations = m._navigation[key]
|
||||||
if navigations = invalid
|
if navigations = invalid
|
||||||
return {
|
return {
|
||||||
handled: false,
|
handled: false
|
||||||
node: invalid
|
node: invalid
|
||||||
}
|
}
|
||||||
end if
|
end if
|
||||||
@@ -41,13 +41,13 @@ function NavigationKeyHandler(key as string, press as boolean) as object
|
|||||||
item.callback()
|
item.callback()
|
||||||
end if
|
end if
|
||||||
return {
|
return {
|
||||||
handled: true,
|
handled: true
|
||||||
node: item.toNode
|
node: item.toNode
|
||||||
}
|
}
|
||||||
end if
|
end if
|
||||||
end for
|
end for
|
||||||
return {
|
return {
|
||||||
handled: false,
|
handled: false
|
||||||
node: invalid
|
node: invalid
|
||||||
}
|
}
|
||||||
end function
|
end function
|
||||||
@@ -1,13 +1,14 @@
|
|||||||
import "pkg:/components/Dialog/DialogUtils.bs"
|
import "pkg:/components/Dialog/DialogUtils.bs"
|
||||||
import "pkg:/components/NodeByRef/NodeByRef.bs"
|
import "pkg:/components/NodeByRef/NodeByRef.bs"
|
||||||
import "pkg:/components/PlaylistView/PlaylistContentTask.bs"
|
|
||||||
import "pkg:/components/PlayQueue/Notifications/PlayQueueNotificationUtils.bs"
|
import "pkg:/components/PlayQueue/Notifications/PlayQueueNotificationUtils.bs"
|
||||||
import "pkg:/components/VideoFeed/FeedLoadState.bs"
|
import "pkg:/components/VideoFeed/FeedLoadState.bs"
|
||||||
import "pkg:/components/VideoPlayer/VideoUtils.bs"
|
import "pkg:/components/VideoPlayer/VideoUtils.bs"
|
||||||
import "pkg:/source/asyncTask/asyncTask.bs"
|
import "pkg:/source/AsyncTask/AsyncTask.bs"
|
||||||
|
import "pkg:/source/AsyncTask/Tasks.bs"
|
||||||
import "pkg:/source/utils/ArrayUtils.bs"
|
import "pkg:/source/utils/ArrayUtils.bs"
|
||||||
import "pkg:/source/utils/ErrorUtils.bs"
|
import "pkg:/source/utils/ErrorUtils.bs"
|
||||||
import "pkg:/source/utils/Logging.bs"
|
import "pkg:/source/utils/Logging.bs"
|
||||||
|
import "pkg:/source/utils/RingBuffer.bs"
|
||||||
import "pkg:/source/utils/Types.bs"
|
import "pkg:/source/utils/Types.bs"
|
||||||
|
|
||||||
' TODO:P1 prevent adding duplicates of the same video/playlist
|
' TODO:P1 prevent adding duplicates of the same video/playlist
|
||||||
@@ -17,6 +18,8 @@ function Init()
|
|||||||
m.top.content = m.content
|
m.top.content = m.content
|
||||||
m.content.addField("index", "integer", false)
|
m.content.addField("index", "integer", false)
|
||||||
m.content.index = m.top.index
|
m.content.index = m.top.index
|
||||||
|
' TODO:P2 use actual queue nodes instead of internal buffer
|
||||||
|
m.watchedVideos = new RingBuffer(100)
|
||||||
end function
|
end function
|
||||||
|
|
||||||
function Play(node as object, playlistIndex as integer)
|
function Play(node as object, playlistIndex as integer)
|
||||||
@@ -53,7 +56,7 @@ function WrapWithIndexField(node as object) as object
|
|||||||
end function
|
end function
|
||||||
|
|
||||||
' TODO:P0 better model of the queue (Now playing, etc)
|
' TODO:P0 better model of the queue (Now playing, etc)
|
||||||
function GetQueue(unused as dynamic) as object
|
function GetQueue(_unused as dynamic) as object
|
||||||
queueNodes = m.content.getChildren(-1, 0)
|
queueNodes = m.content.getChildren(-1, 0)
|
||||||
items = []
|
items = []
|
||||||
for each node in queueNodes
|
for each node in queueNodes
|
||||||
@@ -65,37 +68,37 @@ function GetQueue(unused as dynamic) as object
|
|||||||
nodeType = node.type
|
nodeType = node.type
|
||||||
if nodeType = "video"
|
if nodeType = "video"
|
||||||
items.push({
|
items.push({
|
||||||
type: nodeType,
|
type: nodeType
|
||||||
videoId: node.videoId,
|
videoId: node.videoId
|
||||||
title: node.title,
|
title: node.title
|
||||||
author: node.author,
|
author: node.author
|
||||||
thumbnail: node.thumbnail
|
thumbnail: node.thumbnail
|
||||||
})
|
})
|
||||||
else if node.type = "playlist"
|
else if node.type = "playlist"
|
||||||
items.push({
|
items.push({
|
||||||
type: nodeType,
|
type: nodeType
|
||||||
playlistId: node.playlistId,
|
playlistId: node.playlistId
|
||||||
title: node.title,
|
title: node.title
|
||||||
thumbnail: node.thumbnail,
|
thumbnail: node.thumbnail
|
||||||
videoCountText: node.videoCountText
|
videoCountText: node.videoCountText
|
||||||
})
|
})
|
||||||
end if
|
end if
|
||||||
end for
|
end for
|
||||||
|
|
||||||
return {
|
return {
|
||||||
index: m.top.index,
|
index: m.top.index
|
||||||
playlistIndex: m.top.playlistIndex,
|
playlistIndex: m.top.playlistIndex
|
||||||
items: items
|
items: items
|
||||||
}
|
}
|
||||||
end function
|
end function
|
||||||
|
|
||||||
function Clear(unused as dynamic)
|
function Clear(_unused as dynamic)
|
||||||
m.content.removeChildrenIndex(m.content.getChildCount(), 0)
|
m.content.removeChildrenIndex(m.content.getChildCount(), 0)
|
||||||
m.top.index = -1
|
m.top.index = -1
|
||||||
m.top.playlistIndex = -1
|
m.top.playlistIndex = -1
|
||||||
end function
|
end function
|
||||||
|
|
||||||
function PlayNextItem(unused as dynamic) as boolean
|
function PlayNextItem(_unused as dynamic) as boolean
|
||||||
childCount = m.content.getChildCount()
|
childCount = m.content.getChildCount()
|
||||||
if childCount = 0
|
if childCount = 0
|
||||||
return false
|
return false
|
||||||
@@ -138,7 +141,7 @@ function PlayItemAtCurrentIndex() as boolean
|
|||||||
return false
|
return false
|
||||||
end if
|
end if
|
||||||
if node.type = "video"
|
if node.type = "video"
|
||||||
VideoUtils.PlayVideo(node)
|
PlayVideo(node)
|
||||||
return true
|
return true
|
||||||
else if node.type = "playlist"
|
else if node.type = "playlist"
|
||||||
if m.top.playlistIndex = -1
|
if m.top.playlistIndex = -1
|
||||||
@@ -162,7 +165,7 @@ function PlayPlaylistAtCurrentIndex(playlist as object) as boolean
|
|||||||
|
|
||||||
if playlistIndex < playlist.getChildCount()
|
if playlistIndex < playlist.getChildCount()
|
||||||
child = playlist.getChild(playlistIndex)
|
child = playlist.getChild(playlistIndex)
|
||||||
VideoUtils.PlayVideo(child)
|
PlayVideo(child)
|
||||||
return true
|
return true
|
||||||
end if
|
end if
|
||||||
|
|
||||||
@@ -170,6 +173,14 @@ function PlayPlaylistAtCurrentIndex(playlist as object) as boolean
|
|||||||
return true
|
return true
|
||||||
end function
|
end function
|
||||||
|
|
||||||
|
function PlayVideo(node as object)
|
||||||
|
videoId = node.videoId
|
||||||
|
if not m.watchedVideos.Contains(videoId)
|
||||||
|
m.watchedVideos.Push(videoId)
|
||||||
|
end if
|
||||||
|
VideoUtils.PlayVideo(node)
|
||||||
|
end function
|
||||||
|
|
||||||
function LoadPlaylist(playlist as object) as void
|
function LoadPlaylist(playlist as object) as void
|
||||||
if playlist.loadState = FeedLoadState.Loading
|
if playlist.loadState = FeedLoadState.Loading
|
||||||
return
|
return
|
||||||
@@ -177,8 +188,8 @@ function LoadPlaylist(playlist as object) as void
|
|||||||
|
|
||||||
playlist.loadState = FeedLoadState.Loading
|
playlist.loadState = FeedLoadState.Loading
|
||||||
|
|
||||||
task = StartAsyncTask(PlaylistContentTask, {
|
task = AsyncTask.Start(Tasks.PlaylistContentTask, {
|
||||||
content: playlist,
|
content: playlist
|
||||||
invidious: m.top.invidious
|
invidious: m.top.invidious
|
||||||
}, OnPlaylistContentTaskResult)
|
}, OnPlaylistContentTaskResult)
|
||||||
m.pendingLoadTasks[task.id] = task
|
m.pendingLoadTasks[task.id] = task
|
||||||
@@ -219,3 +230,11 @@ function OnIndexChange()
|
|||||||
child.index = index
|
child.index = index
|
||||||
end for
|
end for
|
||||||
end function
|
end function
|
||||||
|
|
||||||
|
function watchedVideosContain(videoId as string) as boolean
|
||||||
|
return m.watchedVideos.Contains(videoId)
|
||||||
|
end function
|
||||||
|
|
||||||
|
function watchedVideosClear(_unused as dynamic)
|
||||||
|
m.watchedVideos = new RingBuffer(100)
|
||||||
|
end function
|
||||||
@@ -12,6 +12,8 @@
|
|||||||
<function name="Clear" />
|
<function name="Clear" />
|
||||||
<function name="PlayNextItem" />
|
<function name="PlayNextItem" />
|
||||||
<function name="PlayItemAtIndex" />
|
<function name="PlayItemAtIndex" />
|
||||||
|
<function name="watchedVideosContain" />
|
||||||
|
<function name="watchedVideosClear" />
|
||||||
</interface>
|
</interface>
|
||||||
<children>
|
<children>
|
||||||
<ContentNode id="Content" />
|
<ContentNode id="Content" />
|
||||||
|
|||||||
@@ -66,6 +66,7 @@ function SetHighlight() as void
|
|||||||
index = m.top.index
|
index = m.top.index
|
||||||
|
|
||||||
if playQueueIndex = index
|
if playQueueIndex = index
|
||||||
|
' bs:disable-next-line LINT3023
|
||||||
m.top.thumbnailBlendColor = "#FFFFFFFF"
|
m.top.thumbnailBlendColor = "#FFFFFFFF"
|
||||||
m.top.highlightUri = "pkg:/images/focus_grid.9.png"
|
m.top.highlightUri = "pkg:/images/focus_grid.9.png"
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -35,7 +35,7 @@
|
|||||||
</Poster>
|
</Poster>
|
||||||
<Poster
|
<Poster
|
||||||
id="highlightPoster"
|
id="highlightPoster"
|
||||||
blendColor="0xFF0000"
|
blendColor="0xFF1C30"
|
||||||
width="164"
|
width="164"
|
||||||
height="94" />
|
height="94" />
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ function PlaylistContentTask(input as object) as object
|
|||||||
if not response.IsSuccess() or metadata = invalid
|
if not response.IsSuccess() or metadata = invalid
|
||||||
contentNode.loadState = FeedLoadState.Error
|
contentNode.loadState = FeedLoadState.Error
|
||||||
return {
|
return {
|
||||||
success: false,
|
success: false
|
||||||
error: response.ErrorMessage()
|
error: response.ErrorMessage()
|
||||||
}
|
}
|
||||||
end if
|
end if
|
||||||
|
|||||||
@@ -2,10 +2,11 @@ import "pkg:/components/ChannelView/ChannelUtils.bs"
|
|||||||
import "pkg:/components/ContextMenu/ContextMenuUtils.bs"
|
import "pkg:/components/ContextMenu/ContextMenuUtils.bs"
|
||||||
import "pkg:/components/Dialog/DialogUtils.bs"
|
import "pkg:/components/Dialog/DialogUtils.bs"
|
||||||
import "pkg:/components/Navigation/LongPress.bs"
|
import "pkg:/components/Navigation/LongPress.bs"
|
||||||
import "pkg:/components/PlaylistView/PlaylistContentTask.bs"
|
import "pkg:/components/Services/Invidious/InvidiousToContentNode.bs"
|
||||||
import "pkg:/components/VideoFeed/FeedLoadState.bs"
|
import "pkg:/components/VideoFeed/FeedLoadState.bs"
|
||||||
import "pkg:/components/VideoPlayer/VideoUtils.bs"
|
import "pkg:/components/VideoPlayer/VideoUtils.bs"
|
||||||
import "pkg:/source/asyncTask/asyncTask.bs"
|
import "pkg:/source/AsyncTask/AsyncTask.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/Logging.bs"
|
import "pkg:/source/utils/Logging.bs"
|
||||||
@@ -222,8 +223,8 @@ function LoadPlaylist() as void
|
|||||||
end if
|
end if
|
||||||
|
|
||||||
m.top.content.loadState = FeedLoadState.Loading
|
m.top.content.loadState = FeedLoadState.Loading
|
||||||
m.playlistLoadTask = StartAsyncTask(PlaylistContentTask, {
|
m.playlistLoadTask = AsyncTask.Start(Tasks.PlaylistContentTask, {
|
||||||
content: m.top.content,
|
content: m.top.content
|
||||||
invidious: m.top.invidious
|
invidious: m.top.invidious
|
||||||
}, OnPlaylistContentTaskResult)
|
}, OnPlaylistContentTaskResult)
|
||||||
end function
|
end function
|
||||||
|
|||||||
@@ -1,30 +1,30 @@
|
|||||||
import "pkg:/source/asyncTask/asyncTask.bs"
|
import "pkg:/source/AsyncTask/AsyncTask.bs"
|
||||||
|
|
||||||
function Init()
|
function Init()
|
||||||
' TODO:P2 Add tooltip to each field with description of what it means
|
' TODO:P2 Add tooltip to each field with description of what it means
|
||||||
m.displayNames = [{
|
m.displayNames = [{
|
||||||
key: "app_version",
|
key: "app_version"
|
||||||
displayText: "Playlet App Version"
|
displayText: "Playlet App Version"
|
||||||
}, {
|
}, {
|
||||||
key: "lib_version",
|
key: "lib_version"
|
||||||
displayText: "Playlet Library Version"
|
displayText: "Playlet Library Version"
|
||||||
}, {
|
}, {
|
||||||
key: "lib_version_latest",
|
key: "lib_version_latest"
|
||||||
displayText: "Playlet Library Latest Version"
|
displayText: "Playlet Library Latest Version"
|
||||||
}, {
|
}, {
|
||||||
key: "lib_url",
|
key: "lib_url"
|
||||||
displayText: "Playlet Library URL"
|
displayText: "Playlet Library URL"
|
||||||
}, {
|
}, {
|
||||||
key: "lib_url_type",
|
key: "lib_url_type"
|
||||||
displayText: "Playlet Library URL Type"
|
displayText: "Playlet Library URL Type"
|
||||||
}, {
|
}, {
|
||||||
key: "app_git_commit_hash",
|
key: "app_git_commit_hash"
|
||||||
displayText: "Playlet App Git Commit Hash"
|
displayText: "Playlet App Git Commit Hash"
|
||||||
}, {
|
}, {
|
||||||
key: "lib_git_commit_hash",
|
key: "lib_git_commit_hash"
|
||||||
displayText: "Playlet Library Git Commit Hash"
|
displayText: "Playlet Library Git Commit Hash"
|
||||||
}, {
|
}, {
|
||||||
key: "id",
|
key: "id"
|
||||||
displayText: "App ID"
|
displayText: "App ID"
|
||||||
}]
|
}]
|
||||||
|
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ function OnVisibleChange()
|
|||||||
end if
|
end if
|
||||||
end function
|
end function
|
||||||
|
|
||||||
function Refresh(unused as dynamic)
|
function Refresh(_unused as dynamic)
|
||||||
m.isDirty = true
|
m.isDirty = true
|
||||||
OnBookmarksChange()
|
OnBookmarksChange()
|
||||||
end function
|
end function
|
||||||
@@ -79,7 +79,7 @@ function SetRowListContent(bookmarksContent as object)
|
|||||||
end for
|
end for
|
||||||
|
|
||||||
feeds.push({
|
feeds.push({
|
||||||
"title": bookmarkGroupNode.title,
|
"title": bookmarkGroupNode.title
|
||||||
"feedSources": feedSources
|
"feedSources": feedSources
|
||||||
})
|
})
|
||||||
end for
|
end for
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
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"
|
||||||
@@ -14,7 +15,15 @@ function OnNodeReady()
|
|||||||
SetNavigation(invalid, "left", m.navBar)
|
SetNavigation(invalid, "left", m.navBar)
|
||||||
|
|
||||||
m.rowList@.BindNode()
|
m.rowList@.BindNode()
|
||||||
m.rowList.feeds = ParseJson(ReadAsciiFile(m.top.feedFile))
|
|
||||||
|
' TODO:P1 home screen should only be refreshed when the user navigates to it
|
||||||
|
' (similar to bookmarks screen)
|
||||||
|
m.preferences.observeFieldScoped("misc.home_screen_layout", FuncName(OnHomeLayoutChange))
|
||||||
|
OnHomeLayoutChange()
|
||||||
|
end function
|
||||||
|
|
||||||
|
function OnHomeLayoutChange() as void
|
||||||
|
m.rowList.feeds = HomeScreenUtils.GetFeed(m.top.feedFile, m.preferences)
|
||||||
end function
|
end function
|
||||||
|
|
||||||
function OnFocusChange() as void
|
function OnFocusChange() as void
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
<interface>
|
<interface>
|
||||||
<field id="navBar" type="node" bind="/NavBar" />
|
<field id="navBar" type="node" bind="/NavBar" />
|
||||||
<field id="invidious" type="node" bind="/Invidious" />
|
<field id="invidious" type="node" bind="/Invidious" />
|
||||||
|
<field id="preferences" type="node" bind="/Preferences" />
|
||||||
<field id="feedFile" type="string" value="libpkg:/config/default_home_layout.yaml" />
|
<field id="feedFile" type="string" value="libpkg:/config/default_home_layout.yaml" />
|
||||||
</interface>
|
</interface>
|
||||||
<children>
|
<children>
|
||||||
|
|||||||
@@ -0,0 +1,28 @@
|
|||||||
|
import "pkg:/source/utils/Types.bs"
|
||||||
|
|
||||||
|
namespace HomeScreenUtils
|
||||||
|
|
||||||
|
function GetFeed(feedFileName as string, preferences as object) as object
|
||||||
|
feed = ParseJson(ReadAsciiFile(feedFileName))
|
||||||
|
|
||||||
|
homeLayout = preferences["misc.home_screen_layout"]
|
||||||
|
if not IsArray(homeLayout) or homeLayout.Count() = 0
|
||||||
|
return feed
|
||||||
|
end if
|
||||||
|
|
||||||
|
feedItems = {}
|
||||||
|
for each item in feed
|
||||||
|
feedItems[item["id"]] = item
|
||||||
|
end for
|
||||||
|
|
||||||
|
filteredFeed = []
|
||||||
|
for each item in homeLayout
|
||||||
|
if item.enabled = true
|
||||||
|
filteredFeed.push(feedItems[item.id])
|
||||||
|
end if
|
||||||
|
end for
|
||||||
|
|
||||||
|
return filteredFeed
|
||||||
|
end function
|
||||||
|
|
||||||
|
end namespace
|
||||||
@@ -5,110 +5,110 @@ import "pkg:/source/utils/Types.bs"
|
|||||||
function Init()
|
function Init()
|
||||||
options = {
|
options = {
|
||||||
date: [{
|
date: [{
|
||||||
title: "Any date",
|
title: "Any date"
|
||||||
value: ""
|
value: ""
|
||||||
}, {
|
}, {
|
||||||
title: "Last hour",
|
title: "Last hour"
|
||||||
value: "hour"
|
value: "hour"
|
||||||
}, {
|
}, {
|
||||||
title: "Today",
|
title: "Today"
|
||||||
value: "today"
|
value: "today"
|
||||||
}, {
|
}, {
|
||||||
title: "This week",
|
title: "This week"
|
||||||
value: "week"
|
value: "week"
|
||||||
}, {
|
}, {
|
||||||
title: "This month",
|
title: "This month"
|
||||||
value: "month"
|
value: "month"
|
||||||
}, {
|
}, {
|
||||||
title: "This year",
|
title: "This year"
|
||||||
value: "year"
|
value: "year"
|
||||||
}],
|
}]
|
||||||
type: [{
|
type: [{
|
||||||
title: "Any type",
|
title: "Any type"
|
||||||
value: ""
|
value: ""
|
||||||
}, {
|
}, {
|
||||||
title: "Video",
|
title: "Video"
|
||||||
value: "video"
|
value: "video"
|
||||||
}, {
|
}, {
|
||||||
title: "Playlist",
|
title: "Playlist"
|
||||||
value: "playlist"
|
value: "playlist"
|
||||||
}, {
|
}, {
|
||||||
title: "Channel",
|
title: "Channel"
|
||||||
value: "channel"
|
value: "channel"
|
||||||
}, {
|
}, {
|
||||||
title: "Movie",
|
title: "Movie"
|
||||||
value: "movie"
|
value: "movie"
|
||||||
}, {
|
}, {
|
||||||
title: "Show",
|
title: "Show"
|
||||||
value: "show"
|
value: "show"
|
||||||
}],
|
}]
|
||||||
duration: [{
|
duration: [{
|
||||||
title: "Any duration",
|
title: "Any duration"
|
||||||
value: ""
|
value: ""
|
||||||
}, {
|
}, {
|
||||||
title: "Under 4 minutes",
|
title: "Under 4 minutes"
|
||||||
value: "short"
|
value: "short"
|
||||||
}, {
|
}, {
|
||||||
title: "4 - 20 minutes",
|
title: "4 - 20 minutes"
|
||||||
value: "medium"
|
value: "medium"
|
||||||
}, {
|
}, {
|
||||||
title: "Over 20 minutes",
|
title: "Over 20 minutes"
|
||||||
value: "long"
|
value: "long"
|
||||||
}],
|
}]
|
||||||
features: [{
|
features: [{
|
||||||
title: "Live",
|
title: "Live"
|
||||||
value: "live"
|
value: "live"
|
||||||
}, {
|
}, {
|
||||||
title: "4K",
|
title: "4K"
|
||||||
value: "4k"
|
value: "4k"
|
||||||
}, {
|
}, {
|
||||||
title: "HD",
|
title: "HD"
|
||||||
value: "hd"
|
value: "hd"
|
||||||
}, {
|
}, {
|
||||||
title: "Subtitles/CC",
|
title: "Subtitles/CC"
|
||||||
value: "subtitles"
|
value: "subtitles"
|
||||||
}, {
|
}, {
|
||||||
title: "Creative Commons",
|
title: "Creative Commons"
|
||||||
value: "creative_commons"
|
value: "creative_commons"
|
||||||
}, {
|
}, {
|
||||||
title: "360°",
|
title: "360°"
|
||||||
value: "360"
|
value: "360"
|
||||||
}, {
|
}, {
|
||||||
title: "VR180",
|
title: "VR180"
|
||||||
value: "vr180"
|
value: "vr180"
|
||||||
}, {
|
}, {
|
||||||
title: "3D",
|
title: "3D"
|
||||||
value: "3d"
|
value: "3d"
|
||||||
}, {
|
}, {
|
||||||
title: "HDR",
|
title: "HDR"
|
||||||
value: "hdr"
|
value: "hdr"
|
||||||
}, {
|
}, {
|
||||||
title: "Purchased",
|
title: "Purchased"
|
||||||
value: "purchased"
|
value: "purchased"
|
||||||
}, {
|
}, {
|
||||||
title: "Location",
|
title: "Location"
|
||||||
value: "location"
|
value: "location"
|
||||||
}],
|
}]
|
||||||
sort_by: [{
|
sort_by: [{
|
||||||
title: "Relevance",
|
title: "Relevance"
|
||||||
value: ""
|
value: ""
|
||||||
}, {
|
}, {
|
||||||
title: "Upload date",
|
title: "Upload date"
|
||||||
value: "upload_date"
|
value: "upload_date"
|
||||||
}, {
|
}, {
|
||||||
title: "View count",
|
title: "View count"
|
||||||
value: "view_count"
|
value: "view_count"
|
||||||
}, {
|
}, {
|
||||||
title: "Rating",
|
title: "Rating"
|
||||||
value: "rating"
|
value: "rating"
|
||||||
}]
|
}]
|
||||||
}
|
}
|
||||||
|
|
||||||
m.controls = {
|
m.controls = {
|
||||||
date: m.top.findNode("UploadDateList"),
|
date: m.top.findNode("UploadDateList")
|
||||||
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_by: m.top.findNode("SortByList")
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -118,10 +118,10 @@ function Init()
|
|||||||
end for
|
end for
|
||||||
|
|
||||||
m.contentNodes = {
|
m.contentNodes = {
|
||||||
date: m.controls.date.content,
|
date: m.controls.date.content
|
||||||
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_by: m.controls.sort_by.content
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
import "pkg:/components/Navigation/Navigation.bs"
|
import "pkg:/components/Navigation/Navigation.bs"
|
||||||
import "pkg:/components/Screens/SearchScreen/SearchSuggestionsTask.bs"
|
|
||||||
import "pkg:/components/Services/SearchHistory/SearchHistoryUtils.bs"
|
import "pkg:/components/Services/SearchHistory/SearchHistoryUtils.bs"
|
||||||
import "pkg:/source/asyncTask/asyncTask.bs"
|
import "pkg:/source/AsyncTask/AsyncTask.bs"
|
||||||
|
import "pkg:/source/AsyncTask/Tasks.bs"
|
||||||
|
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"
|
||||||
@@ -25,10 +26,10 @@ function Init()
|
|||||||
textEditBox.voiceEnabled = true
|
textEditBox.voiceEnabled = true
|
||||||
|
|
||||||
m.top.filters = {
|
m.top.filters = {
|
||||||
date: "",
|
date: ""
|
||||||
type: "",
|
type: ""
|
||||||
duration: "",
|
duration: ""
|
||||||
features: [],
|
features: []
|
||||||
sort_by: ""
|
sort_by: ""
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -98,9 +99,9 @@ function OnTextChange() as void
|
|||||||
m.searchSuggestionsTask.cancel = true
|
m.searchSuggestionsTask.cancel = true
|
||||||
end if
|
end if
|
||||||
|
|
||||||
m.searchSuggestionsTask = StartAsyncTask(SearchSuggestionsTask, {
|
m.searchSuggestionsTask = AsyncTask.Start(Tasks.SearchSuggestionsTask, {
|
||||||
q: m.keyboard.text,
|
q: m.keyboard.text
|
||||||
invidious: m.invidious,
|
invidious: m.invidious
|
||||||
preferences: m.preferences
|
preferences: m.preferences
|
||||||
}, OnSearchSuggestionsTaskResults)
|
}, OnSearchSuggestionsTaskResults)
|
||||||
end function
|
end function
|
||||||
@@ -206,10 +207,10 @@ function Search(text as string)
|
|||||||
ShowLoadingScreen()
|
ShowLoadingScreen()
|
||||||
|
|
||||||
feedSource = {
|
feedSource = {
|
||||||
"id": `inv_search_${CryptoUtils.GetMd5(text)}`,
|
"id": `inv_search_${CryptoUtils.GetMd5(text)}`
|
||||||
"title": `Search - ${text}`,
|
"title": `Search - ${text}`
|
||||||
"apiType": "Invidious",
|
"apiType": "Invidious"
|
||||||
"endpoint": "search",
|
"endpoint": "search"
|
||||||
"queryParams": {
|
"queryParams": {
|
||||||
"q": text
|
"q": text
|
||||||
}
|
}
|
||||||
@@ -222,14 +223,14 @@ function Search(text as string)
|
|||||||
feedSource.queryParams[filter] = value
|
feedSource.queryParams[filter] = value
|
||||||
else if IsArray(value) and value.Count() > 0
|
else if IsArray(value) and value.Count() > 0
|
||||||
feedSource.queryParams[filter] = {
|
feedSource.queryParams[filter] = {
|
||||||
value: value,
|
value: value
|
||||||
arrayType: UrlUtils.QueryParamArrayType.CommaSeparated
|
arrayType: UrlUtils.QueryParamArrayType.CommaSeparated
|
||||||
}
|
}
|
||||||
end if
|
end if
|
||||||
end for
|
end for
|
||||||
|
|
||||||
m.rowList.feeds = [{
|
m.rowList.feeds = [{
|
||||||
"title": `Search - ${text}`,
|
"title": `Search - ${text}`
|
||||||
"feedSources": [feedSource]
|
"feedSources": [feedSource]
|
||||||
}]
|
}]
|
||||||
end function
|
end function
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ function SearchSuggestionsTask(input as object) as object
|
|||||||
end if
|
end if
|
||||||
|
|
||||||
return {
|
return {
|
||||||
q: q,
|
q: q
|
||||||
response: history
|
response: history
|
||||||
}
|
}
|
||||||
end function
|
end function
|
||||||
|
|||||||
@@ -0,0 +1,58 @@
|
|||||||
|
import "pkg:/components/parts/AutoBind/OnNodeReadyNoOp.bs"
|
||||||
|
import "pkg:/source/utils/FocusManagement.bs"
|
||||||
|
import "pkg:/source/utils/Types.bs"
|
||||||
|
|
||||||
|
function Init()
|
||||||
|
m.top.focusable = true
|
||||||
|
m.top.itemSpacings = [8]
|
||||||
|
|
||||||
|
m.button = m.top.findNode("button")
|
||||||
|
m.button.observeField("buttonSelected", FuncName(OpenHomeScreenEditor))
|
||||||
|
end function
|
||||||
|
|
||||||
|
function OnFocusChange() as void
|
||||||
|
if not m.top.focus
|
||||||
|
return
|
||||||
|
end if
|
||||||
|
|
||||||
|
NodeSetFocus(m.button, true)
|
||||||
|
end function
|
||||||
|
|
||||||
|
function BindPreference(preferences as object, key as string)
|
||||||
|
if m.preferences <> invalid and m.key <> invalid
|
||||||
|
m.preferences.unobserveFieldScoped(m.key)
|
||||||
|
end if
|
||||||
|
|
||||||
|
m.preferences = preferences
|
||||||
|
m.key = key
|
||||||
|
|
||||||
|
if preferences <> invalid and key <> invalid
|
||||||
|
preferences.observeFieldScoped(key, FuncName(OnPreferenceChange))
|
||||||
|
OnPreferenceChange()
|
||||||
|
end if
|
||||||
|
end function
|
||||||
|
|
||||||
|
function OpenHomeScreenEditor()
|
||||||
|
editor = CreateObject("roSGNode", "HomeScreenEditor")
|
||||||
|
m.appController@.PushScreen(editor)
|
||||||
|
editor@.BindNode()
|
||||||
|
editor.value = m.top.value
|
||||||
|
editor.observeField("save", FuncName(OnSaveHomeScreenEditor))
|
||||||
|
end function
|
||||||
|
|
||||||
|
function OnSaveHomeScreenEditor(event as object)
|
||||||
|
editor = event.GetRoSGNode()
|
||||||
|
m.top.value = editor.value
|
||||||
|
end function
|
||||||
|
|
||||||
|
function OnPreferenceChange()
|
||||||
|
m.top.value = m.preferences[m.key]
|
||||||
|
end function
|
||||||
|
|
||||||
|
function OnValueChange() as void
|
||||||
|
if m.preferences = invalid or m.key = invalid
|
||||||
|
return
|
||||||
|
end if
|
||||||
|
|
||||||
|
m.preferences[m.key] = m.top.value
|
||||||
|
end function
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
<component name="EditHomeScreenControl" extends="LayoutGroup" includes="AutoBind,Focus">
|
||||||
|
<interface>
|
||||||
|
<field id="displayText" type="string" alias="Button.text" />
|
||||||
|
<field id="description" type="string" alias="DescriptionLabel.text" />
|
||||||
|
<field id="value" type="array" onChange="OnValueChange" />
|
||||||
|
<field id="appController" type="node" bind="/AppController" />
|
||||||
|
<function name="BindPreference" />
|
||||||
|
</interface>
|
||||||
|
<children>
|
||||||
|
<Button
|
||||||
|
id="button"
|
||||||
|
minWidth="300"
|
||||||
|
showFocusFootprint="true" />
|
||||||
|
<Label id="DescriptionLabel"
|
||||||
|
width="450"
|
||||||
|
color="0xb4b4b4ff"
|
||||||
|
wrap="true">
|
||||||
|
<Font role="font" uri="font:SystemFontFile" size="18" />
|
||||||
|
</Label>
|
||||||
|
</children>
|
||||||
|
</component>
|
||||||
@@ -0,0 +1,156 @@
|
|||||||
|
import "pkg:/components/Navigation/Navigation.bs"
|
||||||
|
import "pkg:/components/parts/AutoBind/OnNodeReadyNoOp.bs"
|
||||||
|
import "pkg:/source/utils/MathUtils.bs"
|
||||||
|
import "pkg:/source/utils/Types.bs"
|
||||||
|
|
||||||
|
function Init()
|
||||||
|
m.homeLayout = {}
|
||||||
|
homeLayout = ParseJson(ReadAsciiFile("libpkg:/config/default_home_layout.yaml"))
|
||||||
|
for each item in homeLayout
|
||||||
|
m.homeLayout[item.id] = item
|
||||||
|
end for
|
||||||
|
|
||||||
|
m.checkList = m.top.findNode("checkList")
|
||||||
|
m.moveUpButton = m.top.findNode("moveUpButton")
|
||||||
|
m.moveDownButton = m.top.findNode("moveDownButton")
|
||||||
|
m.closeButton = m.top.findNode("closeButton")
|
||||||
|
m.saveButton = m.top.findNode("saveButton")
|
||||||
|
|
||||||
|
SetNavigation(m.checkList, "down", m.saveButton)
|
||||||
|
SetNavigation(m.saveButton, "up", m.checkList)
|
||||||
|
SetNavigation(m.closeButton, "up", m.checkList)
|
||||||
|
SetNavigation(m.saveButton, "right", m.closeButton)
|
||||||
|
SetNavigation(m.closeButton, "left", m.saveButton)
|
||||||
|
SetNavigation(m.moveUpButton, "left", m.checkList)
|
||||||
|
SetNavigation(m.moveDownButton, "left", m.checkList)
|
||||||
|
SetNavigation(m.checkList, "right", m.moveUpButton)
|
||||||
|
SetNavigation(m.moveUpButton, "down", m.moveDownButton)
|
||||||
|
SetNavigation(m.moveDownButton, "up", m.moveUpButton)
|
||||||
|
SetNavigation(m.moveDownButton, "down", m.closeButton)
|
||||||
|
|
||||||
|
m.moveUpButton.observeField("buttonSelected", FuncName(OnMoveUpButtonSelected))
|
||||||
|
m.moveDownButton.observeField("buttonSelected", FuncName(OnMoveDownButtonSelected))
|
||||||
|
m.saveButton.observeField("buttonSelected", FuncName(OnSaveButtonSelected))
|
||||||
|
m.closeButton.observeField("buttonSelected", FuncName(Close))
|
||||||
|
|
||||||
|
m.checkList.observeField("checkedState", FuncName(OnCheckedStateChange))
|
||||||
|
end function
|
||||||
|
|
||||||
|
function OnFocusChange() as void
|
||||||
|
if not m.top.focus
|
||||||
|
return
|
||||||
|
end if
|
||||||
|
|
||||||
|
NodeSetFocus(m.checkList, true)
|
||||||
|
end function
|
||||||
|
|
||||||
|
function OnkeyEvent(key as string, press as boolean) as boolean
|
||||||
|
if NavigationKeyHandler(key, press).handled
|
||||||
|
return true
|
||||||
|
end if
|
||||||
|
|
||||||
|
if key = "options" and press
|
||||||
|
' A pass-through to the app controller, so it can toggle picture-in-picture
|
||||||
|
return false
|
||||||
|
end if
|
||||||
|
|
||||||
|
if key = "back" and press
|
||||||
|
Close()
|
||||||
|
return true
|
||||||
|
end if
|
||||||
|
|
||||||
|
return true
|
||||||
|
end function
|
||||||
|
|
||||||
|
function OnValueChange()
|
||||||
|
content = m.checkList.content
|
||||||
|
value = m.top.value
|
||||||
|
|
||||||
|
nodes = []
|
||||||
|
checkedState = []
|
||||||
|
for each item in value
|
||||||
|
node = CreateObject("roSGNode", "ContentNode")
|
||||||
|
node.id = item.id
|
||||||
|
node.title = m.homeLayout[item.id].title
|
||||||
|
nodes.push(node)
|
||||||
|
checkedState.push(item.enabled)
|
||||||
|
end for
|
||||||
|
|
||||||
|
labelCount = content.getChildCount()
|
||||||
|
if labelCount > 0
|
||||||
|
content.removeChildrenIndex(labelCount, 0)
|
||||||
|
end if
|
||||||
|
|
||||||
|
content.appendChildren(nodes)
|
||||||
|
m.checkList.checkedState = checkedState
|
||||||
|
end function
|
||||||
|
|
||||||
|
function OnCheckedStateChange() as void
|
||||||
|
content = m.checkList.content
|
||||||
|
if content = invalid or content.getChildCount() = 0
|
||||||
|
return
|
||||||
|
end if
|
||||||
|
checkedState = m.checkList.checkedState
|
||||||
|
if checkedState = invalid or checkedState.Count() = 0
|
||||||
|
return
|
||||||
|
end if
|
||||||
|
|
||||||
|
value = []
|
||||||
|
checkboxes = content.getChildren(-1, 0)
|
||||||
|
|
||||||
|
for i = 0 to checkboxes.Count() - 1
|
||||||
|
checkbox = checkboxes[i]
|
||||||
|
value.push({
|
||||||
|
id: checkbox.id
|
||||||
|
enabled: checkedState[i]
|
||||||
|
})
|
||||||
|
end for
|
||||||
|
|
||||||
|
m.top.value = value
|
||||||
|
end function
|
||||||
|
|
||||||
|
function OnMoveUpButtonSelected() as void
|
||||||
|
MoveItem(-1)
|
||||||
|
end function
|
||||||
|
|
||||||
|
function OnMoveDownButtonSelected() as void
|
||||||
|
MoveItem(1)
|
||||||
|
end function
|
||||||
|
|
||||||
|
function MoveItem(offset as integer) as void
|
||||||
|
content = m.checkList.content
|
||||||
|
if content = invalid or content.getChildCount() = 0
|
||||||
|
return
|
||||||
|
end if
|
||||||
|
|
||||||
|
itemCount = content.getChildCount()
|
||||||
|
index = m.checkList.itemFocused
|
||||||
|
newIndex = MathUtils.Max(0, MathUtils.Min(index + offset, itemCount - 1))
|
||||||
|
|
||||||
|
if index = newIndex
|
||||||
|
return
|
||||||
|
end if
|
||||||
|
|
||||||
|
checkedState = m.checkList.checkedState
|
||||||
|
node = content.getChild(index)
|
||||||
|
content.insertChild(node, newIndex)
|
||||||
|
|
||||||
|
tmp = checkedState[index]
|
||||||
|
checkedState[index] = checkedState[newIndex]
|
||||||
|
checkedState[newIndex] = tmp
|
||||||
|
|
||||||
|
m.checkList.itemFocused = newIndex
|
||||||
|
m.checkList.jumpToItem = newIndex
|
||||||
|
m.checkList.checkedState = checkedState
|
||||||
|
end function
|
||||||
|
|
||||||
|
function OnSaveButtonSelected()
|
||||||
|
' Save the new layout to m.top.value
|
||||||
|
OnCheckedStateChange()
|
||||||
|
m.top.save = true
|
||||||
|
Close()
|
||||||
|
end function
|
||||||
|
|
||||||
|
function Close()
|
||||||
|
m.appController@.PopScreen()
|
||||||
|
end function
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
<component name="HomeScreenEditor" extends="Group" includes="AutoBind,Focus">
|
||||||
|
<interface>
|
||||||
|
<field id="value" type="array" onChange="OnValueChange" />
|
||||||
|
<field id="save" type="boolean" alwaysNotify="true" />
|
||||||
|
<field id="appController" type="node" bind="/AppController" />
|
||||||
|
</interface>
|
||||||
|
<children>
|
||||||
|
<Rectangle
|
||||||
|
width="1280"
|
||||||
|
height="720"
|
||||||
|
color="#000000"
|
||||||
|
opacity="0.5">
|
||||||
|
</Rectangle>
|
||||||
|
<Rectangle
|
||||||
|
width="960"
|
||||||
|
height="600"
|
||||||
|
translation="[160,60]"
|
||||||
|
color="#242424">
|
||||||
|
<CheckList
|
||||||
|
id="checkList"
|
||||||
|
vertFocusAnimationStyle="floatingFocus"
|
||||||
|
translation="[164,70]">
|
||||||
|
|
||||||
|
<ContentNode role="content" />
|
||||||
|
</CheckList>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
id="moveUpButton"
|
||||||
|
text="Move up"
|
||||||
|
showFocusFootprint="true"
|
||||||
|
minWidth="220"
|
||||||
|
translation="[640,183]" />
|
||||||
|
<Button
|
||||||
|
id="moveDownButton"
|
||||||
|
text="Move down"
|
||||||
|
showFocusFootprint="true"
|
||||||
|
minWidth="220"
|
||||||
|
translation="[640,273]" />
|
||||||
|
<Button
|
||||||
|
id="closeButton"
|
||||||
|
text="Close"
|
||||||
|
showFocusFootprint="true"
|
||||||
|
minWidth="150"
|
||||||
|
translation="[500,500]" />
|
||||||
|
<Button
|
||||||
|
id="saveButton"
|
||||||
|
text="Save"
|
||||||
|
showFocusFootprint="true"
|
||||||
|
minWidth="150"
|
||||||
|
translation="[320,500]" />
|
||||||
|
</Rectangle>
|
||||||
|
</children>
|
||||||
|
</component>
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import "pkg:/components/parts/AutoBind/OnNodeReadyNoOp.bs"
|
||||||
import "pkg:/source/utils/FocusManagement.bs"
|
import "pkg:/source/utils/FocusManagement.bs"
|
||||||
import "pkg:/source/utils/Types.bs"
|
import "pkg:/source/utils/Types.bs"
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
|
import "pkg:/components/Dialog/DialogPalette.bs"
|
||||||
import "pkg:/components/Navigation/Navigation.bs"
|
import "pkg:/components/Navigation/Navigation.bs"
|
||||||
|
import "pkg:/components/parts/AutoBind/OnNodeReadyNoOp.bs"
|
||||||
import "pkg:/components/Services/Invidious/InvidiousService.bs"
|
import "pkg:/components/Services/Invidious/InvidiousService.bs"
|
||||||
import "pkg:/source/utils/Types.bs"
|
import "pkg:/source/utils/Types.bs"
|
||||||
|
|
||||||
@@ -77,6 +79,7 @@ end function
|
|||||||
|
|
||||||
function OnEditButtonSelected()
|
function OnEditButtonSelected()
|
||||||
keyboardDialog = createObject("roSGNode", "StandardKeyboardDialog")
|
keyboardDialog = createObject("roSGNode", "StandardKeyboardDialog")
|
||||||
|
SetPalette(keyboardDialog)
|
||||||
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
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
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:/components/Screens/SettingsScreen/InvidiousInstance/InvidiousInstanceTesting/InvidiousInstanceTestingTask.bs"
|
import "pkg:/components/parts/AutoBind/OnNodeReadyNoOp.bs"
|
||||||
import "pkg:/source/asyncTask/asyncTask.bs"
|
import "pkg:/source/AsyncTask/AsyncTask.bs"
|
||||||
|
import "pkg:/source/AsyncTask/Tasks.bs"
|
||||||
import "pkg:/source/utils/FocusManagement.bs"
|
import "pkg:/source/utils/FocusManagement.bs"
|
||||||
|
import "pkg:/source/utils/StringUtils.bs"
|
||||||
import "pkg:/source/utils/Types.bs"
|
import "pkg:/source/utils/Types.bs"
|
||||||
|
|
||||||
function Init()
|
function Init()
|
||||||
@@ -57,8 +59,8 @@ function RunTestsTask()
|
|||||||
m.testingTask.cancel = true
|
m.testingTask.cancel = true
|
||||||
end if
|
end if
|
||||||
|
|
||||||
m.testingTask = StartAsyncTask(InvidiousInstanceTestingTask, {
|
m.testingTask = AsyncTask.Start(Tasks.InvidiousInstanceTestingTask, {
|
||||||
instance: m.top.instance,
|
instance: m.top.instance
|
||||||
listNode: m.testList
|
listNode: m.testList
|
||||||
})
|
})
|
||||||
end function
|
end function
|
||||||
|
|||||||
@@ -38,9 +38,9 @@ function CreateTestNode(title as string, func as function) as object
|
|||||||
testNode = CreateObject("roSGNode", "ContentNode")
|
testNode = CreateObject("roSGNode", "ContentNode")
|
||||||
testNode.title = title
|
testNode.title = title
|
||||||
testNode.AddFields({
|
testNode.AddFields({
|
||||||
func: FuncName(func),
|
func: FuncName(func)
|
||||||
state: "loading",
|
state: "loading"
|
||||||
details: "",
|
details: ""
|
||||||
duration: 0
|
duration: 0
|
||||||
})
|
})
|
||||||
m[testNode.func] = func
|
m[testNode.func] = func
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import "pkg:/components/Dialog/DialogUtils.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/asyncTask/asyncTask.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/Logging.bs"
|
import "pkg:/source/utils/Logging.bs"
|
||||||
@@ -43,7 +43,7 @@ function Refresh()
|
|||||||
m.invidiousPublicInstancesTask.cancel = true
|
m.invidiousPublicInstancesTask.cancel = true
|
||||||
end if
|
end if
|
||||||
|
|
||||||
m.invidiousPublicInstancesTask = StartAsyncTask(InvidiousPublicInstancesTask, {
|
m.invidiousPublicInstancesTask = AsyncTask.Start(Tasks.InvidiousPublicInstancesTask, {
|
||||||
listNode: m.instances
|
listNode: m.instances
|
||||||
}, OnInvidiousPublicInstancesTaskResults)
|
}, OnInvidiousPublicInstancesTaskResults)
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
translation="[190,60]" />
|
translation="[190,60]" />
|
||||||
<Button
|
<Button
|
||||||
id="refreshButton"
|
id="refreshButton"
|
||||||
minWidth="0"
|
minWidth="180"
|
||||||
text="Refresh"
|
text="Refresh"
|
||||||
translation="[340,130]" />
|
translation="[340,130]" />
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import "pkg:/components/Services/Invidious/InvidiousService.bs"
|
import "pkg:/components/Services/Invidious/InvidiousService.bs"
|
||||||
import "pkg:/source/services/HttpClient.bs"
|
import "pkg:/source/services/HttpClient.bs"
|
||||||
|
import "pkg:/source/utils/Logging.bs"
|
||||||
|
|
||||||
@asynctask
|
@asynctask
|
||||||
function InvidiousPublicInstancesTask(input as object) as object
|
function InvidiousPublicInstancesTask(input as object) as object
|
||||||
@@ -14,7 +15,7 @@ function InvidiousPublicInstancesTask(input as object) as object
|
|||||||
|
|
||||||
if not response.IsSuccess() or instances = invalid
|
if not response.IsSuccess() or instances = invalid
|
||||||
return {
|
return {
|
||||||
success: false,
|
success: false
|
||||||
error: response.ErrorMessage()
|
error: response.ErrorMessage()
|
||||||
}
|
}
|
||||||
end if
|
end if
|
||||||
@@ -28,18 +29,10 @@ function InvidiousPublicInstancesTask(input as object) as object
|
|||||||
content = CreateObject("roSGNode", "ContentNode")
|
content = CreateObject("roSGNode", "ContentNode")
|
||||||
|
|
||||||
for each instance in instances
|
for each instance in instances
|
||||||
item = CreateObject("roSGNode", "InvidiousPublicInstancesListItemContent")
|
item = CreateListItemContent(instance)
|
||||||
item.setFields({
|
if item = invalid
|
||||||
name: instance[0],
|
continue for
|
||||||
version: instance[1].stats.software.version,
|
end if
|
||||||
users: instance[1].stats.usage.users.total,
|
|
||||||
signup: instance[1].stats.openRegistrations ? "Yes" : "No",
|
|
||||||
' Leave 5 spaces for the flag, just to simplify the layout
|
|
||||||
location: ` ${instance[1].region}`,
|
|
||||||
flag: GetFlagUrl(instance[1].flag),
|
|
||||||
health: instance[1].monitor["30dRatio"].ratio,
|
|
||||||
uri: instance[1].uri
|
|
||||||
})
|
|
||||||
content.AppendChild(item)
|
content.AppendChild(item)
|
||||||
end for
|
end for
|
||||||
|
|
||||||
@@ -54,6 +47,11 @@ function FilterInstances(instances as object) as object
|
|||||||
filtered = []
|
filtered = []
|
||||||
|
|
||||||
for each instance in instances
|
for each instance in instances
|
||||||
|
if not IsArray(instance) or instance.Count() < 2
|
||||||
|
LogWarn("Invalid instance:", instance)
|
||||||
|
continue for
|
||||||
|
end if
|
||||||
|
|
||||||
flags = instance[1]
|
flags = instance[1]
|
||||||
if flags.type = "https" and flags.api = true and flags.cors = true
|
if flags.type = "https" and flags.api = true and flags.cors = true
|
||||||
filtered.Push(instance)
|
filtered.Push(instance)
|
||||||
@@ -63,12 +61,52 @@ function FilterInstances(instances as object) as object
|
|||||||
return filtered
|
return filtered
|
||||||
end function
|
end function
|
||||||
|
|
||||||
|
function CreateListItemContent(instance as object) as object
|
||||||
|
if not IsArray(instance) or instance.Count() < 2
|
||||||
|
LogWarn("Invalid instance:", instance)
|
||||||
|
return invalid
|
||||||
|
end if
|
||||||
|
|
||||||
|
item = CreateObject("roSGNode", "InvidiousPublicInstancesListItemContent")
|
||||||
|
item.setFields({
|
||||||
|
name: instance[0]
|
||||||
|
version: DrillIntoObject(instance[1], ["stats", "software", "version"], "N/A")
|
||||||
|
users: DrillIntoObject(instance[1], ["stats", "usage", "users", "total"], "N/A")
|
||||||
|
signup: DrillIntoObject(instance[1], ["stats", "openRegistrations"], false) ? "Yes" : "No"
|
||||||
|
' Leave 5 spaces for the flag, just to simplify the layout
|
||||||
|
location: ` ${DrillIntoObject(instance[1], ["region"], "N/A")}`
|
||||||
|
flag: GetFlagUrl(DrillIntoObject(instance[1], ["flag"], ""))
|
||||||
|
health: DrillIntoObject(instance[1], ["monitor", "30dRatio", "ratio"], "N/A")
|
||||||
|
uri: instance[1].uri
|
||||||
|
})
|
||||||
|
|
||||||
|
return item
|
||||||
|
end function
|
||||||
|
|
||||||
|
function DrillIntoObject(obj as object, path as object, defaultValue as dynamic) as dynamic
|
||||||
|
if obj = invalid
|
||||||
|
return defaultValue
|
||||||
|
end if
|
||||||
|
|
||||||
|
for each key in path
|
||||||
|
if obj[key] = invalid
|
||||||
|
return defaultValue
|
||||||
|
end if
|
||||||
|
obj = obj[key]
|
||||||
|
end for
|
||||||
|
|
||||||
|
return obj
|
||||||
|
end function
|
||||||
|
|
||||||
function GetFlagUrl(flag as string) as string
|
function GetFlagUrl(flag as string) as string
|
||||||
codePoint = emojiToCodePoint(flag)
|
if flag = ""
|
||||||
|
return ""
|
||||||
|
end if
|
||||||
|
codePoint = EmojiToCodePoint(flag)
|
||||||
return `https://github.githubassets.com/images/icons/emoji/unicode/${codePoint}.png?v8`
|
return `https://github.githubassets.com/images/icons/emoji/unicode/${codePoint}.png?v8`
|
||||||
end function
|
end function
|
||||||
|
|
||||||
function emojiToCodePoint(emoji as string) as string
|
function EmojiToCodePoint(emoji as string) as string
|
||||||
codes = []
|
codes = []
|
||||||
chars = emoji.Split("")
|
chars = emoji.Split("")
|
||||||
for i = 0 to chars.count() - 1
|
for i = 0 to chars.count() - 1
|
||||||
|
|||||||
@@ -8,9 +8,9 @@ function Init()
|
|||||||
m.scrollAnimation = m.top.findNode("scrollAnimation")
|
m.scrollAnimation = m.top.findNode("scrollAnimation")
|
||||||
m.scrollAnimationInterpolator = m.scrollAnimation.findNode("scrollAnimationInterpolator")
|
m.scrollAnimationInterpolator = m.scrollAnimation.findNode("scrollAnimationInterpolator")
|
||||||
m.viewport = {
|
m.viewport = {
|
||||||
x: 150,
|
x: 150
|
||||||
y: 96,
|
y: 96
|
||||||
width: 1920,
|
width: 1920
|
||||||
height: 550
|
height: 550
|
||||||
}
|
}
|
||||||
end function
|
end function
|
||||||
@@ -75,7 +75,7 @@ function CreateCategoryNode(item as object, container as object, startX as integ
|
|||||||
node.displayText = item.displayText
|
node.displayText = item.displayText
|
||||||
node.description = item.description
|
node.description = item.description
|
||||||
return {
|
return {
|
||||||
node: node,
|
node: node
|
||||||
rect: node.boundingRect()
|
rect: node.boundingRect()
|
||||||
}
|
}
|
||||||
end function
|
end function
|
||||||
@@ -107,11 +107,11 @@ function CreateControls(item as object, container as object, startX as integer,
|
|||||||
end for
|
end for
|
||||||
|
|
||||||
return {
|
return {
|
||||||
nodes: nodes,
|
nodes: nodes
|
||||||
rect: {
|
rect: {
|
||||||
x: x,
|
x: x
|
||||||
y: y,
|
y: y
|
||||||
width: width,
|
width: width
|
||||||
height: height
|
height: height
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -142,7 +142,7 @@ function CreateControl(item as object, container as object, startX as integer, s
|
|||||||
control@.BindPreference(m.preferences, item.key)
|
control@.BindPreference(m.preferences, item.key)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
node: control,
|
node: control
|
||||||
rect: control.boundingRect()
|
rect: control.boundingRect()
|
||||||
}
|
}
|
||||||
end function
|
end function
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import "pkg:/components/Dialog/DialogPalette.bs"
|
||||||
import "pkg:/source/utils/FocusManagement.bs"
|
import "pkg:/source/utils/FocusManagement.bs"
|
||||||
import "pkg:/source/utils/Types.bs"
|
import "pkg:/source/utils/Types.bs"
|
||||||
|
|
||||||
@@ -65,6 +66,7 @@ end function
|
|||||||
|
|
||||||
function ShowEditKeyboard()
|
function ShowEditKeyboard()
|
||||||
keyboardDialog = createObject("roSGNode", "StandardKeyboardDialog")
|
keyboardDialog = createObject("roSGNode", "StandardKeyboardDialog")
|
||||||
|
SetPalette(keyboardDialog)
|
||||||
keyboardDialog.title = m.top.displayText
|
keyboardDialog.title = m.top.displayText
|
||||||
keyboardDialog.message = [m.top.description]
|
keyboardDialog.message = [m.top.description]
|
||||||
keyboardDialog.text = m.top.value
|
keyboardDialog.text = m.top.value
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import "pkg:/components/Screens/WebAppScreen/GenerateQrCodeTask.bs"
|
import "pkg:/source/AsyncTask/AsyncTask.bs"
|
||||||
import "pkg:/source/asyncTask/asyncTask.bs"
|
import "pkg:/source/AsyncTask/Tasks.bs"
|
||||||
import "pkg:/source/utils/StringUtils.bs"
|
import "pkg:/source/utils/StringUtils.bs"
|
||||||
|
|
||||||
function Init()
|
function Init()
|
||||||
@@ -22,10 +22,10 @@ function OnUrlSet()
|
|||||||
urlLabel.text = url
|
urlLabel.text = url
|
||||||
|
|
||||||
qrCodePoster = m.top.findNode("QrCodePoster")
|
qrCodePoster = m.top.findNode("QrCodePoster")
|
||||||
StartAsyncTask(GenerateQrCodeTask, {
|
AsyncTask.Start(Tasks.GenerateQrCodeTask, {
|
||||||
poster: qrCodePoster,
|
poster: qrCodePoster
|
||||||
text: url,
|
text: url
|
||||||
size: qrCodePoster.loadWidth,
|
size: qrCodePoster.loadWidth
|
||||||
padding: 20
|
padding: 20
|
||||||
})
|
})
|
||||||
end function
|
end function
|
||||||
@@ -1,29 +1,28 @@
|
|||||||
import "LatestLibVersionTask.bs"
|
import "pkg:/source/AsyncTask/AsyncTask.bs"
|
||||||
import "pkg:/source/asyncTask/asyncTask.bs"
|
import "pkg:/source/AsyncTask/Tasks.bs"
|
||||||
|
|
||||||
import "pkg:/source/services/ApplicationInfo.bs"
|
import "pkg:/source/services/ApplicationInfo.bs"
|
||||||
|
|
||||||
function Init()
|
function Init()
|
||||||
m.service = new ApplicationInfo(m.top)
|
m.service = new ApplicationInfo(m.top)
|
||||||
end function
|
end function
|
||||||
|
|
||||||
function GetAppInfo(unused as dynamic) as object
|
function GetAppInfo(_unused as dynamic) as object
|
||||||
return m.service.GetAppInfo()
|
return m.service.GetAppInfo()
|
||||||
end function
|
end function
|
||||||
|
|
||||||
function GetDeviceInfo(unused as dynamic) as object
|
function GetDeviceInfo(_unused as dynamic) as object
|
||||||
return m.service.GetDeviceInfo()
|
return m.service.GetDeviceInfo()
|
||||||
end function
|
end function
|
||||||
|
|
||||||
function GetUserCountryCode(unused as dynamic) as string
|
function GetUserCountryCode(_unused as dynamic) as string
|
||||||
return m.service.GetUserCountryCode()
|
return m.service.GetUserCountryCode()
|
||||||
end function
|
end function
|
||||||
|
|
||||||
function GetLocalIpAddress(unused as dynamic) as dynamic
|
function GetLocalIpAddress(_unused as dynamic) as dynamic
|
||||||
return m.service.GetLocalIpAddress()
|
return m.service.GetLocalIpAddress()
|
||||||
end function
|
end function
|
||||||
|
|
||||||
function GetLatestPlayletLibVersion(unused as dynamic) as dynamic
|
function GetLatestPlayletLibVersion(_unused as dynamic) as dynamic
|
||||||
if not StringUtils.IsNullOrEmpty(m.top.lib_version_latest)
|
if not StringUtils.IsNullOrEmpty(m.top.lib_version_latest)
|
||||||
return m.top.lib_version_latest
|
return m.top.lib_version_latest
|
||||||
end if
|
end if
|
||||||
@@ -32,7 +31,7 @@ function GetLatestPlayletLibVersion(unused as dynamic) as dynamic
|
|||||||
return invalid
|
return invalid
|
||||||
end if
|
end if
|
||||||
|
|
||||||
m.latestLibVersionTask = StartAsyncTask(LatestLibVersionTask, {}, function(output as object) as void
|
m.latestLibVersionTask = AsyncTask.Start(Tasks.LatestLibVersionTask, {}, function(output as object) as void
|
||||||
m.latestLibVersionTask = invalid
|
m.latestLibVersionTask = invalid
|
||||||
if output.success and output.result.latest <> invalid
|
if output.success and output.result.latest <> invalid
|
||||||
m.top.lib_version_latest = output.result.latest
|
m.top.lib_version_latest = output.result.latest
|
||||||
|
|||||||
@@ -53,18 +53,18 @@ function Save() as void
|
|||||||
bookmarkNodes = bookmarkGroupNode.getChildren(-1, 0)
|
bookmarkNodes = bookmarkGroupNode.getChildren(-1, 0)
|
||||||
for each bookmarkNode in bookmarkNodes
|
for each bookmarkNode in bookmarkNodes
|
||||||
bookmarks.push({
|
bookmarks.push({
|
||||||
"id": bookmarkNode.id,
|
"id": bookmarkNode.id
|
||||||
"feedSource": bookmarkNode.feedSource
|
"feedSource": bookmarkNode.feedSource
|
||||||
})
|
})
|
||||||
end for
|
end for
|
||||||
groups.push({
|
groups.push({
|
||||||
"title": bookmarkGroupNode.title,
|
"title": bookmarkGroupNode.title
|
||||||
"bookmarks": bookmarks
|
"bookmarks": bookmarks
|
||||||
})
|
})
|
||||||
end for
|
end for
|
||||||
|
|
||||||
bookmarksString = FormatJson({
|
bookmarksString = FormatJson({
|
||||||
"__version": m.top.__version,
|
"__version": m.top.__version
|
||||||
"groups": groups
|
"groups": groups
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -110,8 +110,8 @@ function AddVideoBookmark(id as string, groupName as string)
|
|||||||
bookmarkGroupNode = GetOrCreateBookmarkGroup(groupName)
|
bookmarkGroupNode = GetOrCreateBookmarkGroup(groupName)
|
||||||
|
|
||||||
feedSource = {
|
feedSource = {
|
||||||
"apiType": "Invidious",
|
"apiType": "Invidious"
|
||||||
"endpoint": "video_info",
|
"endpoint": "video_info"
|
||||||
"pathParams": {
|
"pathParams": {
|
||||||
"id": id
|
"id": id
|
||||||
}
|
}
|
||||||
@@ -123,8 +123,8 @@ function AddPlaylistBookmark(id as string, groupName as string)
|
|||||||
bookmarkGroupNode = GetOrCreateBookmarkGroup(groupName)
|
bookmarkGroupNode = GetOrCreateBookmarkGroup(groupName)
|
||||||
|
|
||||||
feedSource = {
|
feedSource = {
|
||||||
"apiType": "Invidious",
|
"apiType": "Invidious"
|
||||||
"endpoint": "playlist_info",
|
"endpoint": "playlist_info"
|
||||||
"pathParams": {
|
"pathParams": {
|
||||||
"plid": id
|
"plid": id
|
||||||
}
|
}
|
||||||
@@ -136,10 +136,10 @@ function AddPlaylistBookmarkWithSpread(id as string, groupName as string)
|
|||||||
bookmarkGroupNode = GetOrCreateBookmarkGroup(groupName)
|
bookmarkGroupNode = GetOrCreateBookmarkGroup(groupName)
|
||||||
|
|
||||||
feedSource = {
|
feedSource = {
|
||||||
"id": `inv_playlist_${id}`,
|
"id": `inv_playlist_${id}`
|
||||||
"title": `${groupName} videos`,
|
"title": `${groupName} videos`
|
||||||
"apiType": "Invidious",
|
"apiType": "Invidious"
|
||||||
"endpoint": "playlist",
|
"endpoint": "playlist"
|
||||||
"pathParams": {
|
"pathParams": {
|
||||||
"plid": id
|
"plid": id
|
||||||
}
|
}
|
||||||
@@ -147,8 +147,8 @@ function AddPlaylistBookmarkWithSpread(id as string, groupName as string)
|
|||||||
AddFeedSourceBookmark(feedSource, `inv_playlist_${id}`, bookmarkGroupNode)
|
AddFeedSourceBookmark(feedSource, `inv_playlist_${id}`, bookmarkGroupNode)
|
||||||
|
|
||||||
feedSource = {
|
feedSource = {
|
||||||
"apiType": "Invidious",
|
"apiType": "Invidious"
|
||||||
"endpoint": "playlist_info",
|
"endpoint": "playlist_info"
|
||||||
"pathParams": {
|
"pathParams": {
|
||||||
"plid": id
|
"plid": id
|
||||||
}
|
}
|
||||||
@@ -160,8 +160,8 @@ function AddChannelBookmark(id as string, groupName as string)
|
|||||||
bookmarkGroupNode = GetOrCreateBookmarkGroup(groupName)
|
bookmarkGroupNode = GetOrCreateBookmarkGroup(groupName)
|
||||||
|
|
||||||
feedSource = {
|
feedSource = {
|
||||||
"apiType": "Invidious",
|
"apiType": "Invidious"
|
||||||
"endpoint": "channel_info",
|
"endpoint": "channel_info"
|
||||||
"pathParams": {
|
"pathParams": {
|
||||||
"ucid": id
|
"ucid": id
|
||||||
}
|
}
|
||||||
@@ -173,10 +173,10 @@ function AddChannelBookmarkWithSpread(id as string, groupName as string)
|
|||||||
bookmarkGroupNode = GetOrCreateBookmarkGroup(groupName)
|
bookmarkGroupNode = GetOrCreateBookmarkGroup(groupName)
|
||||||
|
|
||||||
feedSource = {
|
feedSource = {
|
||||||
"id": `inv_channel_videos_${id}`,
|
"id": `inv_channel_videos_${id}`
|
||||||
"title": `${groupName} videos`,
|
"title": `${groupName} videos`
|
||||||
"apiType": "Invidious",
|
"apiType": "Invidious"
|
||||||
"endpoint": "channel_videos",
|
"endpoint": "channel_videos"
|
||||||
"pathParams": {
|
"pathParams": {
|
||||||
"ucid": id
|
"ucid": id
|
||||||
}
|
}
|
||||||
@@ -184,8 +184,8 @@ function AddChannelBookmarkWithSpread(id as string, groupName as string)
|
|||||||
AddFeedSourceBookmark(feedSource, `inv_channel_videos_${id}`, bookmarkGroupNode)
|
AddFeedSourceBookmark(feedSource, `inv_channel_videos_${id}`, bookmarkGroupNode)
|
||||||
|
|
||||||
feedSource = {
|
feedSource = {
|
||||||
"apiType": "Invidious",
|
"apiType": "Invidious"
|
||||||
"endpoint": "channel_info",
|
"endpoint": "channel_info"
|
||||||
"pathParams": {
|
"pathParams": {
|
||||||
"ucid": id
|
"ucid": id
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,10 +34,10 @@ class DashManifest
|
|||||||
xml = new XmlObject()
|
xml = new XmlObject()
|
||||||
|
|
||||||
if xml.Node("MPD", {
|
if xml.Node("MPD", {
|
||||||
"xmlns": "urn:mpeg:dash:schema:mpd:2011",
|
"xmlns": "urn:mpeg:dash:schema:mpd:2011"
|
||||||
"profiles": "urn:mpeg:dash:profile:full:2011",
|
"profiles": "urn:mpeg:dash:profile:full:2011"
|
||||||
"minBufferTime": "PT1.5S",
|
"minBufferTime": "PT1.5S"
|
||||||
"type": "static",
|
"type": "static"
|
||||||
"mediaPresentationDuration": `PT${metadata.lengthSeconds ?? 0}S`
|
"mediaPresentationDuration": `PT${metadata.lengthSeconds ?? 0}S`
|
||||||
})
|
})
|
||||||
if xml.Node("Period")
|
if xml.Node("Period")
|
||||||
@@ -45,9 +45,9 @@ class DashManifest
|
|||||||
id = 0
|
id = 0
|
||||||
for each audioSet in audioSets
|
for each audioSet in audioSets
|
||||||
adaptationSetAttributes = {
|
adaptationSetAttributes = {
|
||||||
"id": `${id}`,
|
"id": `${id}`
|
||||||
"mimeType": audioSet.mimeType,
|
"mimeType": audioSet.mimeType
|
||||||
"startWithSAP": "1",
|
"startWithSAP": "1"
|
||||||
"subsegmentAlignment": "true"
|
"subsegmentAlignment": "true"
|
||||||
}
|
}
|
||||||
if not StringUtils.IsNullOrEmpty(audioSet.lang)
|
if not StringUtils.IsNullOrEmpty(audioSet.lang)
|
||||||
@@ -56,7 +56,7 @@ class DashManifest
|
|||||||
|
|
||||||
if xml.Node("AdaptationSet", adaptationSetAttributes)
|
if xml.Node("AdaptationSet", adaptationSetAttributes)
|
||||||
xml.Node("Role", {
|
xml.Node("Role", {
|
||||||
"schemeIdUri": "urn:mpeg:dash:role:2011",
|
"schemeIdUri": "urn:mpeg:dash:role:2011"
|
||||||
"value": audioSet.acont = "original" ? "main" : "alternate"
|
"value": audioSet.acont = "original" ? "main" : "alternate"
|
||||||
})
|
})
|
||||||
xml.End()
|
xml.End()
|
||||||
@@ -77,13 +77,13 @@ class DashManifest
|
|||||||
end if
|
end if
|
||||||
|
|
||||||
if xml.Node("Representation", {
|
if xml.Node("Representation", {
|
||||||
"id": stream.itag,
|
"id": stream.itag
|
||||||
"codecs": codecs,
|
"codecs": codecs
|
||||||
"bandwidth": stream.bitrate
|
"bandwidth": stream.bitrate
|
||||||
})
|
})
|
||||||
|
|
||||||
xml.Node("AudioChannelConfiguration", {
|
xml.Node("AudioChannelConfiguration", {
|
||||||
"schemeIdUri": "urn:mpeg:dash:23003:3:audio_channel_configuration:2011",
|
"schemeIdUri": "urn:mpeg:dash:23003:3:audio_channel_configuration:2011"
|
||||||
"value": `${stream.audioChannels}`
|
"value": `${stream.audioChannels}`
|
||||||
})
|
})
|
||||||
xml.End()
|
xml.End()
|
||||||
@@ -115,9 +115,9 @@ class DashManifest
|
|||||||
|
|
||||||
for each mimeType in videoMimeTypes
|
for each mimeType in videoMimeTypes
|
||||||
if xml.Node("AdaptationSet", {
|
if xml.Node("AdaptationSet", {
|
||||||
"id": `${id}`,
|
"id": `${id}`
|
||||||
"mimeType": mimeType,
|
"mimeType": mimeType
|
||||||
"startWithSAP": "1",
|
"startWithSAP": "1"
|
||||||
"subsegmentAlignment": "true"
|
"subsegmentAlignment": "true"
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -137,10 +137,10 @@ class DashManifest
|
|||||||
end if
|
end if
|
||||||
|
|
||||||
representationAttributes = {
|
representationAttributes = {
|
||||||
"id": stream.itag,
|
"id": stream.itag
|
||||||
"codecs": codecs,
|
"codecs": codecs
|
||||||
"startWithSAP": "1",
|
"startWithSAP": "1"
|
||||||
"maxPlayoutRate": "1",
|
"maxPlayoutRate": "1"
|
||||||
"bandwidth": stream.bitrate
|
"bandwidth": stream.bitrate
|
||||||
}
|
}
|
||||||
if stream.width <> invalid
|
if stream.width <> invalid
|
||||||
@@ -226,26 +226,26 @@ class DashManifest
|
|||||||
bandwidth = ((storyboardWidthInPixels * storyboardHeightInPixels * 0.5) / duration)
|
bandwidth = ((storyboardWidthInPixels * storyboardHeightInPixels * 0.5) / duration)
|
||||||
|
|
||||||
if xml.Node("AdaptationSet", {
|
if xml.Node("AdaptationSet", {
|
||||||
"id": `${id}`,
|
"id": `${id}`
|
||||||
"mimeType": "image/jpeg",
|
"mimeType": "image/jpeg"
|
||||||
"contentType": "image"
|
"contentType": "image"
|
||||||
})
|
})
|
||||||
xml.Node("SegmentTemplate", {
|
xml.Node("SegmentTemplate", {
|
||||||
"media": url,
|
"media": url
|
||||||
"duration": duration,
|
"duration": duration
|
||||||
"startNumber": 0
|
"startNumber": 0
|
||||||
})
|
})
|
||||||
xml.End()
|
xml.End()
|
||||||
|
|
||||||
if xml.Node("Representation", {
|
if xml.Node("Representation", {
|
||||||
"id": `thumbnails_${id}`,
|
"id": `thumbnails_${id}`
|
||||||
"bandwidth": bandwidth,
|
"bandwidth": bandwidth
|
||||||
"width": storyboardWidthInPixels,
|
"width": storyboardWidthInPixels
|
||||||
"height": storyboardHeightInPixels
|
"height": storyboardHeightInPixels
|
||||||
})
|
})
|
||||||
|
|
||||||
xml.Node("EssentialProperty", {
|
xml.Node("EssentialProperty", {
|
||||||
"schemeIdUri": "http://dashif.org/guidelines/thumbnail_tile",
|
"schemeIdUri": "http://dashif.org/guidelines/thumbnail_tile"
|
||||||
"value": `${storyboardWidth}x${storyboardHeight}`
|
"value": `${storyboardWidth}x${storyboardHeight}`
|
||||||
})
|
})
|
||||||
xml.End()
|
xml.End()
|
||||||
@@ -334,8 +334,8 @@ class DashManifest
|
|||||||
stream = streams[i]
|
stream = streams[i]
|
||||||
mimeType = stream.type.Tokenize(";")[0]
|
mimeType = stream.type.Tokenize(";")[0]
|
||||||
types[`${mimeType}-${stream.languageInfo.lang}-${stream.languageInfo.acont}`] = {
|
types[`${mimeType}-${stream.languageInfo.lang}-${stream.languageInfo.acont}`] = {
|
||||||
"mimeType": mimeType,
|
"mimeType": mimeType
|
||||||
"lang": stream.languageInfo.lang,
|
"lang": stream.languageInfo.lang
|
||||||
"acont": stream.languageInfo.acont
|
"acont": stream.languageInfo.acont
|
||||||
}
|
}
|
||||||
end for
|
end for
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import "InvidiousService.bs"
|
import "InvidiousService.bs"
|
||||||
import "InvidiousSubscriptionsTask.bs"
|
import "pkg:/source/AsyncTask/AsyncTask.bs"
|
||||||
import "pkg:/source/asyncTask/asyncTask.bs"
|
import "pkg:/source/AsyncTask/Tasks.bs"
|
||||||
|
|
||||||
function Init()
|
function Init()
|
||||||
m.top.apiDefinitions = ParseJson(ReadAsciiFile("libpkg:/config/invidious_video_api.yaml"))
|
m.top.apiDefinitions = ParseJson(ReadAsciiFile("libpkg:/config/invidious_video_api.yaml"))
|
||||||
@@ -8,11 +8,11 @@ function Init()
|
|||||||
m.top.authToken = m.service.GetAuthToken()
|
m.top.authToken = m.service.GetAuthToken()
|
||||||
end function
|
end function
|
||||||
|
|
||||||
function GetCurrentInstance(unused as dynamic) as string
|
function GetCurrentInstance(_unused as dynamic) as string
|
||||||
return m.service.GetInstance()
|
return m.service.GetInstance()
|
||||||
end function
|
end function
|
||||||
|
|
||||||
function GetAuthorizeTokenLink(unused as dynamic) as dynamic
|
function GetAuthorizeTokenLink(_unused as dynamic) as dynamic
|
||||||
return m.service.GetAuthorizeTokenLink()
|
return m.service.GetAuthorizeTokenLink()
|
||||||
end function
|
end function
|
||||||
|
|
||||||
@@ -32,5 +32,5 @@ function GetSubscriptions() as void
|
|||||||
m.top.subscriptions = invalid
|
m.top.subscriptions = invalid
|
||||||
return
|
return
|
||||||
end if
|
end if
|
||||||
m.subscriptionsTask = StartAsyncTask(InvidiousSubscriptionsTask, { invidious: m.top })
|
m.subscriptionsTask = AsyncTask.Start(Tasks.InvidiousSubscriptionsTask, { invidious: m.top })
|
||||||
end function
|
end function
|
||||||
@@ -1,4 +1,7 @@
|
|||||||
|
import "pkg:/components/Dialog/DialogUtils.bs"
|
||||||
import "pkg:/components/VideoFeed/PaginationType.bs"
|
import "pkg:/components/VideoFeed/PaginationType.bs"
|
||||||
|
import "pkg:/source/AsyncTask/AsyncTask.bs"
|
||||||
|
import "pkg:/source/AsyncTask/Tasks.bs"
|
||||||
import "pkg:/source/services/HttpClient.bs"
|
import "pkg:/source/services/HttpClient.bs"
|
||||||
import "pkg:/source/utils/CryptoUtils.bs"
|
import "pkg:/source/utils/CryptoUtils.bs"
|
||||||
import "pkg:/source/utils/Logging.bs"
|
import "pkg:/source/utils/Logging.bs"
|
||||||
@@ -22,7 +25,7 @@ namespace Invidious
|
|||||||
|
|
||||||
const SEARCH_SUGGEST_ENDPOINT = "/api/v1/search/suggestions"
|
const SEARCH_SUGGEST_ENDPOINT = "/api/v1/search/suggestions"
|
||||||
|
|
||||||
const AUTH_SCOPES = "GET:feed,GET:playlists*,POST:tokens/*,POST:history*,:subscriptions*"
|
const AUTH_SCOPES = "GET:feed,GET:playlists*,POST:tokens/*,:history*,:subscriptions*"
|
||||||
|
|
||||||
const AUTH_PLAYLISTS = "/api/v1/auth/playlists"
|
const AUTH_PLAYLISTS = "/api/v1/auth/playlists"
|
||||||
const AUTH_SUBSCRIPTIONS = "/api/v1/auth/subscriptions"
|
const AUTH_SUBSCRIPTIONS = "/api/v1/auth/subscriptions"
|
||||||
@@ -41,16 +44,16 @@ namespace Invidious
|
|||||||
|
|
||||||
m.endpoints = node.apiDefinitions
|
m.endpoints = node.apiDefinitions
|
||||||
|
|
||||||
m.responseHanlders = {
|
m.responseHandlers = {
|
||||||
DefaultHandler: m.DefaultHandler,
|
DefaultHandler: m.DefaultHandler
|
||||||
AuthFeedHandler: m.AuthFeedHandler,
|
AuthFeedHandler: m.AuthFeedHandler
|
||||||
PlaylistHandler: m.PlaylistHandler,
|
PlaylistHandler: m.PlaylistHandler
|
||||||
VideoInfoHandler: m.VideoInfoHandler,
|
VideoInfoHandler: m.VideoInfoHandler
|
||||||
PlaylistInfoHandler: m.PlaylistInfoHandler,
|
PlaylistInfoHandler: m.PlaylistInfoHandler
|
||||||
ChannelInfoHandler: m.ChannelInfoHandler,
|
ChannelInfoHandler: m.ChannelInfoHandler
|
||||||
ChannelVideosHandler: m.ChannelVideosHandler,
|
ChannelVideosHandler: m.ChannelVideosHandler
|
||||||
ChannelPlaylistsHandler: m.ChannelPlaylistsHandler,
|
ChannelPlaylistsHandler: m.ChannelPlaylistsHandler
|
||||||
ChannelRelatedChannelsHandler: m.ChannelRelatedChannelsHandler
|
WatchHistoryHandler: m.WatchHistoryHandler
|
||||||
}
|
}
|
||||||
end function
|
end function
|
||||||
|
|
||||||
@@ -119,6 +122,21 @@ namespace Invidious
|
|||||||
request.CacheSeconds(60 * 60 * 5)
|
request.CacheSeconds(60 * 60 * 5)
|
||||||
request.Cancellation(cancellation)
|
request.Cancellation(cancellation)
|
||||||
|
|
||||||
|
request.TryCount(2)
|
||||||
|
request.RetryCallback(function(context as object) as boolean
|
||||||
|
response = context.response
|
||||||
|
' In some cases, video info requests return "HTTP/0.9 when not allowed" errors.
|
||||||
|
' Retrying should usually fix the issue.
|
||||||
|
if response.StatusCode() = HttpClient.CurlErrors.CURLE_UNSUPPORTED_PROTOCOL
|
||||||
|
errorMessage = response.ErrorMessage()
|
||||||
|
if errorMessage.Contains("HTTP/0.9")
|
||||||
|
return true
|
||||||
|
end if
|
||||||
|
end if
|
||||||
|
|
||||||
|
return false
|
||||||
|
end function)
|
||||||
|
|
||||||
return request.Await()
|
return request.Await()
|
||||||
end function
|
end function
|
||||||
|
|
||||||
@@ -154,9 +172,13 @@ namespace Invidious
|
|||||||
return request.Await()
|
return request.Await()
|
||||||
end function
|
end function
|
||||||
|
|
||||||
function GetVideoStreamUrl(videoId as string) as string
|
function GetVideoStreamUrl(videoId as string, itag = invalid as dynamic) as string
|
||||||
instance = m.GetInstance()
|
instance = m.GetInstance()
|
||||||
return `${instance}/latest_version?id=${videoId}`
|
url = `${instance}/latest_version?id=${videoId}`
|
||||||
|
if itag <> invalid
|
||||||
|
url = `${url}&itag=${itag}`
|
||||||
|
end if
|
||||||
|
return url
|
||||||
end function
|
end function
|
||||||
|
|
||||||
function MarkFeedPagination(feedContentNode as object) as object
|
function MarkFeedPagination(feedContentNode as object) as object
|
||||||
@@ -201,7 +223,7 @@ namespace Invidious
|
|||||||
endpoint = m.endpoints[feedSource.endpoint]
|
endpoint = m.endpoints[feedSource.endpoint]
|
||||||
if endpoint = invalid
|
if endpoint = invalid
|
||||||
return {
|
return {
|
||||||
success: false,
|
success: false
|
||||||
error: `Endpoint ${feedSource.endpoint} not found`
|
error: `Endpoint ${feedSource.endpoint} not found`
|
||||||
}
|
}
|
||||||
end if
|
end if
|
||||||
@@ -214,7 +236,7 @@ namespace Invidious
|
|||||||
authToken = m.node.authToken
|
authToken = m.node.authToken
|
||||||
if authToken = invalid
|
if authToken = invalid
|
||||||
return {
|
return {
|
||||||
success: false,
|
success: false
|
||||||
error: ERROR_NOT_AUTHENTICATED
|
error: ERROR_NOT_AUTHENTICATED
|
||||||
}
|
}
|
||||||
end if
|
end if
|
||||||
@@ -269,18 +291,18 @@ namespace Invidious
|
|||||||
|
|
||||||
response = request.Await()
|
response = request.Await()
|
||||||
|
|
||||||
responseHandler = endpoint.responseHandler <> invalid ? m.responseHanlders[endpoint.responseHandler] : m.responseHanlders["DefaultHandler"]
|
responseHandler = endpoint.responseHandler <> invalid ? m.responseHandlers[endpoint.responseHandler] : m.responseHandlers["DefaultHandler"]
|
||||||
|
|
||||||
result = responseHandler(m, feedSource, response)
|
result = responseHandler(m, feedSource, response)
|
||||||
|
|
||||||
if response.IsSuccess() and result <> invalid
|
if response.IsSuccess() and result <> invalid
|
||||||
return {
|
return {
|
||||||
success: true,
|
success: true
|
||||||
result: result
|
result: result
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return {
|
return {
|
||||||
success: false,
|
success: false
|
||||||
error: response.ErrorMessage()
|
error: response.ErrorMessage()
|
||||||
}
|
}
|
||||||
end if
|
end if
|
||||||
@@ -310,7 +332,7 @@ namespace Invidious
|
|||||||
if response.StatusCode() = 200
|
if response.StatusCode() = 200
|
||||||
json = response.Json()
|
json = response.Json()
|
||||||
return {
|
return {
|
||||||
items: json.videos,
|
items: json.videos
|
||||||
continuation: json.continuation
|
continuation: json.continuation
|
||||||
}
|
}
|
||||||
end if
|
end if
|
||||||
@@ -321,18 +343,7 @@ namespace Invidious
|
|||||||
if response.StatusCode() = 200
|
if response.StatusCode() = 200
|
||||||
json = response.Json()
|
json = response.Json()
|
||||||
return {
|
return {
|
||||||
items: json.playlists,
|
items: json.playlists
|
||||||
continuation: json.continuation
|
|
||||||
}
|
|
||||||
end if
|
|
||||||
return invalid
|
|
||||||
end function
|
|
||||||
|
|
||||||
function ChannelRelatedChannelsHandler(m as object, feedSource as object, response as object) as object
|
|
||||||
if response.StatusCode() = 200
|
|
||||||
json = response.Json()
|
|
||||||
return {
|
|
||||||
items: json.relatedChannels,
|
|
||||||
continuation: json.continuation
|
continuation: json.continuation
|
||||||
}
|
}
|
||||||
end if
|
end if
|
||||||
@@ -340,13 +351,31 @@ namespace Invidious
|
|||||||
end function
|
end function
|
||||||
|
|
||||||
function VideoInfoHandler(m as object, feedSource as object, response as object) as object
|
function VideoInfoHandler(m as object, feedSource as object, response as object) as object
|
||||||
if response.StatusCode() = 200
|
statusCode = response.StatusCode()
|
||||||
|
if statusCode >= 500
|
||||||
|
' In some cases, such as a video became private, or a live stream ended,
|
||||||
|
' Invidious returns a 500 error. We can in this case return a valid response
|
||||||
|
' with just a video id, which will allow us to show a valid thumbnail if possible.
|
||||||
|
' This is to makes it possible to load a bookmarked video and delete it even if
|
||||||
|
' it is no longer valid.
|
||||||
|
' TODO:P2 access to private property
|
||||||
|
response._statusCode = 200
|
||||||
|
return {
|
||||||
|
items: [{
|
||||||
|
"videoId": feedSource.pathParams.id
|
||||||
|
"type": "video"
|
||||||
|
}]
|
||||||
|
}
|
||||||
|
end if
|
||||||
|
|
||||||
|
if statusCode = 200
|
||||||
json = response.Json()
|
json = response.Json()
|
||||||
json.type = "video"
|
json.type = "video"
|
||||||
return {
|
return {
|
||||||
items: [json]
|
items: [json]
|
||||||
}
|
}
|
||||||
end if
|
end if
|
||||||
|
|
||||||
return invalid
|
return invalid
|
||||||
end function
|
end function
|
||||||
|
|
||||||
@@ -399,6 +428,31 @@ namespace Invidious
|
|||||||
}
|
}
|
||||||
end function
|
end function
|
||||||
|
|
||||||
|
function WatchHistoryHandler(m as object, feedSource as object, response as object) as object
|
||||||
|
m.DeleteExpiredToken(response)
|
||||||
|
|
||||||
|
if response.StatusCode() <> 200
|
||||||
|
return invalid
|
||||||
|
end if
|
||||||
|
|
||||||
|
json = response.Json()
|
||||||
|
if json = invalid
|
||||||
|
return invalid
|
||||||
|
end if
|
||||||
|
|
||||||
|
videos = []
|
||||||
|
for each item in json
|
||||||
|
videos.push({
|
||||||
|
"type": "video"
|
||||||
|
"videoId": item
|
||||||
|
})
|
||||||
|
end for
|
||||||
|
|
||||||
|
return {
|
||||||
|
items: videos
|
||||||
|
}
|
||||||
|
end function
|
||||||
|
|
||||||
function DeleteExpiredToken(response as object)
|
function DeleteExpiredToken(response as object)
|
||||||
if response.StatusCode() = 403
|
if response.StatusCode() = 403
|
||||||
LogWarn(`Invidious instance responded with 403: ${response.Text()}`)
|
LogWarn(`Invidious instance responded with 403: ${response.Text()}`)
|
||||||
@@ -418,12 +472,18 @@ namespace Invidious
|
|||||||
return invalid
|
return invalid
|
||||||
end if
|
end if
|
||||||
if not m.VerifyTokenScope(authToken.token)
|
if not m.VerifyTokenScope(authToken.token)
|
||||||
' TODO:P1 automatically logging out the user is not a good experience
|
' Right now we're probably in a UI thread, and we can't unregister the token
|
||||||
' We can at least show a message to the user on why they are logged out
|
' Without a Task
|
||||||
' TODO:P2 right now we're probably in a UI thread, and we can't unregister the token
|
AsyncTask.Start(Tasks.InvidiousUnregisterTokenTask, {
|
||||||
' So we're just going to ignore it for now
|
invidious: m.node
|
||||||
' m.UnregisterToken(authToken)
|
authToken: authToken
|
||||||
|
})
|
||||||
RegistryUtils.Delete(RegistryUtils.INVIDIOUS_TOKEN)
|
RegistryUtils.Delete(RegistryUtils.INVIDIOUS_TOKEN)
|
||||||
|
message = `It looks like you are logged in to Invidious, but your access token does not have the required permissions.
|
||||||
|
For that reason, we have logged you out. Please log in again.
|
||||||
|
This can happen when Playlet is updated with new features.
|
||||||
|
We apologize for the inconvenience.`
|
||||||
|
DialogUtils.ShowDialog(message, "User logged out")
|
||||||
return invalid
|
return invalid
|
||||||
end if
|
end if
|
||||||
return authToken
|
return authToken
|
||||||
@@ -431,8 +491,8 @@ namespace Invidious
|
|||||||
|
|
||||||
function SetAuthToken(token as string, instance as string, username as dynamic)
|
function SetAuthToken(token as string, instance as string, username as dynamic)
|
||||||
obj = {
|
obj = {
|
||||||
token: token,
|
token: token
|
||||||
instance: instance,
|
instance: instance
|
||||||
username: username
|
username: username
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ function InvidiousSubscriptionsTask(input as object) as object
|
|||||||
LogError("Error getting subscriptions:", error)
|
LogError("Error getting subscriptions:", error)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
success: false,
|
success: false
|
||||||
error: response.ErrorMessage()
|
error: response.ErrorMessage()
|
||||||
}
|
}
|
||||||
end if
|
end if
|
||||||
|
|||||||