Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
436078bdf8 | ||
|
|
20120538e4 | ||
|
|
eec4101d29 | ||
|
|
b135ba2a0a | ||
|
|
9c9f24cb39 | ||
|
|
6aeb4bc8b9 | ||
|
|
4beb7fbf3c | ||
|
|
4f3512023f | ||
|
|
f38115171b | ||
|
|
7456917cec | ||
|
|
4482d3333f | ||
|
|
1112070f63 | ||
|
|
37dde57c67 | ||
|
|
b52cd6f01b | ||
|
|
aa5be75e06 | ||
|
|
188463c6a7 | ||
|
|
793842f4dd | ||
|
|
7ca98e7ef2 | ||
|
|
77204c4449 | ||
|
|
190548245a | ||
|
|
71f9820ed6 | ||
|
|
87e50e713f | ||
|
|
2d55569614 | ||
|
|
83a59a5e9c | ||
|
|
7d1ba07286 | ||
|
|
ec9178d687 | ||
|
|
84c6d822e2 | ||
|
|
7503c2dbd6 | ||
|
|
ca3cad4058 | ||
|
|
c7f14dfc38 | ||
|
|
ac3d1cea17 | ||
|
|
93ea822f27 | ||
|
|
d73a03d3bf | ||
|
|
45736dd8ec | ||
|
|
90565ccb07 | ||
|
|
b72173f588 | ||
|
|
2d759c1c39 | ||
|
|
11fb644fc6 | ||
|
|
b076517c1b | ||
|
|
74082f406a | ||
|
|
f3aeb58b38 | ||
|
|
44ee6681c5 | ||
|
|
85e30c8b22 | ||
|
|
80d3d24e39 | ||
|
|
a7bdab30bc | ||
|
|
3858681b80 | ||
|
|
e0cf59d90f | ||
|
|
d9b8aaa222 | ||
|
|
b1a373f98d | ||
|
|
1078459eb7 | ||
|
|
14cc537032 | ||
|
|
db755c4158 | ||
|
|
ed068f6599 | ||
|
|
45011a54f0 | ||
|
|
8c71a5be88 | ||
|
|
d059fced58 | ||
|
|
ea2be153b0 | ||
|
|
7e5b2246fa | ||
|
|
a710a23444 | ||
|
|
a3b3a143a5 | ||
|
|
1172a82a26 | ||
|
|
c002028727 | ||
|
|
3ab65587df | ||
|
|
4d4fab4e06 | ||
|
|
9cfe14e87e | ||
|
|
e80a41ca72 | ||
|
|
4e8dfe1a23 | ||
|
|
e6302e48fe | ||
|
|
7796c63291 | ||
|
|
dc148a7c59 | ||
|
|
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,118 @@ 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.20.1] - 2024-02-23
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- `Device connected` notification showing repeatedly
|
||||||
|
|
||||||
|
## [0.20.0] - 2024-02-21
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- Support for casting from the YouTube app (also known as Lounge API, or LeanBack)
|
||||||
|
- Connect to Playlet from the YouTube mobile app or from certain browsers (such as Chrome)
|
||||||
|
- Connect to Playlet from local network, or through the TV code.
|
||||||
|
- On the cast dialog in your YouTube mobile app, you might see two listings for the same device. E.g. `Roku TV` and `Playlet on Roku TV`. Use the `Playlet on` one to cast to Playlet, and the other one to cast to the regular YouTube TV app.
|
||||||
|
- The functionality is still experiemntal, and has some limitations. To name a few:
|
||||||
|
- The queue does not perfectly sync between the mobile app and Playlet, espeically if it gets modified by the web app or in Playlet.
|
||||||
|
- Many functions (such as d-pad controls or setting the volume) are not working due to OS limitations
|
||||||
|
- Many functions (such as changing the subtitle settings) are not currently implemented
|
||||||
|
- **ATTENTION**: This feature is not very privacy friendly. When connected to a lounge, all network traffic (videos played, queued, etc) go through YouTube servers. For this reason, certain measures are taken:
|
||||||
|
- While Playlet broadcasts its casting capabilities to the local network, it does not connect to a lounge for the first time until:
|
||||||
|
- A device connects to Playlet (using DIAL/Connect using Wi-Fi)
|
||||||
|
- A `Link with TV code` is generated, by visiting the `Remote` -> `Link with TV code` tab.
|
||||||
|
- Playlet disconnects from previous lounge sessions on start, and joins a new one instead of one continous session. In other words, restarting Playlet will disconnect your second device. This is a feature, not a bug.
|
||||||
|
- Playlet does not expose device details, and uses a randomly generated id on each start, instead of consistent device id.
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- The queue no longer contains playlists. When a playlist is added to the queue, the entire playlist is loaded.
|
||||||
|
- It can take a few seconds to load large playlist before it can be added to the queue
|
||||||
|
- This is done to be more compatible more the lounge, which does not contain "Playlists in the queue" concept.
|
||||||
|
- The `Web App` tab is now called `Remote`. It can be used to open the web app, or connect using Lounge (cast from YouTube)
|
||||||
|
- Removed `fields` from Invidious requests, as per [https://github.com/iv-org/invidious/pull/4276](https://github.com/iv-org/invidious/pull/4276)
|
||||||
|
- The `POST /api/queue/` no longer returns the current queue. Instead it returns a 204.
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- [Perf] improved some caching of videos in the queue
|
||||||
|
|
||||||
|
## [0.19.2] - 2024-02-11
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- [Attempt #2] to fix a crash caused by execution timeout when stopping a video takes too long
|
||||||
|
- Wrong hint on the "added to queue" notification when in fullscreen
|
||||||
|
- A rare crash when listing Invidious public instances
|
||||||
|
- Restoring video to full screen not working when on certain screens
|
||||||
|
|
||||||
|
## [0.19.1] - 2024-01-13
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- A hint on how to restore video to full screen
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Bookmarks are now added to the top of the list
|
||||||
|
- The search screen keyboard to make it easier to clear the search field
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- A bug with request retry mechanism introduced in 0.19.0
|
||||||
|
|
||||||
|
## [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
|
||||||
@@ -283,7 +395,7 @@ This version went through a major refactor, which resulted in a different arcite
|
|||||||
- Dark mode
|
- Dark mode
|
||||||
- Also includes a dev menu
|
- Also includes a dev menu
|
||||||
- Hidden by default, use `dev=1` in the browser to show it
|
- Hidden by default, use `dev=1` in the browser to show it
|
||||||
- Improved drag and drop functionality (drag and drop a link from Youtube into the web app)
|
- Improved drag and drop functionality (drag and drop a link from YouTube into the web app)
|
||||||
- New settings page, available on TV and web app
|
- New settings page, available on TV and web app
|
||||||
- New preferences system
|
- New preferences system
|
||||||
- Unified settings between TV and web app
|
- Unified settings between TV and web app
|
||||||
@@ -340,7 +452,7 @@ This version went through a major refactor, which resulted in a different arcite
|
|||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
||||||
- A script to sync between Youtube profile and and Invidious profile
|
- A script to sync between YouTube profile and and Invidious profile
|
||||||
- Moved most of Playlet logic to Playlet Lib
|
- Moved most of Playlet logic to Playlet Lib
|
||||||
- Support for multiple caption languages
|
- Support for multiple caption languages
|
||||||
|
|
||||||
@@ -388,7 +500,7 @@ This version went through a major refactor, which resulted in a different arcite
|
|||||||
- Loading spinner
|
- Loading spinner
|
||||||
- Picture in picture support
|
- Picture in picture support
|
||||||
- [Deep linking support](https://developer.roku.com/en-ca/docs/developer-program/discovery/implementing-deep-linking.md)
|
- [Deep linking support](https://developer.roku.com/en-ca/docs/developer-program/discovery/implementing-deep-linking.md)
|
||||||
- Both Launch arguments and Input arguments are supported, using the "contentId" key as the Youtube video id
|
- Both Launch arguments and Input arguments are supported, using the "contentId" key as the YouTube video id
|
||||||
- Error and Exit dialogs
|
- Error and Exit dialogs
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|||||||
@@ -1,12 +1,14 @@
|
|||||||
# PRIVACY POLICY
|
# PRIVACY POLICY
|
||||||
|
|
||||||
## Playlet
|
## Playlet
|
||||||
|
|
||||||
Playlet, the Roku app, does not collect any user information whatsoever.
|
Playlet, the Roku app, does not collect any user information whatsoever.
|
||||||
In fact, it does not have any servers capable of collecting any form of data.
|
In fact, it does not have any servers capable of collecting any form of data.
|
||||||
|
|
||||||
Playlet does not show advertising, whether personalized or non personalized.
|
Playlet does not show advertising, whether personalized or non personalized.
|
||||||
|
|
||||||
## Invidious
|
## Invidious
|
||||||
|
|
||||||
Playlet may request information from one or more [Invidious](https://invidious.io/)
|
Playlet may request information from one or more [Invidious](https://invidious.io/)
|
||||||
servers, depending on user configuration. With these requests, absolutely no
|
servers, depending on user configuration. With these requests, absolutely no
|
||||||
user data is collected, and only the bare minimum and necessary information
|
user data is collected, and only the bare minimum and necessary information
|
||||||
@@ -23,6 +25,7 @@ keywords. In case the user has privacy concerns, they can host their own
|
|||||||
Invidious instance and use it from Playlet.
|
Invidious instance and use it from Playlet.
|
||||||
|
|
||||||
## SponsorBlock
|
## SponsorBlock
|
||||||
|
|
||||||
Playlet may request information from a [SponsorBlock](https://github.com/ajayyy/SponsorBlock)
|
Playlet may request information from a [SponsorBlock](https://github.com/ajayyy/SponsorBlock)
|
||||||
server, in order to get sponsor sections for requested videos to watch.
|
server, in order to get sponsor sections for requested videos to watch.
|
||||||
With these requests, absolutely no
|
With these requests, absolutely no
|
||||||
@@ -37,3 +40,13 @@ Additionally, Playlet may send a "skipped" event to SponsorBlock, to indicate
|
|||||||
that a section of a video has been skipped. This event does not have any
|
that a section of a video has been skipped. This event does not have any
|
||||||
tracking information attached to it, and it is anonymous. It is merely to
|
tracking information attached to it, and it is anonymous. It is merely to
|
||||||
indicate to contributers how much their contributions are being used in the wild.
|
indicate to contributers how much their contributions are being used in the wild.
|
||||||
|
|
||||||
|
## LeanBack
|
||||||
|
|
||||||
|
LeanBack, also known as Lounge API, also known as "cast from phone". Is a feature that Playlet implmements as a convenience to allow users to use a separate device to browse and cast videos.
|
||||||
|
When this feature is used, all traffic related to the videos being watched, added to the queue, and the video player state is routed through YouTube servers.
|
||||||
|
|
||||||
|
Playlet tries to preserve user privacy, to the best of its ability, by implementing several techniques, such as randomizing device id, using a fresh session on each start, and only providing necessary fields for the feature to function.
|
||||||
|
Additionally, Playlet does not join a session/lounge, until a device is attempting to connect using DIAL (**DI**scovery **A**nd **L**aunch spec), or when a `Link with TV code` is generated, by visiting the appropriate settings page.
|
||||||
|
|
||||||
|
If you have privacy concerns and do not wish to use this functionality, simply do not connect from a local network using the YouTube app or the browser, and do not visit the `Link with TV code` tab.
|
||||||
@@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
# Playlet
|
# Playlet
|
||||||
|
|
||||||
Playlet is an unofficial Youtube client for Roku 📺
|
Playlet is an unofficial YouTube client for Roku 📺
|
||||||
|
|
||||||
## Screenshots
|
## Screenshots
|
||||||
|
|
||||||
@@ -42,16 +42,16 @@ More under [Screenshots](./docs/screenshots/README.md)
|
|||||||
- 🕵️ No Tracking
|
- 🕵️ No Tracking
|
||||||
- 🛡️ Privacy driven (uses Invidious backend)
|
- 🛡️ Privacy driven (uses Invidious backend)
|
||||||
- ⚔️ SponsorBlock integration (skips undesirable sections in videos)
|
- ⚔️ SponsorBlock integration (skips undesirable sections in videos)
|
||||||
- 📱 Browse, search, and cast from phone using the web app
|
- 📱 Browse, search, and cast from phone using the YouTube app or the browser
|
||||||
- 🔮 Picture-in-picture mode
|
- 🔮 Picture-in-picture mode
|
||||||
- ⚡ Fast! [Check out how we compare with the official Youtube app](https://youtu.be/qmSvA-QQW20)
|
- ⚡ Fast! [Check out how we compare with the official YouTube app](https://youtu.be/qmSvA-QQW20)
|
||||||
|
|
||||||
### Cast from phone
|
### Cast from phone
|
||||||
|
|
||||||
1. Open "Web app" tab in Playlet
|
- Open "Remote" tab in Playlet
|
||||||
1. Scan QR Code with Phone
|
- Scan QR Code with Phone, and use the browser; OR
|
||||||
1. Browse or search videos
|
- Use the YouTube app to connect using the same Wi-Fi; OR
|
||||||
1. Click the video and choose the "Play on TV" option
|
- Use the `Link with TV code` to connect
|
||||||
|
|
||||||
### Picture-in-picture
|
### Picture-in-picture
|
||||||
|
|
||||||
@@ -63,7 +63,7 @@ More under [Screenshots](./docs/screenshots/README.md)
|
|||||||
|
|
||||||
1. Open settings in Playlet
|
1. Open settings in Playlet
|
||||||
1. Select Invidious -> Instance
|
1. Select Invidious -> Instance
|
||||||
1. Set a custom instance, or choose a public one hosted by volunteers (from https://api.invidious.io/)
|
1. Set a custom instance, or choose a public one hosted by volunteers (from [api.invidious.io](https://api.invidious.io/))
|
||||||
1. Optionally, Select `Test instance` to make sure it works
|
1. Optionally, Select `Test instance` to make sure it works
|
||||||
1. Hit save
|
1. Hit save
|
||||||
|
|
||||||
@@ -89,10 +89,10 @@ play•let /ˈplālət/
|
|||||||
: a short play
|
: a short play
|
||||||
```
|
```
|
||||||
|
|
||||||
**Playlet** is about keeping the time you spend on Youtube short and useful. It values your time, so it does not show you ads, and allows you to skip sponsored sections and other irrelevant information that's designed to monitize you and/or waste your time.
|
**Playlet** is about keeping the time you spend on YouTube short and useful. It values your time, so it does not show you ads, and allows you to skip sponsored sections and other irrelevant information that's designed to monitize you and/or waste your time.
|
||||||
|
|
||||||
There's a cliché about how a lot of open source software is **`"Made with ♡"`**. This project in particular is **not**.<br/>
|
There's a cliché about how a lot of open source software is **`"Made with ♡"`**. This project in particular is **not**.<br/>
|
||||||
**Playlet** was created out of **spite**, because I believe I have watched enough back-to-back, unskippable Youtube ads for a lifetime.
|
**Playlet** was created out of **spite**, because I believe I have watched enough back-to-back, unskippable YouTube ads for a lifetime.
|
||||||
|
|
||||||
By removing all the bloat, the ads, the tracking, we could end up with an even faster app than the official one.
|
By removing all the bloat, the ads, the tracking, we could end up with an even faster app than the official one.
|
||||||
|
|
||||||
@@ -101,6 +101,7 @@ In any case, I hope you find **Playlet** useful, and pleasant to use.
|
|||||||
## Disclaimer
|
## Disclaimer
|
||||||
|
|
||||||
**Playlet** does not serve or distribute any material from unauthorized sources.<br/>
|
**Playlet** does not serve or distribute any material from unauthorized sources.<br/>
|
||||||
**Playlet** is simply a frontend to other systems (such as [Invidious](https://github.com/iv-org/invidious)), bringing the watching experience to the TV, as opposed to the existing frontends that are web and mobile focused.
|
**Playlet** is simply a frontend to other systems (such as [Invidious](https://github.com/iv-org/invidious)), bringing the watching experience to the TV, as opposed to the existing frontends that are web and mobile focused.<br/>
|
||||||
|
**Playlet** authors acknowledge that all trademarks and registered trademarks mentioned in this repository and related pages are the property of their respective owners. The use of these trademarks or trade names is for identification purposes only and does not imply any endorsement, affiliation, or sponsorship by the trademark owner.
|
||||||
|
|
||||||
<!-- markdownlint-configure-file {"MD024": { "siblings_only": true } } -->
|
<!-- markdownlint-configure-file {"MD024": { "siblings_only": true } } -->
|
||||||
@@ -3,9 +3,13 @@
|
|||||||
"createPackage": false,
|
"createPackage": false,
|
||||||
"diagnosticFilters": [
|
"diagnosticFilters": [
|
||||||
{
|
{
|
||||||
"src": "**/roku_modules/**/*.*"
|
"src": "components/**/*.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,15 +31,25 @@
|
|||||||
"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": [
|
||||||
"source/**",
|
"source/**",
|
||||||
"components/**",
|
"components/**",
|
||||||
|
"!components/**/*.part.xml",
|
||||||
"images/**",
|
"images/**",
|
||||||
|
"!**/*.psd",
|
||||||
"!**/*.svg",
|
"!**/*.svg",
|
||||||
"!**/*.svg.meta.json5",
|
"!**/*.svg.meta.json5",
|
||||||
"fonts/**",
|
|
||||||
"config/**",
|
"config/**",
|
||||||
"lib/**",
|
"lib/**",
|
||||||
"www/**",
|
"www/**",
|
||||||
@@ -57,11 +71,14 @@
|
|||||||
"../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",
|
||||||
|
"../tools/bs-plugins/web-server-plugin.ts"
|
||||||
],
|
],
|
||||||
"retainStagingDir": true,
|
"retainStagingDir": true,
|
||||||
"require": [
|
"require": [
|
||||||
"ts-node/register"
|
"ts-node/register"
|
||||||
],
|
],
|
||||||
"sourceMap": true
|
"sourceMap": true,
|
||||||
|
"pruneEmptyCodeFiles": true
|
||||||
}
|
}
|
||||||
@@ -3,10 +3,11 @@
|
|||||||
"files": [
|
"files": [
|
||||||
"source/**",
|
"source/**",
|
||||||
"components/**",
|
"components/**",
|
||||||
|
"!components/**/*.part.xml",
|
||||||
"images/**",
|
"images/**",
|
||||||
|
"!**/*.psd",
|
||||||
"!**/*.svg",
|
"!**/*.svg",
|
||||||
"!**/*.svg.meta.json5",
|
"!**/*.svg.meta.json5",
|
||||||
"fonts/**",
|
|
||||||
"config/**",
|
"config/**",
|
||||||
"lib/**",
|
"lib/**",
|
||||||
"www/**",
|
"www/**",
|
||||||
@@ -26,7 +27,9 @@
|
|||||||
"../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",
|
||||||
|
"../tools/bs-plugins/web-server-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"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -142,7 +142,7 @@ That's pretty much it.
|
|||||||
|
|
||||||
There are a few reasons we made this separation:
|
There are a few reasons we made this separation:
|
||||||
|
|
||||||
- Playlet relies on [Invidious](https://github.com/iv-org/invidious). Invidious tries to keep up with Youtube making changes to their platform, but sometimes, a breaking change happens that requires Playlet to react quickly. Releasing through the Roku Channel store can take days, or a week. During this time, Playlet would be not functional, and that's not acceptable.
|
- Playlet relies on [Invidious](https://github.com/iv-org/invidious). Invidious tries to keep up with YouTube making changes to their platform, but sometimes, a breaking change happens that requires Playlet to react quickly. Releasing through the Roku Channel store can take days, or a week. During this time, Playlet would be not functional, and that's not acceptable.
|
||||||
- The ability to roll back: Sometimes an app breaking bug gets released. Allowing users to choose a seperate version is a flexible way to keep things working. For example, it's possible to choose a different verrsion from the developer settings in the web app.
|
- The ability to roll back: Sometimes an app breaking bug gets released. Allowing users to choose a seperate version is a flexible way to keep things working. For example, it's possible to choose a different verrsion from the developer settings in the web app.
|
||||||
- It is simply easier to release: Releasing Playlet Lib on Github, and everyone receives the latest version immediately, is very conveninct and less of a hassle, than going through the Roku Channel store.
|
- It is simply easier to release: Releasing Playlet Lib on Github, and everyone receives the latest version immediately, is very conveninct and less of a hassle, than going through the Roku Channel store.
|
||||||
- I've had instances where I was trying to pass the certfication for Playlet to publish it. One of the criterias is to pass a some automated tests. But the tests were failing because their system could not connect to their Roku test devices (connection keeps timing out). My only option was to keep trying over and over until it worked.
|
- I've had instances where I was trying to pass the certfication for Playlet to publish it. One of the criterias is to pass a some automated tests. But the tests were failing because their system could not connect to their Roku test devices (connection keeps timing out). My only option was to keep trying over and over until it worked.
|
||||||
@@ -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)
|
||||||
|
|
||||||
|
|||||||
@@ -4,8 +4,7 @@ This is an automated release. It is generated when new code is pushed to the mai
|
|||||||
|
|
||||||
To test this release:
|
To test this release:
|
||||||
|
|
||||||
- Open Playlet web app in a browser (`http://ROKU_IP_ADDRESS:8888/index.html`)
|
- Open Playlet web app settings in a browser (`http://ROKU_IP_ADDRESS:8888/index.html#settings`)
|
||||||
- Go to settings, and scroll down to `Developer settings`
|
- Scroll down to `Developer settings` and set `Playlet Library version` to `canary` and click `Apply`
|
||||||
- Set `Playlet Library version` to `canary` and click `Apply`
|
|
||||||
- Restart Playlet
|
- Restart Playlet
|
||||||
- You can verify that you're testing the `canary` release in the `Info` tab in Playlet or the web app
|
- You can verify that you're testing the `canary` release in the `Info` tab in Playlet or the web app
|
||||||
@@ -2,7 +2,7 @@ openapi: 3.0.0
|
|||||||
|
|
||||||
info:
|
info:
|
||||||
title: Playlet Web API
|
title: Playlet Web API
|
||||||
version: 0.17.3
|
version: 0.20.1
|
||||||
description:
|
description:
|
||||||
Playlet Web API is a RESTful API for controlling the Playlet app on
|
Playlet Web API is a RESTful API for controlling the Playlet app on
|
||||||
Roku devices. The API is intended to be used by the Playlet web app, but can
|
Roku devices. The API is intended to be used by the Playlet web app, but can
|
||||||
@@ -106,7 +106,7 @@ paths:
|
|||||||
type: array
|
type: array
|
||||||
items:
|
items:
|
||||||
type: string
|
type: string
|
||||||
put:
|
post:
|
||||||
summary: Add to search history
|
summary: Add to search history
|
||||||
description: |
|
description: |
|
||||||
Add a query to the search history.
|
Add a query to the search history.
|
||||||
@@ -140,9 +140,9 @@ paths:
|
|||||||
description: No Content
|
description: No Content
|
||||||
/api/queue:
|
/api/queue:
|
||||||
get:
|
get:
|
||||||
summary: Get play queue
|
summary: Get video queue
|
||||||
description: Get the current videos in the queue.
|
description: Get the current videos in the queue.
|
||||||
operationId: getPlayQueue
|
operationId: getVideoQueue
|
||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
description: OK
|
description: OK
|
||||||
@@ -151,56 +151,43 @@ paths:
|
|||||||
schema:
|
schema:
|
||||||
type: object
|
type: object
|
||||||
properties:
|
properties:
|
||||||
index:
|
|
||||||
type: integer
|
|
||||||
playlistIndex
|
|
||||||
type: integer
|
|
||||||
items:
|
items:
|
||||||
type: array
|
type: array
|
||||||
items:
|
items:
|
||||||
$ref: "#/components/schemas/PlayQueueObject"
|
$ref: "#/components/schemas/VideoQueueObject"
|
||||||
|
index:
|
||||||
|
type: integer
|
||||||
|
nowPlaying:
|
||||||
|
$ref: "#/components/schemas/VideoQueueObject"
|
||||||
post:
|
post:
|
||||||
summary: Add to play queue
|
summary: Add to video queue
|
||||||
description: Add a video or a playlist to the queue.
|
description: Add a video or a playlist to the queue.
|
||||||
operationId: addToPlayQueue
|
operationId: addToVideoQueue
|
||||||
requestBody:
|
requestBody:
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
$ref: "#/components/schemas/PlayQueueObject"
|
$ref: "#/components/schemas/VideoQueueObject"
|
||||||
responses:
|
responses:
|
||||||
"200":
|
"204":
|
||||||
description: OK
|
description: No Content
|
||||||
content:
|
|
||||||
application/json:
|
|
||||||
schema:
|
|
||||||
type: object
|
|
||||||
properties:
|
|
||||||
index:
|
|
||||||
type: integer
|
|
||||||
playlistIndex
|
|
||||||
type: integer
|
|
||||||
items:
|
|
||||||
type: array
|
|
||||||
items:
|
|
||||||
$ref: "#/components/schemas/PlayQueueObject"
|
|
||||||
delete:
|
delete:
|
||||||
summary: Clear play queue
|
summary: Clear video queue
|
||||||
description: Clear the play queue.
|
description: Clear the video queue.
|
||||||
operationId: clearPlayQueue
|
operationId: clearVideoQueue
|
||||||
responses:
|
responses:
|
||||||
"204":
|
"204":
|
||||||
description: No Content
|
description: No Content
|
||||||
/api/queue/play:
|
/api/queue/play:
|
||||||
post:
|
post:
|
||||||
summary: Play video or playlist
|
summary: Play video
|
||||||
description: Play a video or playlist. This adds the video or playlist to the current position in the queue and plays it.
|
description: Play a video or playlist. This adds the video or playlist to the current position in the queue and plays it.
|
||||||
operationId: playPlayQueue
|
operationId: playVideoQueue
|
||||||
requestBody:
|
requestBody:
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
$ref: "#/components/schemas/PlayQueueObject"
|
$ref: "#/components/schemas/VideoQueueObject"
|
||||||
responses:
|
responses:
|
||||||
"204":
|
"204":
|
||||||
description: No Content
|
description: No Content
|
||||||
@@ -227,6 +214,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
|
||||||
@@ -539,7 +561,7 @@ components:
|
|||||||
sponsorblock.show_notifications:
|
sponsorblock.show_notifications:
|
||||||
type: boolean
|
type: boolean
|
||||||
# TODO:P1 add the rest of properties
|
# TODO:P1 add the rest of properties
|
||||||
PlayQueueObject:
|
VideoQueueObject:
|
||||||
type: object
|
type: object
|
||||||
properties:
|
properties:
|
||||||
videoId:
|
videoId:
|
||||||
|
|||||||
@@ -10,6 +10,8 @@
|
|||||||
- [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)
|
||||||
|
- [Web Server](#web-server)
|
||||||
|
|
||||||
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 +471,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 +483,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 +522,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 +542,63 @@ 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
|
||||||
|
```
|
||||||
|
|
||||||
|
## Web Server
|
||||||
|
|
||||||
|
**[Source](/tools/bs-plugins/web-server-plugin.ts)**
|
||||||
|
|
||||||
|
### Why
|
||||||
|
|
||||||
|
Handles routing annotations (e.g. `@get("/api/something")) so that they are handled by the routers/middlewares. It's nicer than having to register things by hand.
|
||||||
|
|
||||||
|
### How
|
||||||
|
|
||||||
|
Routers need to inherit from `Http.HttpRouter`. Then, once a request handled is annotated, e.g.
|
||||||
|
|
||||||
|
```bs
|
||||||
|
@get("/")
|
||||||
|
function GoHome(context as object) as boolean
|
||||||
|
response = context.response
|
||||||
|
response.Redirect("/index.html")
|
||||||
|
return true
|
||||||
|
end function
|
||||||
|
```
|
||||||
|
|
||||||
|
The route and the handler are added to the router. In this example, the `/` route redirects to `index/html`.
|
||||||
|
|
||||||
|
There one special annotation, and one special route:
|
||||||
|
|
||||||
|
- `@all` matches all methods
|
||||||
|
- `*` matches all paths
|
||||||
|
|
||||||
|
So `@all(*)` would be a middleware that will be matched with any request.
|
||||||
@@ -1,30 +1,37 @@
|
|||||||
# Screenshots
|
# Screenshots
|
||||||
|
|
||||||
## Home
|
## Playlet
|
||||||
|
|
||||||

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

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

|
| Remote | 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 |
|
After Width: | Height: | Size: 67 KiB |
|
Before Width: | Height: | Size: 80 KiB After Width: | Height: | Size: 83 KiB |
|
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 42 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: 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,36 +1,36 @@
|
|||||||
{
|
{
|
||||||
"name": "playlet",
|
"name": "playlet",
|
||||||
"version": "0.17.3",
|
"version": "0.20.1",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "playlet",
|
"name": "playlet",
|
||||||
"version": "0.17.3",
|
"version": "0.20.1",
|
||||||
"hasInstallScript": true,
|
"hasInstallScript": true,
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@rokucommunity/bslint": "^0.8.13",
|
"@rokucommunity/bslint": "^0.8.17",
|
||||||
"@types/crypto-js": "^4.2.1",
|
"@types/crypto-js": "^4.2.2",
|
||||||
"@types/fs-extra": "^11.0.4",
|
"@types/fs-extra": "^11.0.4",
|
||||||
"@types/node": "^20.10.4",
|
"@types/node": "^20.11.19",
|
||||||
"@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.22",
|
||||||
"brighterscript-formatter": "^1.6.36",
|
"brighterscript-formatter": "^1.6.40",
|
||||||
"convert-svg-to-png": "^0.6.4",
|
"convert-svg-to-png": "^0.6.4",
|
||||||
"cross-fetch": "^4.0.0",
|
"cross-fetch": "^4.0.0",
|
||||||
"crypto-js": "^4.2.0",
|
"crypto-js": "^4.2.0",
|
||||||
"dotenv": "^16.3.1",
|
"dotenv": "^16.4.4",
|
||||||
"express": "^4.18.2",
|
"express": "^4.18.2",
|
||||||
"fs-extra": "^11.2.0",
|
"fs-extra": "^11.2.0",
|
||||||
"glob": "^10.3.10",
|
"glob": "^10.3.10",
|
||||||
"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.7",
|
||||||
"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.6.0",
|
||||||
"shelljs": "^0.8.5",
|
"shelljs": "^0.8.5",
|
||||||
"ts-node": "^10.9.2",
|
"ts-node": "^10.9.2",
|
||||||
"typescript": "^5.3.3",
|
"typescript": "^5.3.3",
|
||||||
@@ -276,9 +276,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/@rokucommunity/bslint": {
|
"node_modules/@rokucommunity/bslint": {
|
||||||
"version": "0.8.13",
|
"version": "0.8.17",
|
||||||
"resolved": "https://registry.npmjs.org/@rokucommunity/bslint/-/bslint-0.8.13.tgz",
|
"resolved": "https://registry.npmjs.org/@rokucommunity/bslint/-/bslint-0.8.17.tgz",
|
||||||
"integrity": "sha512-EC5tQdtRFTJxOo+9lnZz6yLcsyctuchCzUNJX391ZgCN0EKJTjGigyqTsdsFprINmr0pBojUiys/ZpS/Bv3ROQ==",
|
"integrity": "sha512-e0ksPVYnN+QkhzuV97yPTf1NxSkBQZNMJRhlCFnMJf6gfps+VdY1HwYn3IlqDz3XJxfYcRSDa3v3fQ5dQynVEA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"fs-extra": "^10.0.0",
|
"fs-extra": "^10.0.0",
|
||||||
@@ -345,9 +345,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/@types/crypto-js": {
|
"node_modules/@types/crypto-js": {
|
||||||
"version": "4.2.1",
|
"version": "4.2.2",
|
||||||
"resolved": "https://registry.npmjs.org/@types/crypto-js/-/crypto-js-4.2.1.tgz",
|
"resolved": "https://registry.npmjs.org/@types/crypto-js/-/crypto-js-4.2.2.tgz",
|
||||||
"integrity": "sha512-FSPGd9+OcSok3RsM0UZ/9fcvMOXJ1ENE/ZbLfOPlBWj7BgXtEAM8VYfTtT760GiLbQIMoVozwVuisjvsVwqYWw==",
|
"integrity": "sha512-sDOLlVbHhXpAUAL0YHDUUwDZf3iN4Bwi4W6a0W0b+QcAezUbRtH4FVb+9J4h+XFPW7l/gQ9F8qC7P+Ec4k8QVQ==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/@types/fs-extra": {
|
"node_modules/@types/fs-extra": {
|
||||||
@@ -370,9 +370,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@types/node": {
|
"node_modules/@types/node": {
|
||||||
"version": "20.10.4",
|
"version": "20.11.19",
|
||||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.10.4.tgz",
|
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.19.tgz",
|
||||||
"integrity": "sha512-D08YG6rr8X90YB56tSIuBaddy/UXAA9RKJoFvrsnogAum/0pmjkgi4+2nx96A330FmioegBWmEYQ+syqCFaveg==",
|
"integrity": "sha512-7xMnVEcZFu0DikYjWOlRq7NTPETrm7teqUT2WkQjrTIkEgUyyGdWsj/Zg8bEJt5TNklzbPD1X3fqfsHw3SpapQ==",
|
||||||
"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.22",
|
||||||
"resolved": "https://registry.npmjs.org/brighterscript/-/brighterscript-0.65.13.tgz",
|
"resolved": "https://registry.npmjs.org/brighterscript/-/brighterscript-0.65.22.tgz",
|
||||||
"integrity": "sha512-f2Mvdpl+RRuVGLnwXvydpVjftSJl0n9L0HCBQlLZPQelksGV7n0ahIBcbPavqhXaZj/wB4wOKn2vQwWJI0G+tA==",
|
"integrity": "sha512-rDSdO33xRnFGB9nr54awTUucpd4oZpZmDMvVUSAb6jmFU1jz+SYhwV9ezc8U5m3Kswap7uV+BmS1O69QZ9MuSw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@rokucommunity/bslib": "^0.1.1",
|
"@rokucommunity/bslib": "^0.1.1",
|
||||||
@@ -740,7 +740,6 @@
|
|||||||
"chevrotain": "^7.0.1",
|
"chevrotain": "^7.0.1",
|
||||||
"chokidar": "^3.5.1",
|
"chokidar": "^3.5.1",
|
||||||
"clear": "^0.1.0",
|
"clear": "^0.1.0",
|
||||||
"coveralls-next": "^4.2.0",
|
|
||||||
"cross-platform-clear-console": "^2.3.0",
|
"cross-platform-clear-console": "^2.3.0",
|
||||||
"debounce-promise": "^3.1.0",
|
"debounce-promise": "^3.1.0",
|
||||||
"eventemitter3": "^4.0.0",
|
"eventemitter3": "^4.0.0",
|
||||||
@@ -756,7 +755,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 +770,12 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/brighterscript-formatter": {
|
"node_modules/brighterscript-formatter": {
|
||||||
"version": "1.6.36",
|
"version": "1.6.40",
|
||||||
"resolved": "https://registry.npmjs.org/brighterscript-formatter/-/brighterscript-formatter-1.6.36.tgz",
|
"resolved": "https://registry.npmjs.org/brighterscript-formatter/-/brighterscript-formatter-1.6.40.tgz",
|
||||||
"integrity": "sha512-f9Y3Re6egB1MCUftph8AT8RxWTtXmeMjwigRv1biNGmEuGeSOipoBnCbwY4U1CFz46L7W39/TL4n1JMV9URD6w==",
|
"integrity": "sha512-cxvGGluNfxy6p3khtcMt/3AschwqEnERjLRIEt3XVU0R0l2QgwXelDp8ViqgnQ2hQYa8LnfnOiV1u7OCqbiZPA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"brighterscript": "^0.65.12",
|
"brighterscript": "^0.65.19",
|
||||||
"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",
|
||||||
@@ -1479,25 +1478,6 @@
|
|||||||
"integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==",
|
"integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/coveralls-next": {
|
|
||||||
"version": "4.2.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/coveralls-next/-/coveralls-next-4.2.0.tgz",
|
|
||||||
"integrity": "sha512-zg41a/4QDSASPtlV6gp+6owoU43U5CguxuPZR3nPZ26M5ZYdEK3MdUe7HwE+AnCZPkucudfhqqJZehCNkz2rYg==",
|
|
||||||
"dev": true,
|
|
||||||
"dependencies": {
|
|
||||||
"form-data": "4.0.0",
|
|
||||||
"js-yaml": "4.1.0",
|
|
||||||
"lcov-parse": "1.0.0",
|
|
||||||
"log-driver": "1.2.7",
|
|
||||||
"minimist": "1.2.7"
|
|
||||||
},
|
|
||||||
"bin": {
|
|
||||||
"coveralls": "bin/coveralls.js"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=14"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/create-require": {
|
"node_modules/create-require": {
|
||||||
"version": "1.1.1",
|
"version": "1.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz",
|
||||||
@@ -1726,15 +1706,15 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/dotenv": {
|
"node_modules/dotenv": {
|
||||||
"version": "16.3.1",
|
"version": "16.4.4",
|
||||||
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.3.1.tgz",
|
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.4.tgz",
|
||||||
"integrity": "sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ==",
|
"integrity": "sha512-XvPXc8XAQThSjAbY6cQ/9PcBXmFoWuw1sQ3b8HqUCR6ziGXjkTi//kB9SWa2UwqlgdAIuRqAa/9hVljzPehbYg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=12"
|
"node": ">=12"
|
||||||
},
|
},
|
||||||
"funding": {
|
"funding": {
|
||||||
"url": "https://github.com/motdotla/dotenv?sponsor=1"
|
"url": "https://dotenvx.com"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/eastasianwidth": {
|
"node_modules/eastasianwidth": {
|
||||||
@@ -1997,9 +1977,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"
|
||||||
@@ -2103,20 +2083,6 @@
|
|||||||
"node": "*"
|
"node": "*"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/form-data": {
|
|
||||||
"version": "4.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz",
|
|
||||||
"integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==",
|
|
||||||
"dev": true,
|
|
||||||
"dependencies": {
|
|
||||||
"asynckit": "^0.4.0",
|
|
||||||
"combined-stream": "^1.0.8",
|
|
||||||
"mime-types": "^2.1.12"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">= 6"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/forwarded": {
|
"node_modules/forwarded": {
|
||||||
"version": "0.2.0",
|
"version": "0.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz",
|
||||||
@@ -2745,18 +2711,6 @@
|
|||||||
"@pkgjs/parseargs": "^0.11.0"
|
"@pkgjs/parseargs": "^0.11.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/js-yaml": {
|
|
||||||
"version": "4.1.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz",
|
|
||||||
"integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==",
|
|
||||||
"dev": true,
|
|
||||||
"dependencies": {
|
|
||||||
"argparse": "^2.0.1"
|
|
||||||
},
|
|
||||||
"bin": {
|
|
||||||
"js-yaml": "bin/js-yaml.js"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/jsbn": {
|
"node_modules/jsbn": {
|
||||||
"version": "0.1.1",
|
"version": "0.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz",
|
||||||
@@ -2838,15 +2792,6 @@
|
|||||||
"setimmediate": "^1.0.5"
|
"setimmediate": "^1.0.5"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/lcov-parse": {
|
|
||||||
"version": "1.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/lcov-parse/-/lcov-parse-1.0.0.tgz",
|
|
||||||
"integrity": "sha512-aprLII/vPzuQvYZnDRU78Fns9I2Ag3gi4Ipga/hxnVMCZC8DnR2nI7XBqrPoywGfxqIx/DgarGvDJZAD3YBTgQ==",
|
|
||||||
"dev": true,
|
|
||||||
"bin": {
|
|
||||||
"lcov-parse": "bin/cli.js"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/leac": {
|
"node_modules/leac": {
|
||||||
"version": "0.6.0",
|
"version": "0.6.0",
|
||||||
"resolved": "https://registry.npmjs.org/leac/-/leac-0.6.0.tgz",
|
"resolved": "https://registry.npmjs.org/leac/-/leac-0.6.0.tgz",
|
||||||
@@ -2902,12 +2847,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": {
|
||||||
@@ -2940,15 +2885,6 @@
|
|||||||
"integrity": "sha512-hXt6Ul/5yWjfklSGvLQl8vM//l3FtyHZeuelpzK6mm99pNvN9yTDruNZPEJZD1oWrqo+izBmB7oUfWgcCX7s4Q==",
|
"integrity": "sha512-hXt6Ul/5yWjfklSGvLQl8vM//l3FtyHZeuelpzK6mm99pNvN9yTDruNZPEJZD1oWrqo+izBmB7oUfWgcCX7s4Q==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/log-driver": {
|
|
||||||
"version": "1.2.7",
|
|
||||||
"resolved": "https://registry.npmjs.org/log-driver/-/log-driver-1.2.7.tgz",
|
|
||||||
"integrity": "sha512-U7KCmLdqsGHBLeWqYlFA0V0Sl6P08EE1ZrmA9cxjUE0WVqT9qnyVDPz1kzpFEP0jdJuFnasWIfSd7fsaNXkpbg==",
|
|
||||||
"dev": true,
|
|
||||||
"engines": {
|
|
||||||
"node": ">=0.8.6"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/long": {
|
"node_modules/long": {
|
||||||
"version": "3.2.0",
|
"version": "3.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/long/-/long-3.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/long/-/long-3.2.0.tgz",
|
||||||
@@ -2980,9 +2916,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/mailparser": {
|
"node_modules/mailparser": {
|
||||||
"version": "3.6.5",
|
"version": "3.6.7",
|
||||||
"resolved": "https://registry.npmjs.org/mailparser/-/mailparser-3.6.5.tgz",
|
"resolved": "https://registry.npmjs.org/mailparser/-/mailparser-3.6.7.tgz",
|
||||||
"integrity": "sha512-nteTpF0Khm5JLOnt4sigmzNdUH/6mO7PZ4KEnvxf4mckyXYFFhrtAWZzbq/V5aQMH+049gA7ZjfLdh+QiX2Uqg==",
|
"integrity": "sha512-/3x8HW70DNehw+3vdOPKdlLuxOHoWcGB5jfx5vJ5XUbY9/2jUJbrrhda5Si8Dj/3w08U0y5uGAkqs5+SPTPKoA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"encoding-japanese": "2.0.0",
|
"encoding-japanese": "2.0.0",
|
||||||
@@ -2990,10 +2926,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.9",
|
||||||
"tlds": "1.240.0"
|
"tlds": "1.248.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/mailparser/node_modules/iconv-lite": {
|
"node_modules/mailparser/node_modules/iconv-lite": {
|
||||||
@@ -3140,15 +3076,6 @@
|
|||||||
"node": "*"
|
"node": "*"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/minimist": {
|
|
||||||
"version": "1.2.7",
|
|
||||||
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.7.tgz",
|
|
||||||
"integrity": "sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==",
|
|
||||||
"dev": true,
|
|
||||||
"funding": {
|
|
||||||
"url": "https://github.com/sponsors/ljharb"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/mkdirp-classic": {
|
"node_modules/mkdirp-classic": {
|
||||||
"version": "0.5.3",
|
"version": "0.5.3",
|
||||||
"resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz",
|
"resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz",
|
||||||
@@ -3200,9 +3127,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/nodemailer": {
|
"node_modules/nodemailer": {
|
||||||
"version": "6.9.3",
|
"version": "6.9.9",
|
||||||
"resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-6.9.3.tgz",
|
"resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-6.9.9.tgz",
|
||||||
"integrity": "sha512-fy9v3NgTzBngrMFkDsKEj0r02U7jm6XfC3b52eoNV+GCrGj+s8pt5OqhiJdWKuw51zCTdiNR/IUD1z33LIIGpg==",
|
"integrity": "sha512-dexTll8zqQoVJEZPwQAKzxxtFn0qTnjdQTchoU6Re9BUUGBJiOy3YMn/0ShTW6J5M0dfQ1NeDeRTTl4oIWgQMA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=6.0.0"
|
"node": ">=6.0.0"
|
||||||
@@ -3923,9 +3850,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 +3921,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",
|
||||||
@@ -4110,9 +4037,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/semver": {
|
"node_modules/semver": {
|
||||||
"version": "7.5.4",
|
"version": "7.6.0",
|
||||||
"resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz",
|
"resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz",
|
||||||
"integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==",
|
"integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"lru-cache": "^6.0.0"
|
"lru-cache": "^6.0.0"
|
||||||
@@ -4477,9 +4404,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 +4539,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,30 +1,30 @@
|
|||||||
{
|
{
|
||||||
"name": "playlet",
|
"name": "playlet",
|
||||||
"version": "0.17.3",
|
"version": "0.20.1",
|
||||||
"description": "Unofficial Youtube client for Roku",
|
"description": "Unofficial YouTube client for Roku",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@rokucommunity/bslint": "^0.8.13",
|
"@rokucommunity/bslint": "^0.8.17",
|
||||||
"@types/crypto-js": "^4.2.1",
|
"@types/crypto-js": "^4.2.2",
|
||||||
"@types/fs-extra": "^11.0.4",
|
"@types/fs-extra": "^11.0.4",
|
||||||
"@types/node": "^20.10.4",
|
"@types/node": "^20.11.19",
|
||||||
"@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.22",
|
||||||
"brighterscript-formatter": "^1.6.36",
|
"brighterscript-formatter": "^1.6.40",
|
||||||
"convert-svg-to-png": "^0.6.4",
|
"convert-svg-to-png": "^0.6.4",
|
||||||
"cross-fetch": "^4.0.0",
|
"cross-fetch": "^4.0.0",
|
||||||
"crypto-js": "^4.2.0",
|
"crypto-js": "^4.2.0",
|
||||||
"dotenv": "^16.3.1",
|
"dotenv": "^16.4.4",
|
||||||
"express": "^4.18.2",
|
"express": "^4.18.2",
|
||||||
"fs-extra": "^11.2.0",
|
"fs-extra": "^11.2.0",
|
||||||
"glob": "^10.3.10",
|
"glob": "^10.3.10",
|
||||||
"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.7",
|
||||||
"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.6.0",
|
||||||
"shelljs": "^0.8.5",
|
"shelljs": "^0.8.5",
|
||||||
"ts-node": "^10.9.2",
|
"ts-node": "^10.9.2",
|
||||||
"typescript": "^5.3.3",
|
"typescript": "^5.3.3",
|
||||||
@@ -65,6 +65,9 @@
|
|||||||
"generate-sponsorblock-config": "node tools/generate-sponsorblock-config.js",
|
"generate-sponsorblock-config": "node tools/generate-sponsorblock-config.js",
|
||||||
"update-rale-component": "cd tools/RALE && rm TrackerTask.xml && curl -o TrackerTask.zip https://devtools.web.roku.com/roku-advanced-layout-editor/app/TrackerTask.zip && unzip TrackerTask.zip && rm TrackerTask.zip",
|
"update-rale-component": "cd tools/RALE && rm TrackerTask.xml && curl -o TrackerTask.zip https://devtools.web.roku.com/roku-advanced-layout-editor/app/TrackerTask.zip && unzip TrackerTask.zip && rm TrackerTask.zip",
|
||||||
"postinstall": "cd playlet-lib && npm install && cd ../playlet-app && npm install && cd ../playlet-web && npm install",
|
"postinstall": "cd playlet-lib && npm install && cd ../playlet-app && npm install && cd ../playlet-web && npm install",
|
||||||
"update-deps": "npx npm-check-updates -u && cd playlet-app && npx npm-check-updates -u && cd ../playlet-lib && npx npm-check-updates -u && cd ../playlet-web && npx npm-check-updates -u"
|
"update-deps": "npx npm-check-updates -u && cd playlet-app && npx npm-check-updates -u && cd ../playlet-lib && npx npm-check-updates -u && cd ../playlet-web && npx npm-check-updates -u",
|
||||||
|
"registry:write": "node tools/registry.js --input registry.json",
|
||||||
|
"registry:read": "node tools/registry.js --output registry.json",
|
||||||
|
"registry:clear": "node tools/registry.js --clear"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "playlet-app",
|
"name": "playlet-app",
|
||||||
"version": "0.17.3",
|
"version": "0.20.1",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "playlet-app",
|
"name": "playlet-app",
|
||||||
"version": "0.17.3"
|
"version": "0.20.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "playlet-app",
|
"name": "playlet-app",
|
||||||
"version": "0.17.3",
|
"version": "0.20.1",
|
||||||
"description": "Unofficial Youtube client for Roku",
|
"description": "Unofficial YouTube client for Roku",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"prebuild": "rm -rf build/playlet-app",
|
"prebuild": "rm -rf build/playlet-app",
|
||||||
"prebuild:dev": "npm run prebuild",
|
"prebuild:dev": "npm run prebuild",
|
||||||
|
|||||||
@@ -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,22 @@ 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]
|
embedded = { type: "embedded", link: Manifest.ReadValue("playlet_lib_embedded_url") }
|
||||||
|
#if DEBUG_FALLBACK_TO_EMBEDDED
|
||||||
|
return [debug, embedded]
|
||||||
#else
|
#else
|
||||||
savedUrls = GetPlayletLibUrlsFromRegistry()
|
return [debug]
|
||||||
|
#end if
|
||||||
|
#else
|
||||||
|
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 +46,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 +61,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 +70,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 +88,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 +114,5 @@ function ShowPlayletLibLoadErrorDialog()
|
|||||||
"If the problem persist, contact Playlet authors."
|
"If the problem persist, contact Playlet authors."
|
||||||
]
|
]
|
||||||
|
|
||||||
ShowErrorDialog(message, bulletText, bottomText)
|
DialogShowError(message, bulletText, bottomText)
|
||||||
end function
|
end function
|
||||||
@@ -20,6 +20,11 @@ function GetLoadingMessage() as string
|
|||||||
"Don't forget to like and subscribe...",
|
"Don't forget to like and subscribe...",
|
||||||
"Shoveling coal into the server...",
|
"Shoveling coal into the server...",
|
||||||
"Counting down from infinity...",
|
"Counting down from infinity...",
|
||||||
|
"Unfortunately, the internet is closed today...",
|
||||||
|
"Unfortunately, we have no ads to show you...",
|
||||||
|
"Looking for the remote...",
|
||||||
|
"Finding that song that goes 'La la lala la'...",
|
||||||
|
"Waiting for the spinny thing to finish...",
|
||||||
]
|
]
|
||||||
end if
|
end if
|
||||||
index = GetRandom(0, messages.count() - 1)
|
index = GetRandom(0, messages.count() - 1)
|
||||||
|
|||||||
|
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: 18 KiB After Width: | Height: | Size: 76 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=20
|
||||||
build_version=00003
|
build_version=00001
|
||||||
|
|
||||||
ui_resolutions=hd
|
ui_resolutions=hd
|
||||||
|
|
||||||
@@ -33,4 +33,4 @@ playlet_lib_debug_url=http://DEBUG_HOST_IP_ADDRESS:8086/playlet-lib.zip
|
|||||||
|
|
||||||
git_commit_sha=unknown
|
git_commit_sha=unknown
|
||||||
|
|
||||||
bs_const=DEBUG=false
|
bs_const=DEBUG=false;DEBUG_FALLBACK_TO_EMBEDDED=true
|
||||||
@@ -1,26 +1,38 @@
|
|||||||
function ShowErrorDialog(message as object, bulletText as object, bottomMessage as object)
|
function DialogShowError(message as object, bulletText as object, bottomMessage as object)
|
||||||
' Note: dialog can be null since StandardMessageDialog is only available on 10.0 and later
|
' Note: dialog can be null since StandardMessageDialog is only available on 10.0 and later
|
||||||
dialog = CreateObject("roSGNode", "StandardMessageDialog")
|
msgDialog = CreateObject("roSGNode", "StandardMessageDialog")
|
||||||
dialog.message = message
|
DialogSetPalette(msgDialog)
|
||||||
dialog.bulletText = bulletText
|
msgDialog.message = message
|
||||||
dialog.bottomMessage = bottomMessage
|
msgDialog.bulletText = bulletText
|
||||||
dialog.title = "Error loading Playlet"
|
msgDialog.bottomMessage = bottomMessage
|
||||||
dialog.buttons = ["Exit"]
|
msgDialog.title = "Error loading Playlet"
|
||||||
|
msgDialog.buttons = ["Exit"]
|
||||||
|
|
||||||
' bs:disable-next-line NO_OBSERVE_STRING_CALLBACK
|
' bs:disable-next-line NO_OBSERVE_STRING_CALLBACK
|
||||||
dialog.observeField("buttonSelected", "OnButtonSelected")
|
msgDialog.observeField("buttonSelected", "DialogOnButtonSelected")
|
||||||
' bs:disable-next-line NO_OBSERVE_STRING_CALLBACK
|
' bs:disable-next-line NO_OBSERVE_STRING_CALLBACK
|
||||||
dialog.observeField("wasClosed", "OnDialogClosed")
|
msgDialog.observeField("wasClosed", "DialogOnClosed")
|
||||||
|
|
||||||
m.top.getScene().dialog = dialog
|
m.top.getScene().dialog = msgDialog
|
||||||
end function
|
end function
|
||||||
|
|
||||||
function OnButtonSelected()
|
function DialogSetPalette(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 DialogOnButtonSelected()
|
||||||
m.top.getScene().dialog.close = true
|
m.top.getScene().dialog.close = true
|
||||||
end function
|
end function
|
||||||
|
|
||||||
function OnDialogClosed()
|
function DialogOnClosed()
|
||||||
' 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
|
m.top.getScene().exitChannel = true
|
||||||
end function
|
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()
|
||||||
@@ -32,9 +33,9 @@ function Main(args as object) as void
|
|||||||
' These vars are needed to pass certification.
|
' These vars are needed to pass certification.
|
||||||
' The actual work is done in Playlet Lib
|
' The actual work is done in Playlet Lib
|
||||||
' bs:disable-next-line LINT1005
|
' bs:disable-next-line LINT1005
|
||||||
contentId = args.contentId
|
_contentId = args.contentId
|
||||||
' bs:disable-next-line LINT1005
|
' bs:disable-next-line LINT1005
|
||||||
mediaType = args.mediaType
|
_mediaType = args.mediaType
|
||||||
|
|
||||||
' Do not signal app launch complete here, we're doing it over at Playlet Lib
|
' Do not signal app launch complete here, we're doing it over at Playlet Lib
|
||||||
' This is needed to pass cetification
|
' This is needed to pass cetification
|
||||||
@@ -44,7 +45,7 @@ function Main(args as object) as void
|
|||||||
input = CreateObject("roInput")
|
input = CreateObject("roInput")
|
||||||
input.setMessagePort(port)
|
input.setMessagePort(port)
|
||||||
|
|
||||||
' TODO:P1 follow up on bug where roSystemLog does not fire for a video player in ComponentLibrary
|
' TODO:P2 follow up on bug where roSystemLog does not fire for a video player in ComponentLibrary
|
||||||
' https://community.roku.com/t5/Roku-Developer-Program/BUG-roSystemLog-not-firing-with-ComponentLibrary/td-p/906075
|
' https://community.roku.com/t5/Roku-Developer-Program/BUG-roSystemLog-not-firing-with-ComponentLibrary/td-p/906075
|
||||||
systemLog = CreateObject("roSystemLog")
|
systemLog = CreateObject("roSystemLog")
|
||||||
systemLog.SetMessagePort(port)
|
systemLog.SetMessagePort(port)
|
||||||
@@ -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
|
||||||
|
|
||||||
|
function ReadValue(key as string) as string
|
||||||
appInfo = CreateObject("roAppInfo")
|
appInfo = CreateObject("roAppInfo")
|
||||||
return appInfo.GetValue(key)
|
return appInfo.GetValue(key)
|
||||||
end function
|
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,4 +1,6 @@
|
|||||||
function ReadRegistryKey(key as string, section as string) as dynamic
|
namespace Registry
|
||||||
|
|
||||||
|
function ReadKey(key as string, section as string) as dynamic
|
||||||
sec = CreateObject("roRegistrySection", section)
|
sec = CreateObject("roRegistrySection", section)
|
||||||
if not sec.Exists(key)
|
if not sec.Exists(key)
|
||||||
return invalid
|
return invalid
|
||||||
@@ -6,14 +8,14 @@ function ReadRegistryKey(key as string, section as string) as dynamic
|
|||||||
return sec.Read(key)
|
return sec.Read(key)
|
||||||
end function
|
end function
|
||||||
|
|
||||||
function DeleteRegistryKey(key as string, section as string)
|
function DeleteKey(key as string, section as string)
|
||||||
sec = CreateObject("roRegistrySection", section)
|
sec = CreateObject("roRegistrySection", section)
|
||||||
sec.Delete(key)
|
sec.Delete(key)
|
||||||
sec.Flush()
|
sec.Flush()
|
||||||
end function
|
end function
|
||||||
|
|
||||||
function GetPlayletLibUrlsFromRegistry() as object
|
function GetPlayletLibUrlsFromRegistry() as object
|
||||||
urlsJson = ReadRegistryKey("playlet_lib_urls", "Playlet")
|
urlsJson = ReadKey("playlet_lib_urls", "Playlet")
|
||||||
if urlsJson = invalid
|
if urlsJson = invalid
|
||||||
return invalid
|
return invalid
|
||||||
end if
|
end if
|
||||||
@@ -25,5 +27,8 @@ function ClearPlayletLibUrlsIfNeeded(launchArgs as object) as void
|
|||||||
if launchArgs = invalid or launchArgs.clearPlayletLibUrls = invalid
|
if launchArgs = invalid or launchArgs.clearPlayletLibUrls = invalid
|
||||||
return
|
return
|
||||||
end if
|
end if
|
||||||
DeleteRegistryKey("playlet_lib_urls", "Playlet")
|
DeleteKey("playlet_lib_urls", "Playlet")
|
||||||
|
Logger.Log("Cleared key playlet_lib_urls from registry")
|
||||||
end function
|
end function
|
||||||
|
|
||||||
|
end namespace
|
||||||
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "playlet-lib",
|
"name": "playlet-lib",
|
||||||
"version": "0.17.3",
|
"version": "0.20.1",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "playlet-lib",
|
"name": "playlet-lib",
|
||||||
"version": "0.17.3"
|
"version": "0.20.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "playlet-lib",
|
"name": "playlet-lib",
|
||||||
"version": "0.17.3",
|
"version": "0.20.1",
|
||||||
"description": "Unofficial Youtube client for Roku",
|
"description": "Unofficial YouTube client for Roku",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"prebuild": "rm -rf build/playlet-lib",
|
"prebuild": "rm -rf build/playlet-lib",
|
||||||
"prebuild:dev": "npm run prebuild",
|
"prebuild:dev": "npm run prebuild",
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
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/PlayQueue/PlayQueueViewUtils.bs"
|
import "pkg:/components/VideoQueue/VideoQueueUtils.bs"
|
||||||
import "pkg:/components/VideoPlayer/VideoUtils.bs"
|
import "pkg:/components/VideoQueue/VideoQueueViewUtils.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"
|
||||||
@@ -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)
|
||||||
@@ -86,13 +86,13 @@ function onKeyEvent(key as string, press as boolean) as boolean
|
|||||||
end if
|
end if
|
||||||
|
|
||||||
if key = OPTIONS_LONG_PRESS_KEY and press
|
if key = OPTIONS_LONG_PRESS_KEY and press
|
||||||
LogInfo("Opening PlayQueueView")
|
LogInfo("Opening VideoQueueView")
|
||||||
PlayQueueViewUtils.Open(m.top.playQueue, m.top)
|
VideoQueueViewUtils.Open(m.top.videoQueue, m.top)
|
||||||
return true
|
return true
|
||||||
end if
|
end if
|
||||||
|
|
||||||
if key = "options" and not press
|
if key = "options" and not press
|
||||||
if VideoUtils.ToggleVideoPictureInPicture()
|
if VideoQueueUtils.ToggleVideoPictureInPicture(m.top.videoQueue)
|
||||||
return true
|
return true
|
||||||
end if
|
end if
|
||||||
end if
|
end if
|
||||||
@@ -102,26 +102,26 @@ function onKeyEvent(key as string, press as boolean) as boolean
|
|||||||
end if
|
end if
|
||||||
|
|
||||||
if key = "play"
|
if key = "play"
|
||||||
if VideoUtils.TogglePause()
|
if VideoQueueUtils.TogglePause(m.top.videoQueue)
|
||||||
return true
|
return true
|
||||||
end if
|
end if
|
||||||
end if
|
end if
|
||||||
|
|
||||||
if key = "pause"
|
if key = "pause"
|
||||||
if VideoUtils.PauseVideo()
|
if VideoQueueUtils.Pause(m.top.videoQueue)
|
||||||
return true
|
return true
|
||||||
end if
|
end if
|
||||||
end if
|
end if
|
||||||
|
|
||||||
if key = "playonly"
|
if key = "playonly"
|
||||||
if VideoUtils.ResumeVideo()
|
if VideoQueueUtils.Play(m.top.videoQueue)
|
||||||
return true
|
return true
|
||||||
end if
|
end if
|
||||||
end if
|
end if
|
||||||
|
|
||||||
if key = "back"
|
if key = "back"
|
||||||
if VideoUtils.IsVideoPlayerOpen() and not VideoUtils.IsVideoPlayerFullScreen()
|
if VideoQueueUtils.IsVideoPlayerOpen(m.top.videoQueue) and not VideoQueueUtils.IsVideoPlayerFullScreen(m.top.videoQueue)
|
||||||
if VideoUtils.ToggleVideoPictureInPicture()
|
if VideoQueueUtils.ToggleVideoPictureInPicture(m.top.videoQueue)
|
||||||
return true
|
return true
|
||||||
end if
|
end if
|
||||||
end if
|
end if
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<interface>
|
<interface>
|
||||||
<field id="root" type="node" />
|
<field id="root" type="node" />
|
||||||
<field id="stack" type="node" />
|
<field id="stack" type="node" />
|
||||||
<field id="playQueue" type="node" />
|
<field id="videoQueue" type="node" />
|
||||||
<function name="PushScreen" />
|
<function name="PushScreen" />
|
||||||
<function name="PopScreen" />
|
<function name="PopScreen" />
|
||||||
<function name="FocusTopScreen" />
|
<function name="FocusTopScreen" />
|
||||||
|
|||||||
@@ -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
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
translation="[115,20]"
|
translation="[115,20]"
|
||||||
width="104"
|
width="104"
|
||||||
height="104"
|
height="104"
|
||||||
uri="pkg:/images/circle-mask-500.png">
|
uri="pkg:/images/white-circle.png">
|
||||||
|
|
||||||
<CirclePoster
|
<CirclePoster
|
||||||
id="thumbnail"
|
id="thumbnail"
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -10,13 +10,13 @@
|
|||||||
<field id="failedBitmapUri" type="uri" alias="Poster.failedBitmapUri" />
|
<field id="failedBitmapUri" type="uri" alias="Poster.failedBitmapUri" />
|
||||||
<field id="loadStatus" type="string" alias="Poster.loadStatus" />
|
<field id="loadStatus" type="string" alias="Poster.loadStatus" />
|
||||||
|
|
||||||
<field id="maskUri" type="uri" value="pkg:/images/circle-mask-500.png" alias="MaskGroup.maskuri" />
|
<field id="maskUri" type="uri" value="pkg:/images/white-circle.png" alias="MaskGroup.maskuri" />
|
||||||
<field id="maskSize" type="vector2d" alias="MaskGroup.maskSize" />
|
<field id="maskSize" type="vector2d" alias="MaskGroup.maskSize" />
|
||||||
</interface>
|
</interface>
|
||||||
<children>
|
<children>
|
||||||
<MaskGroup
|
<MaskGroup
|
||||||
id="MaskGroup"
|
id="MaskGroup"
|
||||||
maskuri="pkg:/images/circle-mask-500.png">
|
maskuri="pkg:/images/white-circle.png">
|
||||||
<Poster
|
<Poster
|
||||||
id="Poster" />
|
id="Poster" />
|
||||||
</MaskGroup>
|
</MaskGroup>
|
||||||
|
|||||||
@@ -1,10 +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()
|
|
||||||
end function
|
|
||||||
|
|
||||||
function LoadChannel(invidiousNode as object) as void
|
function LoadChannel(invidiousNode as object) as void
|
||||||
if m.contentTask <> invalid
|
if m.contentTask <> invalid
|
||||||
@@ -17,8 +16,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
|
||||||
|
|||||||
@@ -0,0 +1,55 @@
|
|||||||
|
import "pkg:/components/Dialog/DialogUtils.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/Logging.bs"
|
||||||
|
|
||||||
|
function LoadPlaylistPage(invidiousNode as object) as void
|
||||||
|
LoadPlaylist(invidiousNode, true)
|
||||||
|
end function
|
||||||
|
|
||||||
|
function LoadPlaylistAll(invidiousNode as object) as void
|
||||||
|
LoadPlaylist(invidiousNode, false)
|
||||||
|
end function
|
||||||
|
|
||||||
|
function LoadPlaylist(invidiousNode as object, singlePage as boolean) as void
|
||||||
|
if m.contentTask <> invalid
|
||||||
|
m.contentTask.cancel = true
|
||||||
|
end if
|
||||||
|
|
||||||
|
loadState = m.top.loadState
|
||||||
|
if loadState = FeedLoadState.Loading or loadState = FeedLoadState.Loaded
|
||||||
|
return
|
||||||
|
end if
|
||||||
|
|
||||||
|
m.top.loadState = FeedLoadState.Loading
|
||||||
|
m.contentTask = AsyncTask.Start(Tasks.PlaylistContentTask, {
|
||||||
|
content: m.top
|
||||||
|
invidious: invidiousNode
|
||||||
|
singlePage: singlePage
|
||||||
|
}, OnPlaylistContentTaskResult)
|
||||||
|
end function
|
||||||
|
|
||||||
|
function OnPlaylistContentTaskResult(output as object) as void
|
||||||
|
m.contentTask = invalid
|
||||||
|
|
||||||
|
if output.cancelled
|
||||||
|
return
|
||||||
|
end if
|
||||||
|
|
||||||
|
if not output.success or not output.result.success
|
||||||
|
' output.error for unhandled exception
|
||||||
|
error = output.error
|
||||||
|
if error = invalid
|
||||||
|
' output.result.error for network errors
|
||||||
|
error = output.result.error
|
||||||
|
end if
|
||||||
|
error = ErrorUtils.Format(error)
|
||||||
|
LogError(error)
|
||||||
|
playlistId = output.task.input.content.playlistId
|
||||||
|
message = `Failed to load playlist ${playlistId}\n${error}`
|
||||||
|
DialogUtils.ShowDialog(message, "Playlist load fail", true)
|
||||||
|
return
|
||||||
|
end if
|
||||||
|
end function
|
||||||
@@ -1,5 +1,8 @@
|
|||||||
<component name="PlaylistContentNode" extends="ContentNode">
|
<component name="PlaylistContentNode" extends="ContentNode">
|
||||||
<interface>
|
<interface>
|
||||||
|
<function name="LoadPlaylistPage" />
|
||||||
|
<function name="LoadPlaylistAll" />
|
||||||
|
|
||||||
<field id="type" type="string" value="playlist" />
|
<field id="type" type="string" value="playlist" />
|
||||||
<field id="loadState" type="string" />
|
<field id="loadState" type="string" />
|
||||||
<!-- index in a feed -->
|
<!-- index in a feed -->
|
||||||
|
|||||||
@@ -0,0 +1,57 @@
|
|||||||
|
import "pkg:/components/Services/Invidious/InvidiousService.bs"
|
||||||
|
import "pkg:/components/Services/Invidious/InvidiousToContentNode.bs"
|
||||||
|
import "pkg:/components/VideoFeed/FeedLoadState.bs"
|
||||||
|
|
||||||
|
@asynctask
|
||||||
|
function PlaylistContentTask(input as object) as object
|
||||||
|
contentNode = input.content
|
||||||
|
invidiousNode = input.invidious
|
||||||
|
singlePage = input.singlePage
|
||||||
|
|
||||||
|
if m.top.cancel
|
||||||
|
contentNode.loadState = FeedLoadState.None
|
||||||
|
return invalid
|
||||||
|
end if
|
||||||
|
|
||||||
|
service = new Invidious.InvidiousService(invidiousNode)
|
||||||
|
instance = service.GetInstance()
|
||||||
|
|
||||||
|
while true
|
||||||
|
index = contentNode.getChildCount()
|
||||||
|
response = service.GetPlaylist(contentNode.playlistId, index, m.top.cancellation)
|
||||||
|
|
||||||
|
if m.top.cancel
|
||||||
|
contentNode.loadState = FeedLoadState.None
|
||||||
|
return invalid
|
||||||
|
end if
|
||||||
|
|
||||||
|
metadata = response.Json()
|
||||||
|
|
||||||
|
if not response.IsSuccess() or metadata = invalid
|
||||||
|
contentNode.loadState = FeedLoadState.Error
|
||||||
|
return {
|
||||||
|
success: false
|
||||||
|
error: response.ErrorMessage()
|
||||||
|
}
|
||||||
|
end if
|
||||||
|
|
||||||
|
InvidiousContent.ToPlaylistContentNode(contentNode, metadata, instance)
|
||||||
|
childCount = contentNode.getChildCount()
|
||||||
|
|
||||||
|
if metadata.videos.Count() = 0 or childCount >= metadata.videoCount
|
||||||
|
contentNode.loadState = FeedLoadState.Loaded
|
||||||
|
return {
|
||||||
|
success: true
|
||||||
|
}
|
||||||
|
else
|
||||||
|
contentNode.loadState = FeedLoadState.LoadedPage
|
||||||
|
if singlePage
|
||||||
|
return {
|
||||||
|
success: true
|
||||||
|
}
|
||||||
|
end if
|
||||||
|
end if
|
||||||
|
end while
|
||||||
|
|
||||||
|
return invalid
|
||||||
|
end function
|
||||||
@@ -5,8 +5,11 @@
|
|||||||
<field id="index" type="integer" value="-1" />
|
<field id="index" type="integer" value="-1" />
|
||||||
<!-- index in a feed -->
|
<!-- index in a feed -->
|
||||||
<field id="feedSourcesIndex" type="integer" value="-1" />
|
<field id="feedSourcesIndex" type="integer" value="-1" />
|
||||||
|
<!-- index in the queue -->
|
||||||
|
<field id="queueIndex" type="integer" value="-1" />
|
||||||
|
|
||||||
<field id="author" type="string" />
|
<!-- NOTE: "_author" not "author". See PlaylistContentNode.xml for explanation -->
|
||||||
|
<field id="_author" type="string" />
|
||||||
<field id="authorId" type="string" />
|
<field id="authorId" type="string" />
|
||||||
<field id="isUpcoming" type="boolean" />
|
<field id="isUpcoming" type="boolean" />
|
||||||
<field id="lengthSeconds" type="integer" />
|
<field id="lengthSeconds" type="integer" />
|
||||||
|
|||||||
@@ -163,6 +163,17 @@ function OnkeyEvent(key as string, press as boolean) as boolean
|
|||||||
Close()
|
Close()
|
||||||
return true
|
return true
|
||||||
end if
|
end if
|
||||||
|
|
||||||
|
if key = "up"
|
||||||
|
m.optionsList.jumpToItem = m.optionsList.content.getChildCount() - 1
|
||||||
|
return true
|
||||||
|
end if
|
||||||
|
|
||||||
|
if key = "down"
|
||||||
|
m.optionsList.jumpToItem = 0
|
||||||
|
return true
|
||||||
|
end if
|
||||||
|
|
||||||
return false
|
return false
|
||||||
end function
|
end function
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -31,7 +31,7 @@ namespace ContextMenuUtils
|
|||||||
if item.type = "video"
|
if item.type = "video"
|
||||||
LogInfo("Opening context menu for video:", item.videoId)
|
LogInfo("Opening context menu for video:", item.videoId)
|
||||||
title = item.title
|
title = item.title
|
||||||
subtitle = item.author
|
subtitle = item._author
|
||||||
thumbnail = item.thumbnail
|
thumbnail = item.thumbnail
|
||||||
else if item.type = "playlist"
|
else if item.type = "playlist"
|
||||||
LogInfo("Opening context menu for playlist:", item.playlistId)
|
LogInfo("Opening context menu for playlist:", item.playlistId)
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
<StdDlgTitleArea primaryTitle="Login to Invidious" />
|
<StdDlgTitleArea primaryTitle="Login to Invidious" />
|
||||||
<StdDlgContentArea>
|
<StdDlgContentArea>
|
||||||
<StdDlgTextItem
|
<StdDlgTextItem
|
||||||
text="Login to Invidious in order to view Subscriptions, Playlists, and use the Watch history." />
|
text="Login to Invidious in order to view Subscriptions, Playlists, and use the Watch history.

Please note that an Invidious account is different from a YouTube account." />
|
||||||
</StdDlgContentArea>
|
</StdDlgContentArea>
|
||||||
<StdDlgButtonArea id="buttonArea">
|
<StdDlgButtonArea id="buttonArea">
|
||||||
<StdDlgButton text="OK" />
|
<StdDlgButton text="OK" />
|
||||||
@@ -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,10 +1,9 @@
|
|||||||
import "pkg:/components/VideoPlayer/VideoUtils.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"
|
||||||
|
|
||||||
function InitEcpArgs()
|
function InitEcpArgs()
|
||||||
m.playQueue = m.top.findNode("PlayQueue")
|
m.videoQueue = m.top.findNode("VideoQueue")
|
||||||
LaunchArgumentsReceived()
|
LaunchArgumentsReceived()
|
||||||
|
|
||||||
m.scene.ObserveField("inputArgs", FuncName(InputArgumentsReceived))
|
m.scene.ObserveField("inputArgs", FuncName(InputArgumentsReceived))
|
||||||
@@ -46,6 +45,6 @@ function ProcessArguments(args as object) as void
|
|||||||
if args.timestamp <> invalid
|
if args.timestamp <> invalid
|
||||||
node.timestamp = args.timestamp
|
node.timestamp = args.timestamp
|
||||||
end if
|
end if
|
||||||
m.playQueue@.Play(node, -1)
|
m.videoQueue.playVideo = node
|
||||||
end if
|
end if
|
||||||
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"
|
||||||
@@ -15,7 +15,11 @@ function Init()
|
|||||||
|
|
||||||
m.port = port
|
m.port = port
|
||||||
|
|
||||||
StartLogger(m.top)
|
#if DEBUG
|
||||||
|
StartLogger(m.top, LogLevel.Debug)
|
||||||
|
#else
|
||||||
|
StartLogger(m.top, LogLevel.Info)
|
||||||
|
#end if
|
||||||
end function
|
end function
|
||||||
|
|
||||||
function StartLogger(logger as object, logLevel = LogLevel.Info as LogLevel) as void
|
function StartLogger(logger as object, logLevel = LogLevel.Info as LogLevel) as void
|
||||||
@@ -32,13 +36,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()
|
||||||
@@ -20,6 +21,12 @@ function MainSceneContainerChanged()
|
|||||||
end function
|
end function
|
||||||
|
|
||||||
function StartWebServer()
|
function StartWebServer()
|
||||||
|
m.loungeService = m.top.findNode("LoungeService")
|
||||||
|
m.loungeService@.StartService()
|
||||||
|
|
||||||
m.webServer = m.top.findNode("WebServer")
|
m.webServer = m.top.findNode("WebServer")
|
||||||
m.webServer@.StartServer()
|
m.webServer@.StartServer()
|
||||||
|
|
||||||
|
m.dialServer = m.top.findNode("DialServer")
|
||||||
|
m.dialServer@.StartServer()
|
||||||
end function
|
end function
|
||||||
@@ -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()
|
||||||
@@ -21,6 +22,11 @@ function MainSceneContainerChanged()
|
|||||||
end function
|
end function
|
||||||
|
|
||||||
function StartWebServer()
|
function StartWebServer()
|
||||||
|
m.loungeService = m.top.findNode("LoungeService")
|
||||||
|
m.loungeService.callfunc("StartService", invalid)
|
||||||
m.webServer = m.top.findNode("WebServer")
|
m.webServer = m.top.findNode("WebServer")
|
||||||
m.webServer.callfunc("StartServer", invalid)
|
m.webServer.callfunc("StartServer", invalid)
|
||||||
end function'//# sourceMappingURL=./MainScene.bs.map
|
m.dialServer = m.top.findNode("DialServer")
|
||||||
|
m.dialServer.callfunc("StartServer", invalid)
|
||||||
|
end function
|
||||||
|
'//# sourceMappingURL=./MainScene.brs.map
|
||||||
@@ -8,15 +8,14 @@
|
|||||||
</interface>
|
</interface>
|
||||||
<script type="text/brightscript" uri="pkg:/components/parts/AutoBind/AutoBind.part.brs" />
|
<script type="text/brightscript" uri="pkg:/components/parts/AutoBind/AutoBind.part.brs" />
|
||||||
<script type="text/brightscript" uri="pkg:/components/MainScene_bindings.brs" />
|
<script type="text/brightscript" uri="pkg:/components/MainScene_bindings.brs" />
|
||||||
|
<script type="text/brightscript" uri="pkg:/source/utils/NodePathUtils.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" />
|
||||||
<script type="text/brightscript" uri="pkg:/source/utils/Logging.brs" />
|
<script type="text/brightscript" uri="pkg:/source/utils/Logging.brs" />
|
||||||
<script type="text/brightscript" uri="pkg:/components/VideoPlayer/VideoUtils.brs" />
|
|
||||||
<script type="text/brightscript" uri="pkg:/source/utils/FocusManagement.brs" />
|
|
||||||
<script type="text/brightscript" uri="pkg:/components/Dialog/DialogUtils.brs" />
|
|
||||||
<script type="text/brightscript" uri="pkg:/source/bslib.brs" />
|
<script type="text/brightscript" uri="pkg:/source/bslib.brs" />
|
||||||
<children>
|
<children>
|
||||||
<Logger id="Logger" />
|
<Logger id="Logger" />
|
||||||
@@ -29,7 +28,7 @@
|
|||||||
<NavBarItem screen="HomeScreen" text="Home" icon="pkg:/images/icons/home.png" />
|
<NavBarItem screen="HomeScreen" text="Home" icon="pkg:/images/icons/home.png" />
|
||||||
<NavBarItem screen="BookmarksScreen" text="Bookmarks" icon="pkg:/images/icons/star.png" />
|
<NavBarItem screen="BookmarksScreen" text="Bookmarks" icon="pkg:/images/icons/star.png" />
|
||||||
<NavBarItem screen="SettingsScreen" text="Settings" icon="pkg:/images/icons/settings.png" />
|
<NavBarItem screen="SettingsScreen" text="Settings" icon="pkg:/images/icons/settings.png" />
|
||||||
<NavBarItem screen="WebAppScreen" text="Web App" icon="pkg:/images/icons/phone.png" />
|
<NavBarItem screen="RemoteScreen" text="Remote" icon="pkg:/images/icons/phone.png" />
|
||||||
<NavBarItem screen="AppInfoScreen" text="Info" icon="pkg:/images/icons/info.png" />
|
<NavBarItem screen="AppInfoScreen" text="Info" icon="pkg:/images/icons/info.png" />
|
||||||
</ContentNode>
|
</ContentNode>
|
||||||
</NavBar>
|
</NavBar>
|
||||||
@@ -37,13 +36,15 @@
|
|||||||
</Group>
|
</Group>
|
||||||
<VideoContainer id="VideoContainer" />
|
<VideoContainer id="VideoContainer" />
|
||||||
<Group id="Notifications" />
|
<Group id="Notifications" />
|
||||||
<PlayQueue id="PlayQueue" />
|
<VideoQueue id="VideoQueue" />
|
||||||
<ApplicationInfo id="ApplicationInfo" />
|
<ApplicationInfo id="ApplicationInfo" />
|
||||||
<Preferences id="Preferences" />
|
<Preferences id="Preferences" />
|
||||||
<Bookmarks id="Bookmarks" />
|
<Bookmarks id="Bookmarks" />
|
||||||
<SearchHistory id="SearchHistory" />
|
<SearchHistory id="SearchHistory" />
|
||||||
<Invidious id="Invidious" />
|
<Invidious id="Invidious" />
|
||||||
<PlayletWebServer id="WebServer" port="8888" />
|
<PlayletWebServer id="WebServer" port="8888" />
|
||||||
|
<DialServer id="DialServer" />
|
||||||
|
<LoungeService id="LoungeService" />
|
||||||
</AppController>
|
</AppController>
|
||||||
</children>
|
</children>
|
||||||
</component>
|
</component>
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<AppController id="AppController"
|
<AppController id="AppController"
|
||||||
root="bind:./AppRoot"
|
root="bind:./AppRoot"
|
||||||
stack="bind:./Stack"
|
stack="bind:./Stack"
|
||||||
playQueue="bind:./PlayQueue">
|
videoQueue="bind:./VideoQueue">
|
||||||
<Group id="Stack">
|
<Group id="Stack">
|
||||||
<AppRoot id="AppRoot">
|
<AppRoot id="AppRoot">
|
||||||
<NavBar id="NavBar" focusIndex="1" appController="bind:/AppController">
|
<NavBar id="NavBar" focusIndex="1" appController="bind:/AppController">
|
||||||
@@ -31,8 +31,8 @@
|
|||||||
icon="pkg:/images/icons/settings.png">
|
icon="pkg:/images/icons/settings.png">
|
||||||
</NavBarItem>
|
</NavBarItem>
|
||||||
<NavBarItem
|
<NavBarItem
|
||||||
screen="WebAppScreen"
|
screen="RemoteScreen"
|
||||||
text="Web App"
|
text="Remote"
|
||||||
icon="pkg:/images/icons/phone.png">
|
icon="pkg:/images/icons/phone.png">
|
||||||
</NavBarItem>
|
</NavBarItem>
|
||||||
<NavBarItem
|
<NavBarItem
|
||||||
@@ -49,10 +49,14 @@
|
|||||||
<Group id="Notifications" />
|
<Group id="Notifications" />
|
||||||
|
|
||||||
<!-- No render nodes -->
|
<!-- No render nodes -->
|
||||||
<PlayQueue id="PlayQueue"
|
<VideoQueue id="VideoQueue"
|
||||||
|
appController="bind:/AppController"
|
||||||
|
videoContainer="bind:../VideoContainer"
|
||||||
invidious="bind:../Invidious"
|
invidious="bind:../Invidious"
|
||||||
notifications="bind:../Notifications"
|
notifications="bind:../Notifications"
|
||||||
preferences="bind:../Preferences" />
|
preferences="bind:../Preferences"
|
||||||
|
loungeService="bind:../LoungeService" />
|
||||||
|
|
||||||
<ApplicationInfo id="ApplicationInfo" />
|
<ApplicationInfo id="ApplicationInfo" />
|
||||||
<Preferences id="Preferences" />
|
<Preferences id="Preferences" />
|
||||||
<Bookmarks id="Bookmarks" />
|
<Bookmarks id="Bookmarks" />
|
||||||
@@ -64,15 +68,23 @@
|
|||||||
applicationInfo="bind:../ApplicationInfo"
|
applicationInfo="bind:../ApplicationInfo"
|
||||||
preferences="bind:../Preferences" />
|
preferences="bind:../Preferences" />
|
||||||
|
|
||||||
<PlayletWebServer
|
<!-- Tasks -->
|
||||||
id="WebServer"
|
<PlayletWebServer id="WebServer"
|
||||||
port="8888"
|
port="8888"
|
||||||
appController="bind:/AppController"
|
appController="bind:/AppController"
|
||||||
applicationInfo="bind:../ApplicationInfo"
|
applicationInfo="bind:../ApplicationInfo"
|
||||||
invidious="bind:../Invidious"
|
invidious="bind:../Invidious"
|
||||||
preferences="bind:../Preferences"
|
preferences="bind:../Preferences"
|
||||||
playQueue="bind:../PlayQueue"
|
videoQueue="bind:../VideoQueue"
|
||||||
bookmarks="bind:../Bookmarks" />
|
bookmarks="bind:../Bookmarks"
|
||||||
|
loungeService="bind:../LoungeService" />
|
||||||
|
<DialServer id="DialServer"
|
||||||
|
webServer="bind:../WebServer"
|
||||||
|
loungeService="bind:../LoungeService" />
|
||||||
|
<LoungeService id="LoungeService"
|
||||||
|
videoQueue="bind:../VideoQueue"
|
||||||
|
notifications="bind:../Notifications"
|
||||||
|
invidious="bind:../Invidious" />
|
||||||
</AppController>
|
</AppController>
|
||||||
</children>
|
</children>
|
||||||
</component>
|
</component>
|
||||||
@@ -8,15 +8,18 @@ function InitializeBindings()
|
|||||||
"AppController": {
|
"AppController": {
|
||||||
"root": "./AppRoot",
|
"root": "./AppRoot",
|
||||||
"stack": "./Stack",
|
"stack": "./Stack",
|
||||||
"playQueue": "./PlayQueue"
|
"videoQueue": "./VideoQueue"
|
||||||
},
|
},
|
||||||
"NavBar": {
|
"NavBar": {
|
||||||
"appController": "/AppController"
|
"appController": "/AppController"
|
||||||
},
|
},
|
||||||
"PlayQueue": {
|
"VideoQueue": {
|
||||||
|
"appController": "/AppController",
|
||||||
|
"videoContainer": "../VideoContainer",
|
||||||
"invidious": "../Invidious",
|
"invidious": "../Invidious",
|
||||||
"notifications": "../Notifications",
|
"notifications": "../Notifications",
|
||||||
"preferences": "../Preferences"
|
"preferences": "../Preferences",
|
||||||
|
"loungeService": "../LoungeService"
|
||||||
},
|
},
|
||||||
"SearchHistory": {
|
"SearchHistory": {
|
||||||
"preferences": "../Preferences"
|
"preferences": "../Preferences"
|
||||||
@@ -31,9 +34,20 @@ function InitializeBindings()
|
|||||||
"applicationInfo": "../ApplicationInfo",
|
"applicationInfo": "../ApplicationInfo",
|
||||||
"invidious": "../Invidious",
|
"invidious": "../Invidious",
|
||||||
"preferences": "../Preferences",
|
"preferences": "../Preferences",
|
||||||
"playQueue": "../PlayQueue",
|
"videoQueue": "../VideoQueue",
|
||||||
"bookmarks": "../Bookmarks"
|
"bookmarks": "../Bookmarks",
|
||||||
|
"loungeService": "../LoungeService"
|
||||||
|
},
|
||||||
|
"DialServer": {
|
||||||
|
"webServer": "../WebServer",
|
||||||
|
"loungeService": "../LoungeService"
|
||||||
|
},
|
||||||
|
"LoungeService": {
|
||||||
|
"videoQueue": "../VideoQueue",
|
||||||
|
"notifications": "../Notifications",
|
||||||
|
"invidious": "../Invidious"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
end function'//# sourceMappingURL=./MainScene_bindings.bs.map
|
end function
|
||||||
|
'//# sourceMappingURL=./MainScene_bindings.brs.map
|
||||||
@@ -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,5 +0,0 @@
|
|||||||
<component name="ContentNodeReference" extends="ContentNode">
|
|
||||||
<interface>
|
|
||||||
<field id="refNode" type="node" />
|
|
||||||
</interface>
|
|
||||||
</component>
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
' NodeByRef: these functions provides the ability to "wrap" a node in
|
|
||||||
' another node, so it can be passed by reference. This is useful for
|
|
||||||
' when a node is required to be a child of multiple nodes at once,
|
|
||||||
' which is not possible.
|
|
||||||
' Instead, the node is wrapped, passed around, and unwrapped when needed.
|
|
||||||
import "pkg:/source/utils/StringUtils.bs"
|
|
||||||
|
|
||||||
namespace NodeByRef
|
|
||||||
|
|
||||||
function Wrap(node as object) as object
|
|
||||||
if node = invalid
|
|
||||||
return invalid
|
|
||||||
end if
|
|
||||||
|
|
||||||
if node.refNode <> invalid
|
|
||||||
return node
|
|
||||||
end if
|
|
||||||
|
|
||||||
ref = CreateObject("roSGNode", "ContentNodeReference")
|
|
||||||
ref.refNode = node
|
|
||||||
if not StringUtils.IsNullOrEmpty(node.id)
|
|
||||||
ref.id = node.id + "-ref"
|
|
||||||
end if
|
|
||||||
return ref
|
|
||||||
end function
|
|
||||||
|
|
||||||
function Unwrap(node as object) as object
|
|
||||||
if node = invalid
|
|
||||||
return invalid
|
|
||||||
end if
|
|
||||||
|
|
||||||
loopGuard = 0
|
|
||||||
while node.refNode <> invalid and loopGuard < 10
|
|
||||||
node = node.refNode
|
|
||||||
loopGuard += 1
|
|
||||||
end while
|
|
||||||
|
|
||||||
return node
|
|
||||||
end function
|
|
||||||
|
|
||||||
end namespace
|
|
||||||
@@ -1,221 +0,0 @@
|
|||||||
import "pkg:/components/Dialog/DialogUtils.bs"
|
|
||||||
import "pkg:/components/NodeByRef/NodeByRef.bs"
|
|
||||||
import "pkg:/components/PlaylistView/PlaylistContentTask.bs"
|
|
||||||
import "pkg:/components/PlayQueue/Notifications/PlayQueueNotificationUtils.bs"
|
|
||||||
import "pkg:/components/VideoFeed/FeedLoadState.bs"
|
|
||||||
import "pkg:/components/VideoPlayer/VideoUtils.bs"
|
|
||||||
import "pkg:/source/asyncTask/asyncTask.bs"
|
|
||||||
import "pkg:/source/utils/ArrayUtils.bs"
|
|
||||||
import "pkg:/source/utils/ErrorUtils.bs"
|
|
||||||
import "pkg:/source/utils/Logging.bs"
|
|
||||||
import "pkg:/source/utils/Types.bs"
|
|
||||||
|
|
||||||
' TODO:P1 prevent adding duplicates of the same video/playlist
|
|
||||||
function Init()
|
|
||||||
m.pendingLoadTasks = {}
|
|
||||||
m.content = m.top.findNode("Content")
|
|
||||||
m.top.content = m.content
|
|
||||||
m.content.addField("index", "integer", false)
|
|
||||||
m.content.index = m.top.index
|
|
||||||
end function
|
|
||||||
|
|
||||||
function Play(node as object, playlistIndex as integer)
|
|
||||||
m.top.index += 1
|
|
||||||
m.top.playlistIndex = playlistIndex
|
|
||||||
|
|
||||||
node = WrapWithIndexField(node)
|
|
||||||
if m.top.index >= m.content.getChildCount()
|
|
||||||
m.content.appendChild(node)
|
|
||||||
m.top.index = m.content.getChildCount() - 1
|
|
||||||
else
|
|
||||||
m.content.insertChild(node, m.top.index)
|
|
||||||
end if
|
|
||||||
|
|
||||||
PlayItemAtCurrentIndex()
|
|
||||||
end function
|
|
||||||
|
|
||||||
function AddToQueue(node as object)
|
|
||||||
node = WrapWithIndexField(node)
|
|
||||||
m.content.appendChild(node)
|
|
||||||
queueNotifications = m.top.preferences["misc.queue_notifications"]
|
|
||||||
if queueNotifications
|
|
||||||
PlayQueue.ShowNotifcation(m.top.notifications, node)
|
|
||||||
end if
|
|
||||||
end function
|
|
||||||
|
|
||||||
function WrapWithIndexField(node as object) as object
|
|
||||||
node = NodeByRef.Wrap(node)
|
|
||||||
if not node.hasField("index")
|
|
||||||
node.addField("index", "integer", false)
|
|
||||||
end if
|
|
||||||
node.index = m.top.index
|
|
||||||
return node
|
|
||||||
end function
|
|
||||||
|
|
||||||
' TODO:P0 better model of the queue (Now playing, etc)
|
|
||||||
function GetQueue(unused as dynamic) as object
|
|
||||||
queueNodes = m.content.getChildren(-1, 0)
|
|
||||||
items = []
|
|
||||||
for each node in queueNodes
|
|
||||||
node = NodeByRef.Unwrap(node)
|
|
||||||
if node = invalid
|
|
||||||
continue for
|
|
||||||
end if
|
|
||||||
|
|
||||||
nodeType = node.type
|
|
||||||
if nodeType = "video"
|
|
||||||
items.push({
|
|
||||||
type: nodeType,
|
|
||||||
videoId: node.videoId,
|
|
||||||
title: node.title,
|
|
||||||
author: node.author,
|
|
||||||
thumbnail: node.thumbnail
|
|
||||||
})
|
|
||||||
else if node.type = "playlist"
|
|
||||||
items.push({
|
|
||||||
type: nodeType,
|
|
||||||
playlistId: node.playlistId,
|
|
||||||
title: node.title,
|
|
||||||
thumbnail: node.thumbnail,
|
|
||||||
videoCountText: node.videoCountText
|
|
||||||
})
|
|
||||||
end if
|
|
||||||
end for
|
|
||||||
|
|
||||||
return {
|
|
||||||
index: m.top.index,
|
|
||||||
playlistIndex: m.top.playlistIndex,
|
|
||||||
items: items
|
|
||||||
}
|
|
||||||
end function
|
|
||||||
|
|
||||||
function Clear(unused as dynamic)
|
|
||||||
m.content.removeChildrenIndex(m.content.getChildCount(), 0)
|
|
||||||
m.top.index = -1
|
|
||||||
m.top.playlistIndex = -1
|
|
||||||
end function
|
|
||||||
|
|
||||||
function PlayNextItem(unused as dynamic) as boolean
|
|
||||||
childCount = m.content.getChildCount()
|
|
||||||
if childCount = 0
|
|
||||||
return false
|
|
||||||
end if
|
|
||||||
|
|
||||||
index = m.top.index
|
|
||||||
if index <> -1
|
|
||||||
if index >= childCount
|
|
||||||
return false
|
|
||||||
end if
|
|
||||||
node = m.content.getChild(index)
|
|
||||||
node = NodeByRef.Unwrap(node)
|
|
||||||
if node.type = "playlist"
|
|
||||||
m.top.playlistIndex += 1
|
|
||||||
if PlayPlaylistAtCurrentIndex(node)
|
|
||||||
return true
|
|
||||||
end if
|
|
||||||
end if
|
|
||||||
end if
|
|
||||||
|
|
||||||
m.top.index += 1
|
|
||||||
m.top.playlistIndex = -1
|
|
||||||
if m.top.index >= childCount
|
|
||||||
return false
|
|
||||||
end if
|
|
||||||
|
|
||||||
return PlayItemAtCurrentIndex()
|
|
||||||
end function
|
|
||||||
|
|
||||||
function PlayItemAtIndex(index as integer) as boolean
|
|
||||||
m.top.index = index
|
|
||||||
m.top.playlistIndex = -1
|
|
||||||
return PlayItemAtCurrentIndex()
|
|
||||||
end function
|
|
||||||
|
|
||||||
function PlayItemAtCurrentIndex() as boolean
|
|
||||||
node = m.content.getChild(m.top.index)
|
|
||||||
node = NodeByRef.Unwrap(node)
|
|
||||||
if node = invalid
|
|
||||||
return false
|
|
||||||
end if
|
|
||||||
if node.type = "video"
|
|
||||||
VideoUtils.PlayVideo(node)
|
|
||||||
return true
|
|
||||||
else if node.type = "playlist"
|
|
||||||
if m.top.playlistIndex = -1
|
|
||||||
m.top.playlistIndex = 0
|
|
||||||
end if
|
|
||||||
return PlayPlaylistAtCurrentIndex(node)
|
|
||||||
end if
|
|
||||||
return false
|
|
||||||
end function
|
|
||||||
|
|
||||||
function PlayPlaylistAtCurrentIndex(playlist as object) as boolean
|
|
||||||
playlist = NodeByRef.Unwrap(playlist)
|
|
||||||
if playlist.videoCount < 0
|
|
||||||
LoadPlaylist(playlist)
|
|
||||||
return true
|
|
||||||
end if
|
|
||||||
playlistIndex = m.top.playlistIndex
|
|
||||||
if playlistIndex < 0 or playlistIndex >= playlist.videoCount
|
|
||||||
return false
|
|
||||||
end if
|
|
||||||
|
|
||||||
if playlistIndex < playlist.getChildCount()
|
|
||||||
child = playlist.getChild(playlistIndex)
|
|
||||||
VideoUtils.PlayVideo(child)
|
|
||||||
return true
|
|
||||||
end if
|
|
||||||
|
|
||||||
LoadPlaylist(playlist)
|
|
||||||
return true
|
|
||||||
end function
|
|
||||||
|
|
||||||
function LoadPlaylist(playlist as object) as void
|
|
||||||
if playlist.loadState = FeedLoadState.Loading
|
|
||||||
return
|
|
||||||
end if
|
|
||||||
|
|
||||||
playlist.loadState = FeedLoadState.Loading
|
|
||||||
|
|
||||||
task = StartAsyncTask(PlaylistContentTask, {
|
|
||||||
content: playlist,
|
|
||||||
invidious: m.top.invidious
|
|
||||||
}, OnPlaylistContentTaskResult)
|
|
||||||
m.pendingLoadTasks[task.id] = task
|
|
||||||
end function
|
|
||||||
|
|
||||||
function OnPlaylistContentTaskResult(output as object) as void
|
|
||||||
m.pendingLoadTasks.Delete(output.task.id)
|
|
||||||
|
|
||||||
if output.cancelled
|
|
||||||
return
|
|
||||||
end if
|
|
||||||
|
|
||||||
playlist = output.task.input.content
|
|
||||||
if not output.success or not output.result.success
|
|
||||||
' output.error for unhandled exception
|
|
||||||
error = output.error
|
|
||||||
if error = invalid
|
|
||||||
' output.result.error for network errors
|
|
||||||
error = output.result.error
|
|
||||||
end if
|
|
||||||
error = ErrorUtils.Format(error)
|
|
||||||
LogError(error)
|
|
||||||
playlistId = playlist.playlistId
|
|
||||||
message = `Failed to load playlist ${playlistId}\n${error}`
|
|
||||||
' TODO:P1 play next upon closing the dialog
|
|
||||||
DialogUtils.ShowDialog(message, "Playlist load fail", true)
|
|
||||||
return
|
|
||||||
end if
|
|
||||||
|
|
||||||
PlayPlaylistAtCurrentIndex(playlist)
|
|
||||||
end function
|
|
||||||
|
|
||||||
function OnIndexChange()
|
|
||||||
index = m.top.index
|
|
||||||
m.content.index = index
|
|
||||||
children = m.top.content.getChildren(-1, 0)
|
|
||||||
for each child in children
|
|
||||||
child.index = index
|
|
||||||
end for
|
|
||||||
end function
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
<component name="PlayQueue" extends="Node">
|
|
||||||
<interface>
|
|
||||||
<field id="content" type="node" />
|
|
||||||
<field id="index" type="integer" value="-1" onChange="OnIndexChange" />
|
|
||||||
<field id="playlistIndex" type="integer" value="-1" />
|
|
||||||
<field id="invidious" type="node" />
|
|
||||||
<field id="notifications" type="node" />
|
|
||||||
<field id="preferences" type="node" />
|
|
||||||
<function name="Play" />
|
|
||||||
<function name="AddToQueue" />
|
|
||||||
<function name="GetQueue" />
|
|
||||||
<function name="Clear" />
|
|
||||||
<function name="PlayNextItem" />
|
|
||||||
<function name="PlayItemAtIndex" />
|
|
||||||
</interface>
|
|
||||||
<children>
|
|
||||||
<ContentNode id="Content" />
|
|
||||||
</children>
|
|
||||||
</component>
|
|
||||||
@@ -1,83 +0,0 @@
|
|||||||
import "pkg:/components/Navigation/Navigation.bs"
|
|
||||||
import "pkg:/source/utils/FocusManagement.bs"
|
|
||||||
import "pkg:/source/utils/Types.bs"
|
|
||||||
|
|
||||||
function Init()
|
|
||||||
m.queueList = m.top.findNode("queueList")
|
|
||||||
m.queueLabel = m.top.findNode("queueLabel")
|
|
||||||
m.clearButton = m.top.findNode("clearButton")
|
|
||||||
m.showAnimation = m.top.findNode("showAnimation")
|
|
||||||
|
|
||||||
m.clearButton.ObserveField("buttonSelected", FuncName(OnClearButtonSelected))
|
|
||||||
m.queueList.ObserveField("itemSelected", FuncName(OnItemSelected))
|
|
||||||
|
|
||||||
SetNavigation(m.queueList, "up", m.clearButton)
|
|
||||||
SetNavigation(m.clearButton, "down", m.queueList)
|
|
||||||
end function
|
|
||||||
|
|
||||||
function Show(unsued as dynamic)
|
|
||||||
m.showAnimation.control = "start"
|
|
||||||
end function
|
|
||||||
|
|
||||||
function OnFocusChange() as void
|
|
||||||
if not m.top.focus
|
|
||||||
return
|
|
||||||
end if
|
|
||||||
NodeSetFocus(m.queueList, true)
|
|
||||||
end function
|
|
||||||
|
|
||||||
function OnContentSet() as void
|
|
||||||
content = m.top.content
|
|
||||||
if content = invalid
|
|
||||||
return
|
|
||||||
end if
|
|
||||||
|
|
||||||
if not content.isSameNode(m.queueList.content)
|
|
||||||
m.queueList.content = content
|
|
||||||
end if
|
|
||||||
|
|
||||||
index = content.index
|
|
||||||
if IsInt(index) and index <> -1
|
|
||||||
m.queueLabel.text = `Queue (${index + 1}/${content.getChildCount()})`
|
|
||||||
else
|
|
||||||
m.queueLabel.text = `Queue (${content.getChildCount()})`
|
|
||||||
end if
|
|
||||||
end function
|
|
||||||
|
|
||||||
function OnkeyEvent(key as string, press as boolean) as boolean
|
|
||||||
if NavigationKeyHandler(key, press).handled
|
|
||||||
return true
|
|
||||||
end if
|
|
||||||
|
|
||||||
if press = false
|
|
||||||
return false
|
|
||||||
end if
|
|
||||||
|
|
||||||
if key = "back"
|
|
||||||
Close()
|
|
||||||
return true
|
|
||||||
end if
|
|
||||||
return false
|
|
||||||
end function
|
|
||||||
|
|
||||||
function Close()
|
|
||||||
m.top.appController@.PopScreen()
|
|
||||||
end function
|
|
||||||
|
|
||||||
function OnClearButtonSelected()
|
|
||||||
m.top.playQueue@.Clear()
|
|
||||||
end function
|
|
||||||
|
|
||||||
function OnItemSelected() as void
|
|
||||||
content = m.queueList.content
|
|
||||||
if content = invalid
|
|
||||||
return
|
|
||||||
end if
|
|
||||||
|
|
||||||
index = m.queueList.itemSelected
|
|
||||||
if index < 0 or index >= content.getChildCount()
|
|
||||||
return
|
|
||||||
end if
|
|
||||||
|
|
||||||
m.top.playQueue@.PlayItemAtIndex(index)
|
|
||||||
end function
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
import "pkg:/components/Services/Invidious/InvidiousToContentNode.bs"
|
|
||||||
|
|
||||||
namespace PlayQueueViewUtils
|
|
||||||
|
|
||||||
function Open(playQueue as object, appController as object) as object
|
|
||||||
playQueueView = CreateObject("roSGNode", "PlayQueueView")
|
|
||||||
playQueueView.appController = appController
|
|
||||||
playQueueView.playQueue = playQueue
|
|
||||||
appController@.PushScreen(playQueueView)
|
|
||||||
|
|
||||||
content = playQueue.content
|
|
||||||
index = playQueue.index
|
|
||||||
|
|
||||||
playQueueView.content = content
|
|
||||||
if index > -1 and index < content.GetChildCount()
|
|
||||||
playQueueView.jumpToItem = index
|
|
||||||
end if
|
|
||||||
|
|
||||||
playQueueView@.Show()
|
|
||||||
return playQueueView
|
|
||||||
end function
|
|
||||||
|
|
||||||
end namespace
|
|
||||||
@@ -1,48 +0,0 @@
|
|||||||
import "pkg:/components/Services/Invidious/InvidiousService.bs"
|
|
||||||
import "pkg:/components/Services/Invidious/InvidiousToContentNode.bs"
|
|
||||||
|
|
||||||
' TODO:P1 this should only be called from PlaylistContentNode.bs
|
|
||||||
@asynctask
|
|
||||||
function PlaylistContentTask(input as object) as object
|
|
||||||
contentNode = input.content
|
|
||||||
invidiousNode = input.invidious
|
|
||||||
|
|
||||||
if m.top.cancel
|
|
||||||
contentNode.loadState = FeedLoadState.None
|
|
||||||
return invalid
|
|
||||||
end if
|
|
||||||
|
|
||||||
service = new Invidious.InvidiousService(invidiousNode)
|
|
||||||
|
|
||||||
index = contentNode.getChildCount()
|
|
||||||
response = service.GetPlaylist(contentNode.playlistId, index, m.top.cancellation)
|
|
||||||
|
|
||||||
if m.top.cancel
|
|
||||||
contentNode.loadState = FeedLoadState.None
|
|
||||||
return invalid
|
|
||||||
end if
|
|
||||||
|
|
||||||
metadata = response.Json()
|
|
||||||
|
|
||||||
if not response.IsSuccess() or metadata = invalid
|
|
||||||
contentNode.loadState = FeedLoadState.Error
|
|
||||||
return {
|
|
||||||
success: false,
|
|
||||||
error: response.ErrorMessage()
|
|
||||||
}
|
|
||||||
end if
|
|
||||||
|
|
||||||
instance = service.GetInstance()
|
|
||||||
InvidiousContent.ToPlaylistContentNode(contentNode, metadata, instance)
|
|
||||||
|
|
||||||
childCount = contentNode.getChildCount()
|
|
||||||
if metadata.videos.Count() > 0 or childCount < metadata.videoCount
|
|
||||||
contentNode.loadState = FeedLoadState.LoadedPage
|
|
||||||
else
|
|
||||||
contentNode.loadState = FeedLoadState.Loaded
|
|
||||||
end if
|
|
||||||
|
|
||||||
return {
|
|
||||||
success: true
|
|
||||||
}
|
|
||||||
end function
|
|
||||||
@@ -2,10 +2,10 @@ 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:/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"
|
||||||
@@ -116,7 +116,10 @@ function OnItemSelected(index as integer) as void
|
|||||||
videoId = video.videoId
|
videoId = video.videoId
|
||||||
if not StringUtils.IsNullOrEmpty(videoId)
|
if not StringUtils.IsNullOrEmpty(videoId)
|
||||||
LogInfo("Play playlist:", playlistId, "video:", videoId)
|
LogInfo("Play playlist:", playlistId, "video:", videoId)
|
||||||
m.playQueue@.Play(playlist, index)
|
m.videoQueue.playPlaylist = {
|
||||||
|
playlistNode: playlist
|
||||||
|
playlistIndex: index
|
||||||
|
}
|
||||||
end if
|
end if
|
||||||
end function
|
end function
|
||||||
|
|
||||||
@@ -164,10 +167,10 @@ function GetContextMenuOptionsForItem(video as object) as object
|
|||||||
end if
|
end if
|
||||||
|
|
||||||
options = [
|
options = [
|
||||||
ContextMenuUtils.CreateOption("Play", m.playQueue, "Play", [playlist, index]),
|
ContextMenuUtils.CreateOption("Play", m.videoQueue, "FuncPlayPlaylist", [playlist, index]),
|
||||||
ContextMenuUtils.CreateOption("Queue", m.playQueue, "AddToQueue", [playlist])
|
ContextMenuUtils.CreateOption("Queue", m.videoQueue, "FuncAddToQueuePlaylist", [playlist])
|
||||||
ContextMenuUtils.CreateOption("Play video", m.playQueue, "Play", [video, -1]),
|
ContextMenuUtils.CreateOption("Play video", m.videoQueue, "FuncPlayVideo", [video]),
|
||||||
ContextMenuUtils.CreateOption("Queue video", m.playQueue, "AddToQueue", [video]),
|
ContextMenuUtils.CreateOption("Queue video", m.videoQueue, "FuncAddToQueueVideo", [video]),
|
||||||
]
|
]
|
||||||
|
|
||||||
if not StringUtils.IsNullOrEmpty(playlist.authorId)
|
if not StringUtils.IsNullOrEmpty(playlist.authorId)
|
||||||
@@ -213,42 +216,5 @@ function LoadPlaylistIfNeeded() as void
|
|||||||
return
|
return
|
||||||
end if
|
end if
|
||||||
|
|
||||||
LoadPlaylist()
|
m.top.content@.LoadPlaylistPage(m.top.invidious)
|
||||||
end function
|
|
||||||
|
|
||||||
function LoadPlaylist() as void
|
|
||||||
if m.playlistLoadTask <> invalid
|
|
||||||
m.playlistLoadTask.cancel = true
|
|
||||||
end if
|
|
||||||
|
|
||||||
m.top.content.loadState = FeedLoadState.Loading
|
|
||||||
m.playlistLoadTask = StartAsyncTask(PlaylistContentTask, {
|
|
||||||
content: m.top.content,
|
|
||||||
invidious: m.top.invidious
|
|
||||||
}, OnPlaylistContentTaskResult)
|
|
||||||
end function
|
|
||||||
|
|
||||||
function OnPlaylistContentTaskResult(output as object) as void
|
|
||||||
m.playlistLoadTask = invalid
|
|
||||||
|
|
||||||
if output.cancelled
|
|
||||||
return
|
|
||||||
end if
|
|
||||||
|
|
||||||
if not output.success or not output.result.success
|
|
||||||
' output.error for unhandled exception
|
|
||||||
error = output.error
|
|
||||||
if error = invalid
|
|
||||||
' output.result.error for network errors
|
|
||||||
error = output.result.error
|
|
||||||
end if
|
|
||||||
error = ErrorUtils.Format(error)
|
|
||||||
LogError(error)
|
|
||||||
playlistId = output.task.input.content.playlistId
|
|
||||||
message = `Failed to load playlist ${playlistId}\n${error}`
|
|
||||||
DialogUtils.ShowDialog(message, "Playlist load fail", true)
|
|
||||||
return
|
|
||||||
end if
|
|
||||||
|
|
||||||
LoadPlaylistIfNeeded()
|
|
||||||
end function
|
end function
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
<field id="content" type="node" onChange="OnContentSet" />
|
<field id="content" type="node" onChange="OnContentSet" />
|
||||||
<field id="appController" type="node" bind="/AppController" />
|
<field id="appController" type="node" bind="/AppController" />
|
||||||
<field id="invidious" type="node" bind="/Invidious" />
|
<field id="invidious" type="node" bind="/Invidious" />
|
||||||
<field id="playQueue" type="node" bind="/PlayQueue" />
|
<field id="videoQueue" type="node" bind="/VideoQueue" />
|
||||||
<field id="bookmarks" type="node" bind="/Bookmarks" />
|
<field id="bookmarks" type="node" bind="/Bookmarks" />
|
||||||
<function name="OpenPlaylistChannel" />
|
<function name="OpenPlaylistChannel" />
|
||||||
</interface>
|
</interface>
|
||||||
|
|||||||
@@ -14,7 +14,8 @@ function OnContentSet() as void
|
|||||||
end if
|
end if
|
||||||
|
|
||||||
m.top.title = content.title
|
m.top.title = content.title
|
||||||
m.top.author = content.author
|
' NOTE: "_author" not "author". See PlaylistContentNode.xml for explanation.
|
||||||
|
m.top.author = content._author
|
||||||
m.top.thumbnailUri = content.thumbnail
|
m.top.thumbnailUri = content.thumbnail
|
||||||
|
|
||||||
if ValidInt(content.lengthSeconds) <> 0
|
if ValidInt(content.lengthSeconds) <> 0
|
||||||
|
|||||||
@@ -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
|
||||||