Compare commits

...
259 Commits
Author SHA1 Message Date
Brahim Hadriche 9df1b70e49 Release v0.19.0 (#258) 2024-01-10 17:12:53 -05:00
Brahim Hadriche bb471a5cde Sponsorblock tweak 2024-01-09 23:09:47 -05:00
Brahim Hadriche b68aad7d4a Add links to internal state 2024-01-09 22:08:23 -05:00
Brahim Hadriche 73b6314ec7 Add app logs to log file
Refactor a new functions by adding name spaces
Startup times are now logged
2024-01-09 14:19:54 -05:00
Brahim Hadriche 29969db3e4 use location hash to store current tab 2024-01-08 20:42:39 -05:00
Brahim Hadriche 5335a0273b Feature/optimize task imports (#257)
* Prune empty code files

* delete file

* Restore

* refactor

* fix warnings

* Fix tasks

* Add diag

* tweak

* Log load times

* changelog
2024-01-08 19:38:39 -05:00
Brahim Hadriche 641c9ef5bf setting description tweak 2024-01-07 22:39:27 -05:00
Brahim Hadriche b0257d97e0 [skip ci] docs 2024-01-07 22:24:20 -05:00
Brahim Hadriche 5c9c1c204f [skip ci] plugin docs 2024-01-07 22:16:14 -05:00
Brahim Hadriche 11afc34ecc [skip ci] typo 2024-01-07 19:06:13 -05:00
Brahim Hadriche 3edfce1366 Fix for bookmarked invalid videos (#255)
* Fix for bookmarked invalid videos

* Update InvidiousService.bs

* Change status code
2024-01-07 16:48:58 -05:00
Brahim Hadriche 5ff02af7ac Remove deprecated related channels leftover 2024-01-07 16:40:55 -05:00
Brahim Hadriche 0cc8cdf2be [skip ci] add close button to layout editor in web app 2024-01-07 11:48:00 -05:00
Brahim Hadriche 3ecac831bf [skip ci] warn on failed requests 2024-01-07 11:21:07 -05:00
Brahim Hadriche 86d5710969 Fix HTTP/0.9 when not allowed errors (#253)
* Fix `HTTP/0.9 when not allowed` errors

* tweak retry callback

* throw ex in debug mode
2024-01-07 11:17:05 -05:00
Brahim Hadriche 575935f5ac Generate type validation functions (#254) 2024-01-07 11:08:03 -05:00
Brahim Hadriche 7eb20dfe2c [skip ci] comment 2024-01-06 18:55:59 -05:00
Brahim Hadriche 0b01830ad9 changelog edit 2024-01-06 18:31:46 -05:00
33fdf796a2 update dependencies (#251)
Co-authored-by: iBicha <iBicha@users.noreply.github.com>
Co-authored-by: Brahim Hadriche <brahim.hadriche@gmail.com>
2024-01-06 18:24:51 -05:00
Brahim Hadricheandgithub-action linter fd7bdde733 Customize home screen (#250)
* Customize home screen

* remove logs

* Lint fix

* move func

* Fix for checklist

* Fix save state

* open api

* Fix spec

* Changelog

* Add TODO

* Button size

---------

Co-authored-by: github-action linter <githubaction@githubaction.com>
2024-01-06 18:17:29 -05:00
Brahim Hadriche e7324495fe [skip ci] add MathUtils 2024-01-06 10:01:59 -05:00
Brahim Hadriche 2e7b3d0aa5 Add curl error codes 2024-01-06 10:00:17 -05:00
Brahim Hadriche 20f345593e [skip ci] small tweak in http client 2024-01-02 21:05:16 -05:00
Brahim Hadriche 754da7e836 [skip ci] typo 2024-01-02 18:08:33 -05:00
Brahim Hadriche 85c3eb8321 Screenshots (#249) 2024-01-02 13:45:57 -05:00
Brahim Hadriche e59e45e310 Release v0.18.1 (#248) 2024-01-02 12:48:57 -05:00
Brahim Hadriche 2548fb9097 Fix/invalid subs (#247)
* Sort

* Remove invalid

* Fix for unsupported subtitles

* Actually disable unsupported subs
2024-01-02 12:34:44 -05:00
Brahim Hadriche 1cb80f71b5 Use asyncStopSemantics to prevent execution timeout crashes (#246)
* Use asyncStopSemantics to prevent execution timeout crashes

* Clarify

* Changelog

* no message
2024-01-02 11:05:47 -05:00
Brahim Hadriche 0a7a6c65e2 Bug fix 2024-01-02 10:57:14 -05:00
Brahim Hadriche 529b915d7f [skip ci] Add comment with supported subtitle languages 2024-01-01 15:15:21 -05:00
Brahim Hadriche a76a2cb77f [skip ci] typo 2024-01-01 13:01:49 -05:00
Brahim Hadriche 707739b901 small refactor 2024-01-01 10:52:14 -05:00
Brahim Hadriche 8c72258879 Add TODO 2024-01-01 10:40:13 -05:00
Brahim Hadriche d245c072e9 Remove Funny and News from home screen (#245) 2023-12-30 22:47:06 -05:00
Brahim Hadriche 0f000590a0 Fixes for RowList cells (#244)
* Fixes for RowList cells

* typo
2023-12-30 22:32:43 -05:00
Brahim Hadriche 93c1e48d39 Add TODO 2023-12-30 19:21:21 -05:00
d6c7d81347 [chore] update dependencies (#243)
* Add TODO

* update dependencies

* plugin fix

---------

Co-authored-by: Brahim Hadriche <brahim.hadriche@gmail.com>
Co-authored-by: iBicha <iBicha@users.noreply.github.com>
2023-12-29 22:46:52 -05:00
Brahim Hadriche 331f2ff3cb Add playlist updated field in web app 2023-12-29 17:58:30 -05:00
Brahim Hadriche 6c42fbe056 Add tab titles in web app 2023-12-29 11:04:19 -05:00
Brahim Hadriche 7e8c828007 Remove legacy stuff 2023-12-28 18:17:42 -05:00
Brahim Hadriche ba59aad767 Release v0.18.0 (#240) 2023-12-28 14:27:28 -05:00
Brahim Hadriche 36ae525154 Fix another bug related to public instances 2023-12-28 14:19:45 -05:00
Brahim Hadriche 5ef130bc51 Fix tests 2023-12-23 10:55:58 -05:00
Brahim Hadriche 39591abc34 Adjust diagnostic filters 2023-12-23 10:52:08 -05:00
Brahim Hadriche 84bd50d970 Update bsc 2023-12-23 10:39:17 -05:00
fd0259615b [chore] update dependencies (#239)
* update dependencies

* Revert bsc update

---------

Co-authored-by: iBicha <iBicha@users.noreply.github.com>
Co-authored-by: Brahim Hadriche <brahim.hadriche@gmail.com>
2023-12-22 19:53:58 -05:00
Brahim Hadriche e53ad785c6 Refresh lint rules (#238)
* Lint

* Color rules

* Update sponsorblock config file

* Small tweak

* Color adjustments
2023-12-22 19:36:36 -05:00
Brahim Hadriche cbda8dbf9b Fix formatting 2023-12-22 15:22:02 -05:00
Brahim Hadriche 242298911c Fix dialog palette 2023-12-22 15:19:19 -05:00
Brahim Hadriche 8f1d3778d8 Add unused arg validation rule 2023-12-22 11:42:51 -05:00
Brahim Hadriche 192401c847 Remove LOCAL_DASH feature flag 2023-12-22 10:54:42 -05:00
Brahim Hadriche 132e3ec3e3 Add a sleep before canary release as a workaround 2023-12-20 17:13:32 -05:00
Brahim Hadriche 3570f011c4 Formatting 2023-12-20 17:01:22 -05:00
Brahim Hadriche 482daf5e12 Color adjustments 2023-12-20 16:59:15 -05:00
Brahim Hadriche 64f5985aae Small bug fix 2023-12-20 16:42:45 -05:00
Brahim Hadriche a1aed7d253 Watch history (#232)
* [PoC] Watch history

* Render watch history on web app

* Changelog

* Log out user on insufficient access
2023-12-20 09:39:42 -05:00
Brahim Hadriche f581d568d9 Fix sponsor skip infinite loop bug (#231) 2023-12-19 20:02:15 -05:00
Brahim Hadriche 54b0acbe8f Add medium video quality video to the settings (#230) 2023-12-19 19:18:06 -05:00
Brahim Hadriche 6e4262e6a5 Support for legacy browsers (#228) 2023-12-18 22:18:38 -05:00
Brahim Hadriche 4c90cf1e98 Restart playlet from web app 2023-12-18 08:53:49 -05:00
Brahim Hadriche 72f547cc22 Styling fix for Safari 2023-12-18 08:25:59 -05:00
Brahim Hadricheandgithub-action linter 1cee5d61ab Feature/web socket (#180)
* Websockets

* Sending payloads

* Lint fix

* Remove example code

* Disable web sockets

* remove todo

---------

Co-authored-by: github-action linter <githubaction@githubaction.com>
2023-12-17 11:51:53 -05:00
github-actions[bot]andiBicha d87337d389 update dependencies (#223)
Co-authored-by: iBicha <iBicha@users.noreply.github.com>
2023-12-15 21:31:01 -05:00
Brahim Hadriche 2ba2115da7 (Regression) Fix issue where auto-play keeps playing the same videos in a loop 2023-12-15 21:27:41 -05:00
Brahim Hadriche 49be599c32 No xmas 2023-12-13 16:51:31 -05:00
Brahim Hadriche 8d5646aeb3 Release v0.17.3 (#222) 2023-12-13 16:27:41 -05:00
Brahim Hadriche 07b0e422ff Xmas 2023-12-13 16:22:40 -05:00
Brahim Hadriche 35325bfae2 lint 2023-12-12 20:16:05 -05:00
Brahim Hadriche c122d286dc Missed a rename 2023-12-12 20:15:19 -05:00
Brahim Hadriche 66208d941d Adjust config files 2023-12-12 20:07:43 -05:00
Brahim Hadriche 9cf6626efb Adjust messages 2023-12-12 18:06:23 -05:00
Brahim Hadriche 69c87228af Create README.md 2023-12-12 09:38:40 -05:00
Brahim Hadriche 2502eae462 Add some randomness to loading messages 2023-12-11 08:46:58 -05:00
Brahim Hadriche b0e0c2d09d Small refactor in bootstrap scene 2023-12-11 08:19:15 -05:00
Brahim Hadriche 5982b5a75f validation rule for callFunc operator 2023-12-10 22:54:00 -05:00
Brahim Hadriche 51966cb33f Use local ip for dash 2023-12-10 22:35:53 -05:00
Brahim Hadriche bfe8a3c860 Downgrade todos 2023-12-10 22:14:14 -05:00
Brahim Hadriche ef17ff44af Update signing script 2023-12-10 15:51:53 -05:00
Brahim Hadriche 826228e939 Release v0.17.2 (#221) 2023-12-10 15:30:04 -05:00
Brahim Hadricheandgithub-action linter b77519493d Feature/loading messages (#220)
* Add loading message

* Add messages and cache file

* Lint fix

---------

Co-authored-by: github-action linter <githubaction@githubaction.com>
2023-12-10 15:24:30 -05:00
Brahim Hadriche 6a46d4cd09 Fix typo 2023-12-09 09:32:38 -05:00
github-actions[bot]andiBicha 382cbe33d3 update dependencies (#218)
Co-authored-by: iBicha <iBicha@users.noreply.github.com>
2023-12-09 09:31:31 -05:00
Brahim Hadriche e9b57c9c08 Release v0.17.1 (#217) 2023-12-08 07:00:06 -05:00
Brahim Hadriche 457242057d Bug fix 2023-12-08 06:50:57 -05:00
Brahim Hadriche 665f76701d Small bug fix 2023-12-08 06:40:05 -05:00
Brahim Hadriche 258726fadb fix line ending 2023-12-08 06:12:27 -05:00
Brahim Hadriche 215a23c91d Update deps, lock brighterscript version 2023-12-08 06:10:26 -05:00
Brahim Hadriche 19ecc25852 add todo
more todos

Add todo
2023-12-08 05:43:12 -05:00
github-actions[bot]andiBicha 0ae524f88c update dependencies (#214)
Co-authored-by: iBicha <iBicha@users.noreply.github.com>
2023-12-04 23:46:48 +01:00
Brahim Hadriche 8bf16bfbd5 Update plugins.md 2023-12-04 23:28:44 +01:00
Brahim Hadriche 0acb7031d3 Refactor query params 2023-11-26 18:11:48 -05:00
Brahim Hadriche 0ddc9a48aa Enable manual releases 2023-11-25 20:00:25 -05:00
Brahim Hadriche 3ac4d959d3 Fix formatting 2023-11-25 19:53:17 -05:00
Brahim Hadriche 19de693298 Add instance test to make sure thumbnails are reachable 2023-11-25 19:50:13 -05:00
github-actions[bot]andiBicha 46af79c2ae update dependencies (#210)
Co-authored-by: iBicha <iBicha@users.noreply.github.com>
2023-11-24 20:23:22 -05:00
Brahim Hadriche fd077a0d1a Adjust icon resolution 2023-11-24 15:23:24 -05:00
Brahim Hadriche 981e95b0d4 Change icon 2023-11-24 14:54:57 -05:00
Brahim Hadriche 8883a59fcb Tweak 2023-11-24 14:27:49 -05:00
Brahim Hadriche 662cb4b634 Adjusting layout 2023-11-24 14:26:01 -05:00
Brahim Hadriche 7269fdff7d Adjust logo 2023-11-24 14:13:57 -05:00
Brahim Hadriche 710e892545 More memory cleanup 2023-11-24 11:39:53 -05:00
Brahim Hadriche 7dd5561faa Partially fix a memory leak 2023-11-23 22:18:07 -05:00
Brahim Hadriche d40a12d1f1 Adjust fs debug flags 2023-11-23 21:38:36 -05:00
Brahim Hadriche 1170f422ec typo 2023-11-22 08:21:33 -05:00
Brahim Hadriche 2639267e1f Center navbar buttons 2023-11-19 21:42:12 -05:00
Brahim Hadriche 3b35adeae9 Update js deps 2023-11-19 20:07:45 -05:00
Brahim Hadriche e8b6cd1588 clear expired and invalid cache 2023-11-19 19:33:12 -05:00
Brahim Hadriche 0377f075be small fix 2023-11-19 19:21:33 -05:00
Brahim Hadriche 89034378fb Fix app info fields order 2023-11-19 19:18:54 -05:00
Brahim Hadriche 9ae8601a32 Small refactors to http client and caching 2023-11-19 19:05:46 -05:00
Brahim Hadriche 61327401b0 Rename version to app_version 2023-11-19 18:30:29 -05:00
Brahim Hadriche 94a017a878 Add TODOs 2023-11-18 17:43:01 -05:00
Brahim Hadriche eb3d1724e4 Add TODOs 2023-11-18 14:08:59 -05:00
Brahim Hadriche 9d95834ebb fix job 2023-11-17 19:37:55 -05:00
Brahim Hadriche 9201b8dfe0 Release v0.17.0 (#205) 2023-11-17 16:37:01 -05:00
Brahim Hadriche cf17fed02e adjust remote repeat keys 2023-11-15 21:13:01 -05:00
Brahim Hadriche f8d202be56 Fix icon, fix ok button long press 2023-11-15 21:03:45 -05:00
Brahim Hadriche af091fe8f7 remote power button 2023-11-15 20:50:10 -05:00
Brahim Hadriche d89b1c519d support long press and touch 2023-11-15 16:22:22 -05:00
Brahim Hadriche dca3e42c79 add keyboard support 2023-11-15 13:32:27 -05:00
Brahim Hadriche 2f72c6471a Adjust remote 2023-11-15 12:05:16 -05:00
Brahim Hadriche 413e73c1c0 [PoC] Web app remote control (#203)
* [PoC] Web app remote control

* Remote UI cleanup

* changelog
2023-11-15 11:49:54 -05:00
Brahim Hadriche 2a57cc99c7 Launch Playlet from web app 2023-11-14 18:49:17 -05:00
Brahim Hadriche d65f930247 Small tweak 2023-11-13 23:13:43 -05:00
Brahim Hadriche ed632a7a62 tweak job 2023-11-13 23:10:08 -05:00
Brahim Hadriche 89ea45ed54 Add update deps job 2023-11-13 23:07:11 -05:00
Brahim Hadriche d7e5732fde Release v0.16.0 (#200) 2023-11-13 22:25:12 -05:00
Brahim Hadriche 9f5a605e8f Small cleanup on content nodes 2023-11-13 22:00:25 -05:00
Brahim Hadriche 45da0880ba Focus current item on queue open 2023-11-13 15:22:21 -05:00
Brahim Hadriche 9e47d4d42e Bug fixes 2023-11-13 15:01:31 -05:00
Brahim Hadriche 3312bbc56e Small refactor 2023-11-13 09:10:52 -05:00
Brahim Hadriche e1cda5cc5c tweak 2023-11-13 09:06:41 -05:00
Brahim Hadriche af0ddf68c5 Adjust queue ui 2023-11-12 17:57:28 -05:00
Brahim Hadricheandgithub-action linter 3559a3fff6 Queue UI (#199)
* Refactor long press

* Lint fix

* Queue UI, refactor PlayQueue to use ContentNode

* Add queue notification hint

* Play at index

* Play queue with highlight

* Priority

* Comment

---------

Co-authored-by: github-action linter <githubaction@githubaction.com>
2023-11-12 17:45:00 -05:00
Brahim Hadriche e0709452be Update README.md 2023-11-11 21:55:04 -05:00
Brahim Hadriche 9bbf8dd038 Update README.md 2023-11-11 21:53:54 -05:00
Brahim Hadriche 64d655fca9 Update README.md 2023-11-11 12:11:19 -05:00
Brahim Hadriche ecb738ab1f Small tweak to http retry logging 2023-11-10 18:23:13 -05:00
Brahim Hadriche c14fa7a1d3 [Perf] reduce some rendezvous 2023-11-10 18:14:26 -05:00
Brahim Hadriche 96f24a12a7 Release v0.15.1 (#198) 2023-11-10 17:39:25 -05:00
Brahim Hadriche 665fa44a49 Fix bug with requests not sent 2023-11-10 17:34:31 -05:00
Brahim Hadriche 3c43934081 Set default http request method 2023-11-10 15:32:43 -05:00
Brahim Hadriche e941bc2439 Http client request from object 2023-11-10 13:46:33 -05:00
Brahim Hadriche c35779b211 [shore] update dependencies 2023-11-08 18:04:05 -05:00
Brahim Hadriche 7adb90ccc2 Update README.md 2023-11-08 13:58:53 -05:00
Brahim Hadriche 59ed47108d Fix/error dialog on disposed rowlist (#196)
* Dispose tasks when disposing a view

* Do not show dialog on disposed views
2023-11-08 13:43:21 -05:00
Brahim Hadriche 2eb0cf88af Web app fix (#195) 2023-11-08 13:38:02 -05:00
Brahim Hadriche 38a1d9a950 RowCell bug fix 2023-11-08 08:18:45 -05:00
Brahim Hadriche c1bb059d66 Update download-stats.js 2023-11-07 14:54:58 -05:00
Brahim Hadriche da71382b4a Update stats.yml 2023-11-06 22:08:18 -05:00
Brahim Hadriche 4c32243e6e Add search history preference (#193) 2023-11-06 18:07:21 -05:00
Brahim Hadriche 91be37fd8a Log error message 2023-11-06 17:18:57 -05:00
Brahim Hadriche 54db808b83 move emails to trash once done 2023-11-06 14:01:13 -05:00
Brahim Hadriche 8f722276f3 Delete existing attachments 2023-11-06 13:32:48 -05:00
Brahim Hadriche 3b5d7a9520 format date 2023-11-05 22:39:11 -05:00
Brahim Hadriche 94773d5c3a small tweak 2023-11-05 22:32:42 -05:00
Brahim Hadriche 60fb566a01 Feature/wiki automate (#192)
* change paths

* path adjust

* Fix script

* order change

* Revert "order change"

This reverts commit 4237b4676f7ae277bca7f4cac7414ae1a69ba4dc.

* use imap for attachments

* fix env vars

* add comments
2023-11-05 22:29:52 -05:00
Brahim Hadriche ac9709fc4a Update stats.yml 2023-11-05 18:55:27 -05:00
Brahim Hadriche 1f1a4479da stats test (#189) 2023-11-05 18:53:37 -05:00
Brahim Hadriche 2dcfabdd60 Release v0.15.0 (#188)
* Release v0.15.0

* Changelog
2023-11-05 15:21:20 -05:00
Brahim Hadriche 8f59e3648e Implement retry mechanism (#187)
* Implement retry mechanism

* Set retry count to 3

* web app cache key

* Changelog
2023-11-05 15:11:19 -05:00
Brahim Hadricheandgithub-action linter 4233f30dec Play queue notification (#186)
* Play queue notification

* Lint fix

* change binding

* Add notification preference

* Lint fix

* changelog

---------

Co-authored-by: github-action linter <githubaction@githubaction.com>
2023-11-04 20:23:02 -04:00
Brahim Hadriche 777db66bda Fix crash related to fetching subscriptions 2023-11-04 11:12:35 -04:00
Brahim Hadriche 771929d0d8 Channel links in web app 2023-11-01 08:50:55 -04:00
Brahim Hadricheandgithub-action linter 5179de5c74 Subscribe button (#185)
* Subscribe button

* changelog

* Lint fix

* Introduce disposable part

* Lint fix

* revert navigation change

---------

Co-authored-by: github-action linter <githubaction@githubaction.com>
2023-10-31 22:47:03 -04:00
Brahim Hadriche e22051014f [Shore] update dependencies 2023-10-31 19:23:27 -04:00
Brahim Hadriche 3eb45653f0 add --compressed flag to curl 2023-10-31 15:44:03 -04:00
Brahim Hadriche 5287070233 adjust loading indicator 2023-10-30 08:38:51 -04:00
Brahim Hadriche d149c20e0d Remove comment 2023-10-29 19:12:29 -04:00
Brahim Hadriche 6cf735e089 Get rid of optional chaining (Roku 11 feature) 2023-10-29 11:38:36 -04:00
Brahim Hadriche af1fa0b401 Refactor casting dialog and add thumbnails (#184) 2023-10-29 00:28:21 -04:00
Brahim Hadriche f58137b326 Fix casting timestamp 2023-10-27 20:01:18 -04:00
Brahim Hadriche 200fb68ab9 link copy/paste fix 2023-10-27 17:34:24 -04:00
Brahim Hadriche bde4523c00 Support copy pasting links in web app 2023-10-27 16:32:11 -04:00
Brahim Hadriche af020b509a Update README.md 2023-10-27 14:52:16 -04:00
Brahim Hadriche 97592f9839 Maximize video if playing on channel exit 2023-10-27 13:22:06 -04:00
Brahim Hadriche 53f8535535 search pagination in web app (#183) 2023-10-27 13:10:20 -04:00
Brahim Hadriche 982dd0cd2e Release v0.14.0 (#181) 2023-10-25 21:32:05 -04:00
Brahim Hadriche 4827537f57 Fix for feed when no videos are loaded 2023-10-25 21:22:22 -04:00
Brahim Hadriche 586925c2da Comment 2023-10-25 20:55:03 -04:00
Brahim Hadriche dd79d85cca Fix "upcoming" videos 2023-10-25 20:51:36 -04:00
Brahim Hadriche 584ee9a38a dash router input validation 2023-10-25 17:06:39 -04:00
Brahim Hadriche 6051d45a80 Support drag and drop links for channels 2023-10-24 19:59:24 -04:00
Brahim Hadriche 549913ef7d Open views (#179)
* adjust todo

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

* feed lazy loading

* cached fetch

* Versioned cache

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

* Lint fix

* first pass

* Lint fix

* comment

* bookmarks, loading feedSources, and pagination

* comment

* null check

---------

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

* Use fullname repo

---------

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

* Bookmarks object

* Long press support

* Lint fix

* Context menu v1

* A working context menu

* Basic bookmarks in context menu

* Use a root content node for bookmarks

* context menu animation

* small tweak

* move logger around, adjust animation

* Lint fix

* Restore logger fix

* Cache channel info

* Bookmarks v1

* Added comment

* Adjust "popular" feed error handling

* Progress with bookmarks

* Add todo

* add todo

* handle roDateTime logging

* logger adjustment

* Use yaml for api and layout

* rename requestData to feedSource

* Restructure things

* Lint fix

* remove comment

* introduce feedSource id

* small cleanup

* playlist context menu

* Context menu for the channel view

* changelog

---------

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

* Changelog

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

* Refactor xml gen

* Lint fix

* Add feature flag

* Multi language audio tracks

* Unused var

* Set video expiration to 5 hours

---------

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

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

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

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

* changelog

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

* Fix cropped buttons

* Lint fix

* changelog

---------

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

* Lint fix

---------

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

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

* Fixes for web app

* Add request id to error message
2023-09-22 17:52:53 -04:00
Brahim Hadriche e2df0b524a Fix copy paste bug 2023-09-21 15:41:40 -04:00
Brahim Hadriche 7401263f0d Release v0.12.1 (#148) 2023-09-19 18:32:35 -04:00
Brahim Hadriche 90fe768d2c Changelog 2023-09-19 18:27:33 -04:00
Brahim Hadriche 5c1a62b7f3 Push transpiled files 2023-09-19 18:16:52 -04:00
Brahim Hadriche 44578bd6c5 Remove ropm 2023-09-19 18:14:45 -04:00
Brahim Hadriche 75b8ad1c0c log tweak 2023-09-19 18:01:12 -04:00
Brahim Hadriche 2b1d707f6d port not needed 2023-09-19 17:51:28 -04:00
Brahim Hadriche 190dcdffe3 Feature/logger (#147)
* todos

* New logger

* Remove roku-log
2023-09-19 17:49:48 -04:00
Brahim Hadriche cf6d89f44f Update PRIVACY.md 2023-09-18 16:20:28 -04:00
Brahim Hadriche 5c0bc3c82c Release v0.12.0 (#146) 2023-09-17 12:31:27 -04:00
Brahim Hadriche d99151ff21 Create CirclePoster to address MaskGroup not scaling with resolution 2023-09-17 11:47:09 -04:00
Brahim Hadriche 6e84809923 Navigation fix 2023-09-16 19:01:35 -04:00
Brahim Hadriche e993ac3b59 Search filters (#145) 2023-09-16 18:47:53 -04:00
Brahim Hadriche d301b3fff7 Set confirm_partner_button flag in manifest 2023-09-16 12:55:43 -04:00
Brahim Hadriche f452bf23de Add Channel support (#144)
* Add Channel support

* Cross fade

* add todo
2023-09-15 17:34:07 -04:00
Brahim Hadriche 38a054a46a Rename "unstable" release to "canary" 2023-09-11 21:16:12 -04:00
Brahim Hadriche f60d8b6caf sync script use token from file 2023-09-11 15:58:35 -04:00
Brahim Hadriche 6c29993437 no message 2023-09-11 15:17:53 -04:00
Brahim Hadriche 52fc935598 Add voice search 2023-09-11 15:11:16 -04:00
Brahim Hadriche ae82ad4b28 Add playlist updated field 2023-09-11 13:47:44 -04:00
Brahim Hadriche b7fe0feb94 Update README.md 2023-09-11 11:27:23 -04:00
Brahim Hadriche 0cd9758538 Update README.md 2023-09-11 09:10:11 -04:00
Brahim Hadriche a1f2e4de52 Update README.md 2023-09-11 09:09:19 -04:00
Brahim Hadriche 503370f4d7 Update README.md 2023-09-11 09:06:09 -04:00
Brahim Hadriche 8acb7c64de Update plugins.md 2023-09-10 22:59:19 -04:00
Brahim Hadriche 50858c150f Update plugins.md 2023-09-10 17:46:05 -04:00
400 changed files with 15234 additions and 4331 deletions

No files matched your search

+1
View File
@@ -17,6 +17,7 @@ jobs:
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: Configure repo
run: |
+11 -5
View File
@@ -3,6 +3,7 @@ name: Release
on:
push:
branches: ["main"]
workflow_dispatch: {}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
@@ -52,18 +53,23 @@ jobs:
- name: Run Analysis on Playlet App
run: ./sca-cmd/bin/sca-cmd ./release/playlet.zip --exit error
- name: Delete unstable release
- name: Delete Canary release
uses: dev-drprasad/delete-tag-and-release@v1.0
with:
tag_name: unstable
tag_name: canary
github_token: ${{ secrets.GH_TOKEN }}
- name: Extract changelog
run: |
latest_release=$(awk 'BEGIN { RS="## \\[" } NR==2 { print "## ["$0 }' CHANGELOG.md)
echo -e "\n$latest_release" >> docs/unstable-changelog.md
echo -e "\n$latest_release" >> docs/canary-changelog.md
- name: Create unstable release
run: gh release create unstable ./release/playlet.zip ./release/playlet-lib.zip --notes-file docs/unstable-changelog.md --prerelease --title unstable
# 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
run: gh release create canary ./release/playlet.zip ./release/playlet-lib.zip --notes-file docs/canary-changelog.md --prerelease --title Canary
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
+44
View File
@@ -0,0 +1,44 @@
name: Stats
on:
schedule:
- cron: "0 11 * * *"
workflow_dispatch:
jobs:
update_wiki_stats:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Checkout Wiki
uses: actions/checkout@v4
with:
repository: ${{ github.repository }}.wiki
path: ./playlet.wiki
- name: Configure repo
run: |
git config --local user.email "githubaction@githubaction.com"
git config --local user.name "github-action wiki updater"
working-directory: ./playlet.wiki
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Download attachements
run: node tools/download-stats.js
env:
EMAIL: ${{ secrets.EMAIL }}
EMAIL_APP_PASSWORD: ${{ secrets.EMAIL_APP_PASSWORD }}
- name: Update wiki
run: git add "." && git commit -m "Update stats" --no-verify && git push || true
working-directory: ./playlet.wiki
+36
View File
@@ -0,0 +1,36 @@
name: Update Dependencies
on:
schedule:
- cron: "0 0 * * 6"
workflow_dispatch: {}
jobs:
update_deps:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Update dependencies
run: npm run update-deps
- name: Install dependencies
run: npm i
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
commit-message: "update dependencies"
branch: chore/update-deps
title: "[chore] update dependencies"
body: "Weekly pull request to update dependencies."
+6 -2
View File
@@ -18,6 +18,7 @@
"files": [
"**"
],
"componentLibrariesPort": 8086,
"componentLibraries": [
{
"rootDir": "${workspaceFolder}/build/playlet-lib",
@@ -59,7 +60,7 @@
"command": "npm run dev:web",
"request": "launch",
"type": "node-terminal"
},
},
{
"name": "Playlet Web (Chrome)",
"type": "chrome",
@@ -79,7 +80,10 @@
"compounds": [
{
"name": "Playlet Web (Debug)",
"configurations": ["Playlet Web (Dev)", "Playlet Web (Chrome)"],
"configurations": [
"Playlet Web (Dev)",
"Playlet Web (Chrome)"
],
"stopAll": true
}
]
+219
View File
@@ -5,6 +5,225 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [0.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
### Added
- Xmas theme logo
## [0.17.2] - 2023-12-10
### Added
- Loading message
## [0.17.1] - 2023-12-08
### Added
- An instance test to make sure thumbnails are reachable
### Fixed
- A rare error when video player is closed but does not have valid content
- A rare error that can occur with loading indicators causing a crash
## [0.17.0] - 2023-11-17
### Added
- Playlet logo in web app is clickable, and launches app if not already on
- Remote control in web app
- Clickable buttons and keyboard support
## [0.16.0] - 2023-11-13
### Added
- User interface for the Queue: Press and hold `Options (*)` to show the queue
### Fixed
- Crash when video player has no content
- Execution timeout on cirlce posters
## [0.15.1] - 2023-11-10
### Added
- An option to disable search history
### Fixed
- A rare bug that causes the app to crash when displaying video cells
- A bug where we show error dialogs that happened on screens that are already closed
- A bug where bookmarks show duplicate videos
- A bug where watch history is not always sent to Invidious
## [0.15.0] - 2023-11-05
### Added
- Pagination support in web app search (load more button)
- Video links pasted into the web app triggers the dialog to cast the video
- Ability to subscribe/unsubscribe from a channel screen
- This needs additional scope for the Invidious token. You will be logged out, and need to login again. Sorry for the inconvenience.
- A notification when videos are added to the queue (can be disabled from the settings)
### Fixed
- A bug where casting from web included timestamp even if the "Start at" check box is unchecked
- A leak where channel screens would reload data even when closed
- A crash when fetching subscriptions
- Fetching errors by adding a retry mechanism to web requests
## [0.14.0] - 2023-10-25
### Added
- Bookmarks: different items can now be bookmarked, and be found in the `Bookmarks` screen.
Things that can be bookmarked:
- A video
- A channel
- A playlist
- Subscriptions
- Trending
- Popular
- Playlists
- Search results
- Channel tabs (latest videos, live streams, playlists, shorts, podcasts, related channels)
- Context menu: press and hold `OK` to show a context menu to:
- Play/queue a video or a playlist
- Open the channel of a playlist or of a video
- Manage bookmarks
- Local DASH manifest generation
- This adds support for multi languages audio tracks
- Also adds thumbnails/preview in trick play mode
- Known issue: thumbnails might appear cropped/misaligned at the end of videos. This will be addressed in a later release.
- Search filters in web app
- Channels and Playlists can be opened on TV from web app
- Channel links can be drag and dropped into the web app
### Fixed
- Layout in channel view so that the upload time and view count of videos is visible
- A few things in the logger
- A bug where channels show "0 videos". Channel handle is shown instead.
### Changed
- Cache format so it does less parsing work
- Removed "chapter" from SponsorBlock categories
## [0.13.1] - 2023-10-08
### Added
- Support to pause/play while picture-in-picture
### Fixed
- (potentionally) a bug where many dialogs could cause an execution timeout
- Mutltiple rare crashes when component content is set before component initialization
- Error dialog for loading "Popular" when "Popular" is disabled
## [0.13.0] - 2023-10-02
### Added
- Playlists, streams, podcasts and related channels to Channel UI
- Pagination supported
- Channels show up in web app (but no UI for channel details yet)
- Support for `Etag` header on the web server to improve performance with caching
### Fixed
- Another bug where the app crashes if an error happens loading channel info
- Issue with default instance (by changing default instance)
- Cropped text in a couple of buttons
### Removed
- Partial content (`Range` header) from the web server, since we never serve very big files
## [0.12.1] - 2023-09-19
### Added
- New logger: less features, and less rendezvous
### Fixed
- A bug where the app crashes if an error happens loading channel info
### Removed
- `roku-log` package
- `ropm`
## [0.12.0] - 2023-09-17
### Added
- A field to indicate when a playlist was last updated
- Voice search in search page
- Basic support for channels (open channel, see latest videos)
- Search filters (Upload date, type, duration, features, and sort by)
### Changed
- Renamed `Unstable` releases to `Canary`
## [0.11.0] - 2023-09-10
This version went through a major refactor, which resulted in a different arcitecture of the app to support new features, the rewrite of many pieces, as well as new features.
+1 -1
View File
@@ -19,7 +19,7 @@ could be public instances hosted by volenteers. These instances are available
While invidious does no data collection by default, and it is in fact built to
be privacy driven, but in theory, from a playlet request it is possible to
know the IP address of a user, the identifiers of watched video, and search
keywords. In case the user is unreasonably paranoid, they can host their own
keywords. In case the user has privacy concerns, they can host their own
Invidious instance and use it from Playlet.
## SponsorBlock
+19 -8
View File
@@ -1,6 +1,4 @@
# Playlet
<!-- markdownlint-disable MD033 -->
<!-- markdownlint-disable MD033 MD041 -->
<p align="center">
<img src="docs/banner.png" style="display:block;text-align:center" alt="Playlet Logo" width="800"/>
<br/><br/>
@@ -11,7 +9,7 @@
<img alt="Current Release" src="https://img.shields.io/github/release/iBicha/playlet.svg"/>
<img alt="Total Downloads" src="https://img.shields.io/github/downloads/iBicha/playlet/latest/playlet-lib.zip.svg"/>
</a>
<a href="https://github.com/iBicha/playlet">
<a href="/LICENSE">
<img alt="AGPL-3.0 license" src="https://img.shields.io/github/license/iBicha/playlet.svg"/>
</a>
<a href="https://channelstore.roku.com/en-ca/details/840aec36f51bfe6d96cf6db9055a372a/playlet">
@@ -19,6 +17,8 @@
</a>
</p>
# Playlet
Playlet is an unofficial Youtube client for Roku 📺
## Screenshots
@@ -56,20 +56,31 @@ More under [Screenshots](./docs/screenshots/README.md)
### Picture-in-picture
- When viewing a video in full screen, press ⬇️ (down) button on your remote to shrink the video
- You can browser or search for videos while you watch
- You can browse or search for videos while you watch
- To restore currently playing video to full screen, press the ✳️ (options) button
### Customize Invidious instance
1. Open settings in Playlet
1. Scan QR Code with Phone
1. Change the Invidious instance
1. You can also do this from the settings tab
1. Select Invidious -> Instance
1. Set a custom instance, or choose a public one hosted by volunteers (from https://api.invidious.io/)
1. Optionally, Select `Test instance` to make sure it works
1. Hit save
> ℹ️ **Note**: If you are logged in when you change the instance, you will remain logged in to the old instance. In this case, Playlet will use the old instance to retrieve your subscriptions and your playlists, but will use the new instance for everything else. After switching to a new instance, you can log out and log in again to use your profile on the new instance.
## Development
For everything related to Playlet app development, please see the [documentation](./docs/README.md)
## Analytics and reporting
We do not collect any usage data, anonymous or not. But Roku does, and you can find the data made available to Playlet in the [Wiki](https://github.com/iBicha/playlet/wiki).
Most software in the wild collect some data to make sure things work, and to prioritize features.
Because we don't do that, we wouldn't know if people using Playlet are facing issues, unless these issues get reported.
Playlet could run on variaty of devices, with different capabilities and screen sizes, and different Invidious instances.
That's why it's important to report any issues you encouter using Playlet, otherwise it's unlikely that they get addressed.
## Why Playlet
```none
@@ -3,11 +3,16 @@
"createPackage": false,
"diagnosticFilters": [
{
"src": "**/roku_modules/**/*.*"
},
1090
"src": "**/*.part.xml",
"codes": [
// 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",
// The validation regex rules are validated using the validation-plugin.ts plugin
"validation": [
{
"code": "NO_SET_FOCUS",
@@ -20,13 +25,29 @@
"regex": "\\.observeField(scoped)?\\s*\\(\\s*\"\\w+\"\\s*,\\s*\"\\w+\"\\s*\\)",
"regexFlags": "ig",
"message": "observeField(\"field\", \"callback\") is not allowed. Use observeField(\"field\", FuncName(callback)) instead."
},
{
"code": "NO_INVALID_CALLFUNC_ARG",
"regex": "@\\.\\w+\\(invalid\\)",
"regexFlags": "ig",
"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": [
"source/**",
"components/**",
"images/**",
"!images/vector/**",
"!**/*.svg",
"!**/*.svg.meta.json5",
"fonts/**",
"config/**",
"lib/**",
@@ -39,7 +60,6 @@
],
"lintConfig": "./config/bslint.jsonc",
"plugins": [
"roku-log-bsc-plugin",
"@rokucommunity/bslint",
"../tools/bs-plugins/asynctask-plugin.ts",
"../tools/bs-plugins/manifest-edit-plugin.ts",
@@ -48,16 +68,15 @@
"../tools/bs-plugins/oninit-plugin.ts",
"../tools/bs-plugins/track-transpiled-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/image-gen-plugin.ts",
"../tools/bs-plugins/type-gen-plugin.ts"
],
"retainStagingDir": true,
"require": [
"ts-node/register"
],
"rokuLog": {
"insertPkgPath": true,
"removeComments": false,
"strip": false
},
"sourceMap": true
"sourceMap": true,
"pruneEmptyCodeFiles": true
}
@@ -1,10 +1,11 @@
{
"extends": "bsconfig.base.json",
"extends": "bsconfig.base.jsonc",
"files": [
"source/**",
"components/**",
"images/**",
"!images/vector/**",
"!**/*.svg",
"!**/*.svg.meta.json5",
"fonts/**",
"config/**",
"lib/**",
@@ -14,7 +15,6 @@
"!**/*.transpiled.*"
],
"plugins": [
"roku-log-bsc-plugin",
"@rokucommunity/bslint",
"rooibos-roku",
"../tools/bs-plugins/asynctask-plugin.ts",
@@ -24,7 +24,10 @@
"../tools/bs-plugins/oninit-plugin.ts",
"../tools/bs-plugins/track-transpiled-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/image-gen-plugin.ts",
"../tools/bs-plugins/type-gen-plugin.ts"
],
"rooibos": {
"logLevel": 2,
+3 -1
View File
@@ -17,5 +17,7 @@
// Enforces all keywords and types to be lowercase.
"keywordCase": "lower",
// Remove trailing whitespace at the end of each line.
"removeTrailingWhiteSpace": true
"removeTrailingWhiteSpace": true,
// Sort imports alphabetically.
"sortImports": true
}
+21 -12
View File
@@ -5,23 +5,32 @@
"**/bslib.brs"
],
"rules": {
"aa-comma-style": "no-dangling",
"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",
// Code style
"inline-if-style": "never",
"block-if-style": "no-then",
"condition-style": "no-group",
"named-function-style": "no-sub",
"anon-function-style": "no-sub",
"aa-comma-style": "never",
"no-print": "warn",
"no-stop": "error",
"no-todo": "off",
"no-stop": "error",
"eol-last": "always",
// Strictness
"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-path-loop": "warn",
"unused-variable": "warn"
"unreachable-code": "warn",
"case-sensitivity": "error",
"unused-variable": "error",
"consistent-return": "error"
}
}
+11 -12
View File
@@ -19,12 +19,11 @@ This document contains various kinds of information related to Playlet developme
- [Debug endpoints](#debug-endpoints)
- [Releases from Github](#releases-from-github)
- [Dev library hosted by VS Code Extension](#dev-library-hosted-by-vs-code-extension)
- [AsyncAwait Task Generator](#asyncawait-task-generator)
- [Feature flags](#feature-flags)
- [User preferences](#user-preferences)
- [Home page layout](#home-page-layout)
- [Playlet Web App](#playlet-web-app)
- [Testing](#testing)
- [Playlet Web App](#playlet-web-app)
- [Svelte development](#svelte-development)
- [Tailwind/Daisy UI](#tailwinddaisy-ui)
- [API calls (proxy authenticated)](#api-calls-proxy-authenticated)
@@ -144,7 +143,7 @@ That's pretty much it.
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.
- 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. Although right now rollbacks are behind a - hidden by default - developer menu, the reasoning still stands.
- 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.
- 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.
- It might sound that Playlet Lib is just a workaround for the Roku Channel release process. But phrased differently, Roku Channel release process is not good enough of what we need for Playlet.
@@ -164,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.
- 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)
@@ -186,11 +185,11 @@ Since Component Libraries are simply zip files hosted at some https endpoint, Gi
### Dev library hosted by VS Code Extension
When in debug mode, Playlet lib is packaged and served locally on port 8080, and Playlet app would use it instead of the Playlet lib from Github. This is an important detail, because once you stop debugging in VS Code, the dev app on your Roku TV won't function anymore, with an error:
When in debug mode, Playlet lib is packaged and served locally on port 8086, and Playlet app would use it instead of the Playlet lib from Github. This is an important detail, because once you stop debugging in VS Code, the dev app on your Roku TV won't function anymore, with an error:
> Could not load Playlet component library from any of the following urls:
>
> - \[debug\] http://192.168.1.x:8080/playlet-lib.zip <!-- markdownlint-disable-line -->
> - \[debug\] http://192.168.1.x:8086/playlet-lib.zip <!-- markdownlint-disable-line -->
> Please restart Playlet.
> If the problem persist, contact Playlet authors.
@@ -211,13 +210,13 @@ Additionally, the web server exposes the settings under `/api/preferences`, whic
When Playlet starts, it shows a video feed on the screen. Subscription, Trending videos, and so on.
The layout is defined under [playlet-lib/src/config/default_home_layout.json5](/playlet-lib/src/config/default_home_layout.json5).
The layout is defined under [playlet-lib/src/config/default_home_layout.yaml](/playlet-lib/src/config/default_home_layout.yaml).
This could allow users to define custom layouts, so they can see what they find relevant in the home page. This can include Subscription, Trending, Popular videos, Search per keywords, or Playlists.
Additionally each feed has information on how it is fetched. For now, only Invidious can be data source, but other systems should be configured in the same way.
Invidious API definitions are defined under [playlet-lib/src/config/invidious_video_api.json5](/playlet-lib/src/config/invidious_video_api.json5), and Playlet parses these at runtime and make the right API calls to fetch the data.
Invidious API definitions are defined under [playlet-lib/src/config/invidious_video_api.yaml](/playlet-lib/src/config/invidious_video_api.yaml), and Playlet parses these at runtime and make the right API calls to fetch the data.
Finally, this layout system is what allows both the BrightScript app and the Web app to display the same homepage.
@@ -257,7 +256,7 @@ The web app uses [Svelte](https://svelte.dev/), [Vite](https://vitejs.dev/) and
Since modifying the web app code requires building all three projects (Playlet, Playlet lib, and Playlet web app) this makes the iteration speed very slow, and we lose the benefits of web development, such as hot reloads.
For that reason, the recommended iteration when working on the dev app is:
For that reason, the recommended iteration when working on the web app is:
1. Start `Playlet (dev)` (by selecting `Playlet (dev)` and pressing Play in VS Code)
1. Once Playlet starts, switch to `Playlet Web (dev)` and press play. Do not stop `Playlet (dev)`
@@ -291,7 +290,7 @@ The developer settings are only visible through the web app. They are found at t
For now, it allows you to point to a different Github release other than the default `latest`.
This is mostly useful to QA the `unstable` release in a "production" setting before making it available to all users as the official "latest" version. Consider the `unstable` version a [Canary release](https://en.wikipedia.org/wiki/Feature_toggle#Canary_release)
This is mostly useful to QA the `canary` release (see [Canary release](https://en.wikipedia.org/wiki/Feature_toggle#Canary_release)) in a "production" setting before making it available to all users as the official "latest" version.
#### In case of a softlock
@@ -307,8 +306,8 @@ This will remove the custom lib, and revert to using default (latest release fro
On pull requests, a Github action will run `lint:fix` and `format:fix` and push changes to the PR branch, to keep things tidy.
When merged to main branch, a Github action will build Playlet, run static analysis using Roku's [Static Channel Analysis tool](https://devtools.web.roku.com/#static-channel-analysis-tool), and release a new version tagged `unstable`, with the build artifacts attached, and changelog included.
When merged to main branch, a Github action will build Playlet, run static analysis using Roku's [Static Channel Analysis tool](https://devtools.web.roku.com/#static-channel-analysis-tool), and release a new version tagged `canary`, with the build artifacts attached, and changelog included.
Existing `unstable` release will be removed before creating a new one.
Existing `canary` release will be removed before creating a new one.
This makes [Releasing](./RELEASING.md) simpler.
+9 -7
View File
@@ -3,10 +3,10 @@
# Releasing
The release process for Playlet is very simple, since most of the work is automated.
The automation makes `unstable` releases.
The automation makes `canary` releases.
```makefile
unstable release + QA = stable version
canary release + QA = stable version
```
These are mostly the steps when releasing a new version:
@@ -23,12 +23,12 @@ These are mostly the steps when releasing a new version:
- Title: `Release v$VERSION`
- Comment: `Release $VERSION \nIt should contain everything planned from #6`
- Wait for CI and merge
- Wait for CI on main branch to create the `unstable` release
- Edit `unstable` release
- Wait for CI on main branch to create the `canary` release
- Edit `canary` release
- Tag: `v$VERSION`
- Title: `v$VERSION`
- Body: the content from CHANGELOG.md for this version
- This should be already included, just remove the notes about testing the unstable release
- This should be already included, just remove the notes about testing the canary release
- Uncheck `Set as a pre-release`
- Check `Set as the latest release`
- Click `update release`
@@ -42,7 +42,9 @@ These are mostly the steps when releasing a new version:
For releasing to the store (when needed), this is done following a Playlet lib release:
- Switch to main branch and pull changes - **match commit corresponding to the release.**
- `npm run build:release`
- Switch to main branch and pull changes, **including tags** - **match commit corresponding to the release.**
- `npm run build:release:ci`
- This makes sure to have a valid app in the staging folder
- `npm run sign-released-package`
- This should create the signed package under `release/playlet.pkg`
- Upload to dashboard, and schedule a release (takes a couple of days)
@@ -6,6 +6,6 @@ To test this release:
- Open Playlet web app in a browser (`http://ROKU_IP_ADDRESS:8888/index.html`)
- Go to settings, and scroll down to `Developer settings`
- Set `Playlet Library version` to `unstable` and click `Apply`
- Set `Playlet Library version` to `canary` and click `Apply`
- Restart Playlet
- You can verify that you're testing the `unstable` 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
+48
View File
@@ -0,0 +1,48 @@
<!-- TODO:P1 document models better -->
# Models
ApiEndpoint:
- id
- url
- queryParams
- pathParams
- cacheSeconds
- paginationType
- authenticated
- responseHandler
FeedSource:
- id
- title
- apiType: string ("Invidious")
- endpoint: ApiEndpoint
- pathParams
- queryParams
- state:
- paginationtype (Runtime field)
- page (Runtime field)
- continuation (Runtime field)
- queryParams.page (Runtime field)
- queryParams.continuation (Runtime field)
Feed/FeedContentNode:
- Title
- feedSources: FeedSource[]
- feedSourceIndex (Runtime field)
RowListLayout
- Feed[]
Bookmarks
- BookmarkGroup[]
BookmarkGroup
- title
- feedSources: FeedSource[]
+62 -3
View File
@@ -2,7 +2,7 @@ openapi: 3.0.0
info:
title: Playlet Web API
version: 0.11.0
version: 0.19.0
description:
Playlet Web API is a RESTful API for controlling the Playlet app on
Roku devices. The API is intended to be used by the Playlet web app, but can
@@ -153,7 +153,7 @@ paths:
properties:
index:
type: integer
playlistIndex
playlistIndex:
type: integer
items:
type: array
@@ -178,7 +178,7 @@ paths:
properties:
index:
type: integer
playlistIndex
playlistIndex:
type: integer
items:
type: array
@@ -204,6 +204,64 @@ paths:
responses:
"204":
description: No Content
/api/view/open:
get:
summary: Open a channel view or a playlist view
description: Open a channel view or a playlist view. If a video is playing in full screen, it is shrinked.
operationId: openView
parameters:
- name: channelId
in: query
description: The ID of the channel to open
required: false
schema:
type: string
- name: playlistId
in: query
description: The ID of the playlist to open
required: false
schema:
type: string
responses:
"204":
description: No Content
"400":
description: Bad Request
/api/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:
get:
summary: Get Playlet lib URLs
@@ -515,6 +573,7 @@ components:
type: boolean
sponsorblock.show_notifications:
type: boolean
# TODO:P1 add the rest of properties
PlayQueueObject:
type: object
properties:
+110 -13
View File
@@ -1,12 +1,24 @@
# Playlet Brighterscript Plugins
<!-- markdownlint-disable MD024 -->
- [Json5/Yaml support](#json5yaml-support)
- [Convert images](#convert-images)
- [Manifest editing](#manifest-editing)
- [Validation](#validation)
- [Includes](#includes)
- [@oninit](#oninit)
- [Bindings](#bindings)
- [Async Task Generator](#async-task-generator)
- [Tracking transpilied files](#tracking-transpilied-files)
- [Logger](#logger)
- [Type Gen](#type-gen)
Playlet implements a few [Brighterscript Plugins](https://github.com/rokucommunity/brighterscript/blob/master/docs/plugins.md). The plugins inject themselves in the compilation process, allowing the modification of bs scripts, xml components, and even assets or the app manifest. Let's start with a simple one:
<!-- markdownlint-disable MD024 -->
## Json5/Yaml support
**[Source](tools/bs-plugins/json-yaml-plugin.ts)**
**[Source](/tools/bs-plugins/json-yaml-plugin.ts)**
This plugin allows us to include `jsonc`, `json5` and `yaml` files into the app as static assets. They are an alternative to plain `json`, which for instance, does not support comments. Additionally, this plugin minifies the `json` files.
@@ -18,9 +30,24 @@ Brightscript can only parse json natively using [ParseJson](https://developer.ro
At the end of the build, the plugin scans for certain files (`jsonc`, `json`, `json5` and `yaml`), and converts them to plain json, while keeping the original file name. That way they are all parsable by the [ParseJson](https://developer.roku.com/en-ca/docs/references/brightscript/language/global-utility-functions.md#parsejsonjsonstring-as-string-flags---as-string-as-object) function, even though their original format is not compatible.
## Convert images
**[Source](/tools/bs-plugins/image-gen-plugin.ts)**
This plugin allows us to convert svg files to png files.
### Why
This is used to convert splash screen, app poster, as well as icons in the app. Having svg images (or vector images in general) as the source of truth is better, in case images need to be modified or resized. Since Roku can't load them, we convert them to png.
### How
Each `.svg` file found will have an associated `.svg.meta.json5` file, which will contain the hash (MD5) of the svg, conversion paramters, and the hash of the output files. This allows us to hash existing files and see if a conversion is needed.
Notice how each `.svg` file can be configured to generate multiple png files. This is especially the case to generate the app artwork (splash screen/poster) with different sizes from the same logo `.svg` file.
## Manifest editing
**[Source](tools/bs-plugins/manifest-edit-plugin.ts)**
**[Source](/tools/bs-plugins/manifest-edit-plugin.ts)**
This plugin allows us to make modifications to the app manifest dynamically, mostly based on compiler flags.
@@ -38,7 +65,7 @@ We simply read the content of the original manifest, and modify it before the co
## Validation
**[Source](tools/bs-plugins/validation-plugin.ts)**
**[Source](/tools/bs-plugins/validation-plugin.ts)**
This plugin allows us to add custom diagnostic errors messages to source code, to prevent using certain patterns of functions.
@@ -86,7 +113,7 @@ node.ObserveField("someField", "OnSomeFieldChanged")
## Includes
**[Source](tools/bs-plugins/component-includes-plugin.ts)**
**[Source](/tools/bs-plugins/component-includes-plugin.ts)**
This plugin allows us "include" different pieces of a component, enabling [Composition over inheritance](https://en.wikipedia.org/wiki/Composition_over_inheritance)
@@ -98,7 +125,7 @@ Consider a "behaviour" that we want in multiple components. For example:
<!-- Beep.xml -->
<component name="Beep" extends="Node">
<interface>
<field id="beep" type="boolean" alwaysNotify="true" onChange="OnBeepSet" />
<field id="beepNow" type="boolean" alwaysNotify="true" onChange="OnBeepSet" />
</interface>
<script type="text/brightscript" uri="pkg:/path/to/Beep.bs" />
</component>
@@ -161,7 +188,7 @@ A couple of more details:
## @oninit
**[Source](tools/bs-plugins/oninit-plugin.ts)**
**[Source](/tools/bs-plugins/oninit-plugin.ts)**
`@oninit` is an annotation that can be added to functions, and then these functions will be called in the `Init()` function of the component it is in.
@@ -214,7 +241,7 @@ Important implementation details:
## Bindings
**[Source](tools/bs-plugins/bindings-plugin.ts)**
**[Source](/tools/bs-plugins/bindings-plugin.ts)**
This plugin allows us to "bind" different node references together. It's a simple form of dependency injection to manage dependencies between nodes.
@@ -402,14 +429,14 @@ myNode = CreateObject("roSGNode", "MyComponent")
' Add it to the right parent
myParentNode.appendChild(myNode)
' Trigger the binding manually
myNode@.BindNode(invalid)
myNode@.BindNode()
```
calling `BindNode` will trigger all the binding steps just for this node. But it is expected that all its dependencies are already in the scene and can be found.
## Async Task Generator
**[Source](tools/bs-plugins/asynctask-plugin.ts)**
**[Source](/tools/bs-plugins/asynctask-plugin.ts)**
This plugin generates `Task` components a scripts that makes it simpler to call a function in a background thread, and get the result in a callback function.
@@ -443,7 +470,10 @@ end function
And use the function like so
```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
print(output.result.value)
end if
@@ -452,11 +482,11 @@ 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.
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
**[Source](tools/bs-plugins/track-transpiled-plugin.ts)**
**[Source](/tools/bs-plugins/track-transpiled-plugin.ts)**
By now, you realize we make a lot of transformations to the source code through many plugins. As a sanity check, this plugin allows us to keep track of the transpiled files, so we can be sure that the output is what we expect.
@@ -474,3 +504,70 @@ Additionally, if there's a folder `MyFolder` and `MyFolder.transpiled` in the so
To reduce the noise of this plugin, it only runs when we're making a test build.
Because we continiously make test build in Github actions, the tracked transpilied files will be automatically added to PRs, so that we notice if outputs do not look right.
## Logger
**[Source](/tools/bs-plugins/logger-plugin.ts)**
### Why
The logger plugin does some code transformation to log calls, which can add caller path at compile time, or the filename, based on debug/release configuration.
### How
The logger plugin searches for calls to the predefined functions `LogError`, `LogWarn`, `LogInfo` and `LogDebug`. Once found, it does the following (we take `LogError` as an example):
- It replaces calls of `LogError` with `LogErrorX` where X is the number of arguments.
- For example, it replaces `LogError("Cannot complete operation:", error)` with `LogError2("Cannot complete operation:", error)`
- Based on usage, it generates `LogErrorX` functions used. Example:
```brs
function LogError2(arg0, arg1) as void
logger = m.global.logger
if logger.logLevel < 0
return
end if
m.global.logger.logLine = "[ERROR]" + ToString(arg0) + " " + ToString(arg1)
end function
```
- Finally, it adds the caller file and line number to the args.
- `LogError("Cannot complete operation:", error)` is replaced with `LogError(CALLER, "Cannot complete operation:", error)`
- `CALLER` would be the full path to the source .bs file and line number, for easier debugging
- In release mode, `CALLER` would be only the file name and line number, without the full path. This is so that dev directory does not get "leaked" in releases.
This is implemented to make it easy to identify where logs came from, and to generate log functions with the right number of parameters based on usage. This way we do not need all combination of functions (`LogError`, `LogWarn`, `LogInfo` and `LogDebug` multiplied by number of parameters, `LogError1`, `LogError2`, `LogError3`, and so on). Since brightscript does not support function templates or function overloading, it is either this method, or use optional parameters (but then we would have to check which parameter was passed, and which was is using the default value.) and end up with a log function with logs of if's else'es.
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)
## 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
```
+27 -20
View File
@@ -1,30 +1,37 @@
# Screenshots
## Home
## Playlet
![Home](./home.jpg)
| Home | Search |
| ------------------- | ----------------------- |
| ![Home](./home.jpg) | ![Search](./search.jpg) |
## Search
| Bookmarks | Queue + Picture-in-picture |
| ----------------------------- | ----------------------------------------------------- |
| ![Bookmarks](./bookmarks.jpg) | ![Queue + Picture-in-picture](./queue-pic-in-pic.jpg) |
![Search](./search.jpg)
| Channel | Playlist |
| ------------------------- | --------------------------- |
| ![Channel](./channel.jpg) | ![Playlist](./playlist.jpg) |
## Settings
| Settings | Invidious instances | Invidious testing |
| --------------------------- | ------------------------------------------------ | --------------------------------------------- |
| ![Settings](./settings.jpg) | ![Invidious instances](./invidious-settings.jpg) | ![Invidious testing](./invidious-testing.jpg) |
![Settings](./settings.jpg)
| Link to web app | App info |
| ----------------------------------- | --------------------------- |
| ![Link to web app](./webapp-qr.jpg) | ![App info](./app-info.jpg) |
## Playlist
## Playlet web app
![Playlist](./playlist.jpg)
## Link to web app
![Link to web app](./webapp-qr.jpg)
## App info
![App info](./app-info.jpg)
## Web app
| ![Web app home](./webapp-home.png) | ![Web app search](./webapp-search.png) | ![Web app settings](./webapp-settings.png) |
| Home | Search | Settings |
| ---------------------------------- | -------------------------------------- | ------------------------------------------ |
| ![Web app home](./webapp-home.png) | ![Web app search](./webapp-search.png) | ![Web app settings](./webapp-settings.png) |
| Bookmarks | Remote | Cast video |
| ------------------------------------ | ------------------------------ | -------------------------------- |
| ![Bookmarks](./webapp-bookmarks.png) | ![Remote](./webapp-remote.png) | ![Cast video](./webapp-cast.png) |
| App info | | |
| ------------------------------ | --- | --- |
| ![App info](./webapp-info.png) | | |
Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 123 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 83 KiB

After

Width:  |  Height:  |  Size: 124 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 80 KiB

After

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 639 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 982 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 358 KiB

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 244 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 154 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 362 KiB

After

Width:  |  Height:  |  Size: 751 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 99 KiB

After

Width:  |  Height:  |  Size: 256 KiB

+379 -638
View File
File diff suppressed because it is too large. Load diff
+19 -17
View File
@@ -1,33 +1,35 @@
{
"name": "playlet",
"version": "0.11.0",
"version": "0.19.0",
"description": "Unofficial Youtube client for Roku",
"devDependencies": {
"@rokucommunity/bslint": "^0.8.9",
"@types/fs-extra": "^11.0.1",
"@types/node": "^20.5.9",
"@types/xml2js": "^0.4.12",
"@rokucommunity/bslint": "^0.8.14",
"@types/crypto-js": "^4.2.1",
"@types/fs-extra": "^11.0.4",
"@types/node": "^20.10.7",
"@types/xml2js": "^0.4.14",
"argparse": "^2.0.1",
"brighterscript": "^0.65.5",
"brighterscript-formatter": "^1.6.31",
"brighterscript": "0.65.16",
"brighterscript-formatter": "^1.6.37",
"convert-svg-to-png": "^0.6.4",
"cross-fetch": "^4.0.0",
"crypto-js": "^4.2.0",
"dotenv": "^16.3.1",
"express": "^4.18.2",
"fs-extra": "^11.1.1",
"glob": "^10.3.4",
"fs-extra": "^11.2.0",
"glob": "^10.3.10",
"imap": "^0.8.19",
"ip": "^1.1.8",
"json5": "^2.2.3",
"roku-deploy": "^3.10.3",
"roku-log-bsc-plugin": "^0.8.1",
"rooibos-roku": "^5.7.0",
"ropm": "^0.10.16",
"mailparser": "^3.6.6",
"roku-deploy": "^3.11.2",
"rooibos-roku": "^5.10.0",
"semver": "^7.5.4",
"shelljs": "^0.8.5",
"ts-node": "^10.9.1",
"typescript": "^5.2.2",
"ts-node": "^10.9.2",
"typescript": "^5.3.3",
"xml2js": "^0.6.2",
"yaml": "^2.3.2"
"yaml": "^2.3.4"
},
"engines": {
"node": "18"
@@ -54,10 +56,10 @@
"test:build:app": "cd playlet-app && npm run test:build",
"test:lib": "cd playlet-lib && npm run test",
"test:build:lib": "cd playlet-lib && npm run test:build",
"generate-images": "node tools/generate-images.js",
"version-sync": "node tools/version-sync.js",
"manifest-git-hash": "node tools/update-manifest-git-hash.js",
"sign-package": "node tools/sign-package.js",
"sign-released-package": "node tools/sign-released-package.js",
"screenshot": "node tools/screenshot.js",
"profile-sync": "node tools/profile-sync.js",
"generate-sponsorblock-config": "node tools/generate-sponsorblock-config.js",
+1 -1
View File
@@ -1,5 +1,5 @@
{
"extends": "../config/bsconfig.base.json",
"extends": "../config/bsconfig.base.jsonc",
"rootDir": "src/",
"stagingDir": "../build/playlet-app",
"outFile": "../dist/playlet-app.zip"
+1 -1
View File
@@ -1,5 +1,5 @@
{
"extends": "../config/bsconfig.tests.base.json",
"extends": "../config/bsconfig.tests.base.jsonc",
"rootDir": "src/",
"stagingDir": "../build/playlet-app-tests",
"outFile": "../build/playlet-app-tests.zip"
+2 -19
View File
@@ -1,29 +1,12 @@
{
"name": "playlet-app",
"version": "0.11.0",
"version": "0.19.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "playlet-app",
"version": "0.11.0",
"hasInstallScript": true,
"dependencies": {
"bslib": "npm:@rokucommunity/bslib@^0.1.1"
}
},
"node_modules/bslib": {
"name": "@rokucommunity/bslib",
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/@rokucommunity/bslib/-/bslib-0.1.1.tgz",
"integrity": "sha512-2ox6EUL+UTtccTbD4dbVjZK3QHa0PHCqpoKMF8lZz9ayzzEP3iVPF8KZR6hOi6bxsIcbGXVjqmtCVkpC4P9SrA=="
}
},
"dependencies": {
"bslib": {
"version": "npm:@rokucommunity/bslib@0.1.1",
"resolved": "https://registry.npmjs.org/@rokucommunity/bslib/-/bslib-0.1.1.tgz",
"integrity": "sha512-2ox6EUL+UTtccTbD4dbVjZK3QHa0PHCqpoKMF8lZz9ayzzEP3iVPF8KZR6hOi6bxsIcbGXVjqmtCVkpC4P9SrA=="
"version": "0.19.0"
}
}
}
+2 -9
View File
@@ -1,13 +1,7 @@
{
"name": "playlet-app",
"version": "0.11.0",
"version": "0.19.0",
"description": "Unofficial Youtube client for Roku",
"dependencies": {
"bslib": "npm:@rokucommunity/bslib@^0.1.1"
},
"ropm": {
"rootDir": "./src"
},
"scripts": {
"prebuild": "rm -rf build/playlet-app",
"prebuild:dev": "npm run prebuild",
@@ -22,7 +16,6 @@
"format:fix": "npm run format:base -- --write",
"test": "npm run test:build && npm run test:run",
"test:build": "bsc --project bsconfig.tests.json --create-package --sourceMap=true --debug --test-mode --lintConfig ../config/bslint.jsonc",
"test:run": "node ../tools/run-test-app.js --package ../build/playlet-app-tests.zip",
"postinstall": "npx ropm copy"
"test:run": "node ../tools/run-test-app.js --package ../build/playlet-app-tests.zip"
}
}
@@ -1,13 +1,19 @@
import "LoadingMessages.bs"
import "pkg:/source/Logger.bs"
function Init() as void
m.top.backgroundColor = "0x242424FF"
m.scene = m.top.getScene()
m.top.backgroundColor = "#242424FF"
m.top.backgroundURI = ""
m.loadingIndicator = m.top.findNode("LoadingIndicator")
m.loadingIndicator.visible = true
m.global.addFields({
loadingIndicator: m.loadingIndicator
})
m.loadingIndicator.visible = true
m.loadingIndicator.message = GetLoadingMessage()
m.playletLibUrls = GetPlayletLibUrls()
m.playletLibUrlIndex = 0
@@ -16,17 +22,17 @@ end function
function GetPlayletLibUrls() as object
#if DEBUG
debug = { type: "debug", link: ReadManifestValue("playlet_lib_debug_url") }
debug = { type: "debug", link: Manifest.ReadValue("playlet_lib_debug_url") }
return [debug]
#else
savedUrls = GetPlayletLibUrlsFromRegistry()
savedUrls = Registry.GetPlayletLibUrlsFromRegistry()
if savedUrls <> invalid
m.shouldClearRegistryOnLoadFail = true
return savedUrls
end if
github = { type: "github", link: ReadManifestValue("playlet_lib_remote_url") }
embedded = { type: "embedded", link: ReadManifestValue("playlet_lib_embedded_url") }
github = { type: "github", link: Manifest.ReadValue("playlet_lib_remote_url") }
embedded = { type: "embedded", link: Manifest.ReadValue("playlet_lib_embedded_url") }
return [github, embedded]
#end if
end function
@@ -35,39 +41,31 @@ function LoadPlayletLib() as void
if m.playletLibUrlIndex >= m.playletLibUrls.Count()
m.loadingIndicator.visible = false
if m.shouldClearRegistryOnLoadFail = true
DeleteRegistryKey("playlet_lib_urls", "Playlet")
Registry.DeleteKey("playlet_lib_urls", "Playlet")
end if
ShowPlayletLibLoadErrorDialog()
return
end if
RemoveComponentLibrary()
m.lib = m.top.getScene().createChild("ComponentLibrary")
' bs:disable-next-line NO_OBSERVE_STRING_CALLBACK
m.lib.observeField("loadStatus", "OnLoadStatusChanged")
uri = m.playletLibUrls[m.playletLibUrlIndex].link
' bs:disable-next-line LINT3012
?"Loading Playlet lib from " uri
m.lib.uri = uri
LoadComponentLibrary(uri)
end function
function OnLoadStatusChanged() as void
libUrl = m.playletLibUrls[m.playletLibUrlIndex]
if m.lib.loadStatus = "ready"
RemoveComponentLibrary()
' bs:disable-next-line LINT3012
?"Playlet lib loaded from " libUrl.link
scene = m.top.getScene()
scene.playletLibLoadedUrl = libUrl
container = scene.findNode("MainSceneContainer")
Logger.Log(`Playlet lib loaded from ${libUrl.link} in ${m.timer.TotalMilliseconds()} ms`)
m.timer = invalid
m.scene.playletLibLoadedUrl = libUrl
container = m.scene.findNode("MainSceneContainer")
container.createChild("PlayletLib:MainScene")
return
end if
if m.lib.loadStatus = "failed"
' bs:disable-next-line LINT3012
?"Playlet lib failed to load from " libUrl.link
Logger.Log(`Playlet lib failed to load from ${libUrl.link}`)
' Try next url
m.playletLibUrlIndex += 1
LoadPlayletLib()
@@ -79,11 +77,23 @@ function RemoveComponentLibrary() as void
return
end if
scene = m.top.getScene()
scene.removeChild(m.lib)
m.lib.unobserveField("loadStatus")
m.scene.removeChild(m.lib)
m.lib = invalid
end function
function LoadComponentLibrary(uri as string)
m.timer = CreateObject("roTimespan")
m.timer.mark()
m.lib = m.scene.createChild("ComponentLibrary")
' bs:disable-next-line NO_OBSERVE_STRING_CALLBACK
m.lib.observeField("loadStatus", "OnLoadStatusChanged")
Logger.Log(`Loading Playlet lib from ${uri}`)
m.lib.uri = uri
end function
function ShowPlayletLibLoadErrorDialog()
message = [
"Could not load Playlet component library from any of the following urls:",
@@ -99,5 +109,5 @@ function ShowPlayletLibLoadErrorDialog()
"If the problem persist, contact Playlet authors."
]
ShowErrorDialog(message, bulletText, bottomText)
Dialog.ShowError(message, bulletText, bottomText)
end function
@@ -1,17 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<component name="BootstrapScene" extends="Scene">
<interface>
<field id="exitChannel" type="bool" alwaysNotify="true" />
<field id="launchArgs" type="assocarray" />
<field id="inputArgs" type="assocarray" alwaysNotify="true" />
<field id="playletLibLoadedUrl" type="assocarray" />
<field id="systemLogEvent" type="assocarray" alwaysNotify="true" />
</interface>
<script type="text/brightscript" uri="pkg:/source/Dialog.bs" />
<script type="text/brightscript" uri="pkg:/source/Manifest.bs" />
<script type="text/brightscript" uri="pkg:/source/Registry.bs" />
<children>
<Group id="MainSceneContainer"/>
<Group id="MainSceneContainer" />
<LoadingIndicator id="LoadingIndicator" />
</children>
</component>
@@ -0,0 +1,41 @@
function GetLoadingMessage() as string
messages = GetLoadingMessagesFromCache()
if messages = invalid or messages.count() = 0
messages = [
"Now loading Playlet...",
"One moment please...",
"Downloading the internet...",
"Unclogging the tubes...",
"Warming up the flux capacitor...",
"Loading, ehm, stuff...",
"Restoring quantum entanglement...",
"Searching for kitten videos...",
"One Mississippi... two Mississippi...",
"Checking the TV's extended warranty...",
"Deleting system32...",
"Updating: 3 hours 32 minutes remaining...",
"Asking ChatGPT for humorous loading messages...",
"Loading today's sponsor... NordVPN!",
"Don't worry, this is normal...",
"Don't forget to like and subscribe...",
"Shoveling coal into the server...",
"Counting down from infinity...",
]
end if
index = GetRandom(0, messages.count() - 1)
return messages[index]
end function
function GetLoadingMessagesFromCache() as object
messagesFile = ReadAsciiFile("cachefs:/loading_messages_v1.json")
if messagesFile = invalid or messagesFile = ""
return invalid
end if
return ParseJson(messagesFile)
end function
function GetRandom(min as integer, max as integer) as integer
dateTime = CreateObject("roDateTime")
random = Rnd(max) + dateTime.GetMilliseconds()
return min + (random mod (max - min + 1))
end function
@@ -14,12 +14,10 @@ function PositionSpinner()
centerx = (1280 - m.busyspinner.poster.width) / 2
centery = (720 - m.busyspinner.poster.height) / 2
m.busyspinner.translation = [centerx, centery]
m.busyspinner.visible = true
end if
end function
function OnVisibleChange()
m.busyspinner.visible = m.top.visible
if m.busyspinner.visible
m.busyspinner.control = "start"
else
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<component name="LoadingIndicator" extends="Group">
<interface>
<field id="message" type="string" alias="messageLabel.text" />
</interface>
<children>
<Rectangle
width="1280"
@@ -11,6 +12,16 @@
id="busySpinner"
inheritParentOpacity="false"
spinInterval="1" />
<Label
id="messageLabel"
inheritParentOpacity="false"
width="1280"
height="200"
horizAlign="center"
translation="[0,460]"
wrap="true">
<Font role="font" uri="font:SystemFontFile" size="28" />
</Label>
</Rectangle>
</children>
</component>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.5 KiB

After

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

@@ -1,5 +0,0 @@
<svg viewBox="0 0 24 24" preserveAspectRatio="xMidYMid meet" focusable="false" class="style-scope yt-icon" style="pointer-events: none; display: block; width: 100%; height: 100%;">
<g class="style-scope yt-icon">
<path fill="#FFFFFF" d="M12,9c1.65,0,3,1.35,3,3s-1.35,3-3,3s-3-1.35-3-3S10.35,9,12,9 M12,8c-2.21,0-4,1.79-4,4s1.79,4,4,4s4-1.79,4-4 S14.21,8,12,8L12,8z M13.22,3l0.55,2.2l0.13,0.51l0.5,0.18c0.61,0.23,1.19,0.56,1.72,0.98l0.4,0.32l0.5-0.14l2.17-0.62l1.22,2.11 l-1.63,1.59l-0.37,0.36l0.08,0.51c0.05,0.32,0.08,0.64,0.08,0.98s-0.03,0.66-0.08,0.98l-0.08,0.51l0.37,0.36l1.63,1.59l-1.22,2.11 l-2.17-0.62l-0.5-0.14l-0.4,0.32c-0.53,0.43-1.11,0.76-1.72,0.98l-0.5,0.18l-0.13,0.51L13.22,21h-2.44l-0.55-2.2l-0.13-0.51 l-0.5-0.18C9,17.88,8.42,17.55,7.88,17.12l-0.4-0.32l-0.5,0.14l-2.17,0.62L3.6,15.44l1.63-1.59l0.37-0.36l-0.08-0.51 C5.47,12.66,5.44,12.33,5.44,12s0.03-0.66,0.08-0.98l0.08-0.51l-0.37-0.36L3.6,8.56l1.22-2.11l2.17,0.62l0.5,0.14l0.4-0.32 C8.42,6.45,9,6.12,9.61,5.9l0.5-0.18l0.13-0.51L10.78,3H13.22 M14,2h-4L9.26,4.96c-0.73,0.27-1.4,0.66-2,1.14L4.34,5.27l-2,3.46 l2.19,2.13C4.47,11.23,4.44,11.61,4.44,12s0.03,0.77,0.09,1.14l-2.19,2.13l2,3.46l2.92-0.83c0.6,0.48,1.27,0.87,2,1.14L10,22h4 l0.74-2.96c0.73-0.27,1.4-0.66,2-1.14l2.92,0.83l2-3.46l-2.19-2.13c0.06-0.37,0.09-0.75,0.09-1.14s-0.03-0.77-0.09-1.14l2.19-2.13 l-2-3.46L16.74,6.1c-0.6-0.48-1.27-0.87-2-1.14L14,2L14,2z" class="style-scope yt-icon"></path>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.4 KiB

@@ -0,0 +1,26 @@
{
inputHash: '0536f51fa72c2e4e368ea0e901aadfc1',
outputs: [
{
outputFilePath: 'images/splash-screen_fhd.jpg',
outputHash: 'b15f3a3f1ccc459cbca12cb828b78d16',
width: 1920,
height: 1080,
background: '#242424',
},
{
outputFilePath: 'images/splash-screen_hd.jpg',
outputHash: '25e9c4220f8a42101d6333e548e33aa8',
width: 1280,
height: 720,
background: '#242424',
},
{
outputFilePath: 'images/splash-screen_sd.jpg',
outputHash: 'c54a2f7fa65f443263806962450f2c04',
width: 720,
height: 480,
background: '#242424',
},
],
}
@@ -0,0 +1,4 @@
{
inputHash: 'd61131ccc714d8df0b4514ca76883494',
outputs: [],
}
@@ -0,0 +1,26 @@
{
inputHash: '3452c6ea1c84f59aedf5530bf86a7a51',
outputs: [
{
outputFilePath: 'images/channel-poster_fhd.png',
outputHash: '50729b5bdd2a7c0fd4a1d502812117d4',
width: 540,
height: 405,
background: '#EEEEEE',
},
{
outputFilePath: 'images/channel-poster_hd.png',
outputHash: '8022dc6fa993ce3194c5aea37d6ea49a',
width: 290,
height: 218,
background: '#EEEEEE',
},
{
outputFilePath: 'images/channel-poster_sd.png',
outputHash: '63b8f12ac155c29b4e85db17a2886817',
width: 246,
height: 140,
background: '#EEEEEE',
},
],
}
+5 -3
View File
@@ -2,14 +2,14 @@ title=Playlet
# Do not update version manually, it is auto updated from package.json
major_version=0
minor_version=11
minor_version=19
build_version=00000
ui_resolutions=hd
## Channel Assets
### Main Menu Icons / Channel Poster Artwork
#### Image sizes are FHD: 540x405px | HD: 290x218px | SD: 214x144px
#### Image sizes are FHD: 540x405px | HD: 290x218px | SD: 246x140px
mm_icon_focus_fhd=pkg:/images/channel-poster_fhd.png
mm_icon_focus_hd=pkg:/images/channel-poster_hd.png
mm_icon_focus_sd=pkg:/images/channel-poster_sd.png
@@ -23,11 +23,13 @@ splash_screen_sd=pkg:/images/splash-screen_sd.jpg
splash_color=#242424
splash_min_time=0
confirm_partner_button=1
supports_input_launch=1
playlet_lib_remote_url=https://github.com/iBicha/playlet/releases/latest/download/playlet-lib.zip
playlet_lib_embedded_url=pkg:/lib/playlet-lib.zip
playlet_lib_debug_url=http://DEBUG_HOST_IP_ADDRESS:8080/playlet-lib.zip
playlet_lib_debug_url=http://DEBUG_HOST_IP_ADDRESS:8086/playlet-lib.zip
git_commit_sha=unknown
+41 -19
View File
@@ -1,23 +1,45 @@
function ShowErrorDialog(message as object, bulletText as object, bottomMessage as object)
dialog = CreateObject("roSGNode", "StandardMessageDialog")
dialog.message = message
dialog.bulletText = bulletText
dialog.bottomMessage = bottomMessage
dialog.title = "Error loading Playlet"
dialog.buttons = ["Exit"]
namespace Dialog
' bs:disable-next-line NO_OBSERVE_STRING_CALLBACK
dialog.observeField("buttonSelected", "OnButtonSelected")
' bs:disable-next-line NO_OBSERVE_STRING_CALLBACK
dialog.observeField("wasClosed", "OnDialogClosed")
function ShowError(message as object, bulletText as object, bottomMessage as object)
' Note: dialog can be null since StandardMessageDialog is only available on 10.0 and later
msgDialog = CreateObject("roSGNode", "StandardMessageDialog")
SetPalette(msgDialog)
msgDialog.message = message
msgDialog.bulletText = bulletText
msgDialog.bottomMessage = bottomMessage
msgDialog.title = "Error loading Playlet"
msgDialog.buttons = ["Exit"]
m.top.getScene().dialog = dialog
end function
' bs:disable-next-line NO_OBSERVE_STRING_CALLBACK
msgDialog.observeField("buttonSelected", "OnButtonSelected")
' bs:disable-next-line NO_OBSERVE_STRING_CALLBACK
msgDialog.observeField("wasClosed", "OnDialogClosed")
function OnButtonSelected()
m.top.getScene().dialog.close = true
end function
m.top.getScene().dialog = msgDialog
end function
function SetPalette(msgDialog as object)
palette = createObject("roSGNode", "RSGPalette")
palette.colors = {
DialogBackgroundColor: "#242424FF"
DialogFocusColor: "#CECECEFF"
DialogFocusItemColor: "#202020FF"
DialogSecondaryTextColor: "#DBDBDBFF"
DialogSecondaryItemColor: "#FF1C30FF"
DialogTextColor: "#DBDBDBFF"
}
msgDialog.palette = palette
end function
function OnButtonSelected()
m.top.getScene().dialog.close = true
end function
function OnDialogClosed()
' TODO:P1 throw an exception to cause a crash report to be generated
' Should include which playlet lib failed to load
m.top.getScene().exitChannel = true
end function
end namespace
function OnDialogClosed()
m.top.getScene().exitChannel = true
end function
+20
View File
@@ -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
+32 -25
View File
@@ -1,5 +1,5 @@
' Playlet (App to play videos from an Invidious server on Roku TVs)
' Copyright (C) 2022 Brahim Hadriche
' Copyright (C) 2024 Brahim Hadriche
' 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
@@ -16,33 +16,43 @@
function Main(args as object) as void
screen = CreateObject("roSGScreen")
m.port = CreateObject("roMessagePort")
screen.setMessagePort(m.port)
port = CreateObject("roMessagePort")
screen.setMessagePort(port)
m.global = screen.getGlobalNode()
Logger.Init()
ClearPlayletLibUrlsIfNeeded(args)
Registry.ClearPlayletLibUrlsIfNeeded(args)
scene = screen.CreateScene("BootstrapScene")
screen.show()
scene.ObserveField("exitChannel", m.port)
scene.ObserveField("exitChannel", port)
scene.launchArgs = args
' These vars are needed to pass certification.
' The actual work is done in Playlet Lib
' bs:disable-next-line LINT1005
contentId = args.contentId
' bs:disable-next-line LINT1005
mediaType = args.mediaType
' Do not signal app launch complete here, we're doing it over at Playlet Lib
' This is needed to pass cetification
if false
' These vars are needed to pass certification.
' The actual work is done in Playlet Lib
' bs:disable-next-line LINT1005
contentId = args.contentId
' bs:disable-next-line LINT1005
mediaType = args.mediaType
' Do not signal app launch complete here, we're doing it over at Playlet Lib
' This is needed to pass cetification
scene.signalBeacon("AppLaunchComplete")
end if
input = CreateObject("roInput")
input.setMessagePort(m.port)
input.setMessagePort(port)
' TODO:P1 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
systemLog = CreateObject("roSystemLog")
systemLog.SetMessagePort(port)
systemLog.EnableType("http.connect")
systemLog.EnableType("http.error")
systemLog.EnableType("http.complete")
systemLog.EnableType("bandwidth.minute")
#if DEBUG
' The following comment is to enable the SceneGraph inspector
@@ -54,9 +64,13 @@ function Main(args as object) as void
#end if
while true
msg = wait(0, m.port)
msg = wait(0, port)
msgType = type(msg)
if msgType = "roSGScreenEvent"
if msgType = "roSystemLogEvent"
info = msg.GetInfo()
info.DateTime = info.DateTime.ToISOString()
scene.systemLogEvent = info
else if msgType = "roSGScreenEvent"
if msg.isScreenClosed()
return
end if
@@ -64,7 +78,7 @@ function Main(args as object) as void
field = msg.getField()
data = msg.getData()
if field = "exitChannel" and data = true
END
return
end if
else if msgType = "roInputEvent"
scene.inputArgs = msg.getInfo()
@@ -72,10 +86,3 @@ function Main(args as object) as void
end while
end function
function ClearPlayletLibUrlsIfNeeded(launchArgs as object) as void
if launchArgs = invalid or launchArgs.clearPlayletLibUrls = invalid
return
end if
DeleteRegistryKey("playlet_lib_urls", "Playlet")
end function
+9 -4
View File
@@ -1,4 +1,9 @@
function ReadManifestValue(key as string) as string
appInfo = CreateObject("roAppInfo")
return appInfo.GetValue(key)
end function
namespace Manifest
function ReadValue(key as string) as string
appInfo = CreateObject("roAppInfo")
return appInfo.GetValue(key)
end function
end namespace
+1 -1
View File
@@ -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_embedded_url", "pkg:/lib/playlet-lib.zip")
function _(key as string, expectedValue as string)
m.assertEqual(ReadManifestValue(key), expectedValue)
m.assertEqual(Manifest.ReadValue(key), expectedValue)
end function
end class
+32 -20
View File
@@ -1,22 +1,34 @@
function ReadRegistryKey(key as string, section as string) as dynamic
sec = CreateObject("roRegistrySection", section)
if not sec.Exists(key)
return invalid
end if
return sec.Read(key)
end function
namespace Registry
function DeleteRegistryKey(key as string, section as string)
sec = CreateObject("roRegistrySection", section)
sec.Delete(key)
sec.Flush()
end function
function ReadKey(key as string, section as string) as dynamic
sec = CreateObject("roRegistrySection", section)
if not sec.Exists(key)
return invalid
end if
return sec.Read(key)
end function
function GetPlayletLibUrlsFromRegistry() as object
urlsJson = ReadRegistryKey("playlet_lib_urls", "Playlet")
if urlsJson = invalid
return invalid
end if
urls = ParseJson(urlsJson)
return urls
end function
function DeleteKey(key as string, section as string)
sec = CreateObject("roRegistrySection", section)
sec.Delete(key)
sec.Flush()
end function
function GetPlayletLibUrlsFromRegistry() as object
urlsJson = ReadKey("playlet_lib_urls", "Playlet")
if urlsJson = invalid
return invalid
end if
urls = ParseJson(urlsJson)
return urls
end function
function ClearPlayletLibUrlsIfNeeded(launchArgs as object) as void
if launchArgs = invalid or launchArgs.clearPlayletLibUrls = invalid
return
end if
DeleteKey("playlet_lib_urls", "Playlet")
Logger.Log("Cleared key playlet_lib_urls from registry")
end function
end namespace
+1 -1
View File
@@ -1,5 +1,5 @@
{
"extends": "../config/bsconfig.base.json",
"extends": "../config/bsconfig.base.jsonc",
"rootDir": "src/",
"stagingDir": "../build/playlet-lib",
"outFile": "../dist/playlet-lib.zip"
+1 -1
View File
@@ -1,5 +1,5 @@
{
"extends": "../config/bsconfig.tests.base.json",
"extends": "../config/bsconfig.tests.base.jsonc",
"rootDir": "src/",
"stagingDir": "../build/playlet-lib-tests",
"outFile": "../build/playlet-lib-tests.zip"
+2 -37
View File
@@ -1,47 +1,12 @@
{
"name": "playlet-lib",
"version": "0.11.0",
"version": "0.19.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "playlet-lib",
"version": "0.11.0",
"hasInstallScript": true,
"dependencies": {
"bslib": "npm:@rokucommunity/bslib@^0.1.1",
"log": "npm:roku-log@^0.9.3"
}
},
"node_modules/bslib": {
"name": "@rokucommunity/bslib",
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/@rokucommunity/bslib/-/bslib-0.1.1.tgz",
"integrity": "sha512-2ox6EUL+UTtccTbD4dbVjZK3QHa0PHCqpoKMF8lZz9ayzzEP3iVPF8KZR6hOi6bxsIcbGXVjqmtCVkpC4P9SrA=="
},
"node_modules/log": {
"name": "roku-log",
"version": "0.9.3",
"resolved": "https://registry.npmjs.org/roku-log/-/roku-log-0.9.3.tgz",
"integrity": "sha512-YzvtSCdmZJeimyZZ/C5Y7tdw6vpNMrZV90pg8EPn3vLAtRjtxN3dOt73s48BVOx2W00M0BEGmeaECObS2RdIqg==",
"dependencies": {
"bslib": "npm:@rokucommunity/bslib@^0.1.1"
}
}
},
"dependencies": {
"bslib": {
"version": "npm:@rokucommunity/bslib@0.1.1",
"resolved": "https://registry.npmjs.org/@rokucommunity/bslib/-/bslib-0.1.1.tgz",
"integrity": "sha512-2ox6EUL+UTtccTbD4dbVjZK3QHa0PHCqpoKMF8lZz9ayzzEP3iVPF8KZR6hOi6bxsIcbGXVjqmtCVkpC4P9SrA=="
},
"log": {
"version": "npm:roku-log@0.9.3",
"resolved": "https://registry.npmjs.org/roku-log/-/roku-log-0.9.3.tgz",
"integrity": "sha512-YzvtSCdmZJeimyZZ/C5Y7tdw6vpNMrZV90pg8EPn3vLAtRjtxN3dOt73s48BVOx2W00M0BEGmeaECObS2RdIqg==",
"requires": {
"bslib": "npm:@rokucommunity/bslib@^0.1.1"
}
"version": "0.19.0"
}
}
}
+2 -10
View File
@@ -1,14 +1,7 @@
{
"name": "playlet-lib",
"version": "0.11.0",
"version": "0.19.0",
"description": "Unofficial Youtube client for Roku",
"dependencies": {
"bslib": "npm:@rokucommunity/bslib@^0.1.1",
"log": "npm:roku-log@^0.9.3"
},
"ropm": {
"rootDir": "./src"
},
"scripts": {
"prebuild": "rm -rf build/playlet-lib",
"prebuild:dev": "npm run prebuild",
@@ -25,7 +18,6 @@
"format:fix": "npm run format:base -- --write",
"test": "npm run test:build && npm run test:run",
"test:build": "bsc --project bsconfig.tests.json --create-package --sourceMap=true --debug --test-mode --lintConfig ../config/bslint.jsonc",
"test:run": "node ../tools/run-test-app.js --package ../build/playlet-lib-tests.zip",
"postinstall": "npx ropm copy"
"test:run": "node ../tools/run-test-app.js --package ../build/playlet-lib-tests.zip"
}
}
@@ -1,17 +1,18 @@
import "pkg:/source/utils/Types.bs"
import "pkg:/source/utils/StringUtils.bs"
import "pkg:/source/utils/FocusManagement.bs"
import "pkg:/components/Dialog/DialogUtils.bs"
import "pkg:/source/roku_modules/log/LogMixin.brs"
import "pkg:/components/Navigation/LongPress.bs"
import "pkg:/components/PlayQueue/PlayQueueViewUtils.bs"
import "pkg:/components/VideoPlayer/VideoUtils.bs"
import "pkg:/source/utils/FocusManagement.bs"
import "pkg:/source/utils/Logging.bs"
import "pkg:/source/utils/StringUtils.bs"
import "pkg:/source/utils/Types.bs"
function Init()
m.screens = {}
end function
function OnNodeReady()
m.log = new log.Logger("AppController")
InitializeLongPress(["options"])
NodeSetFocus(m.top.root, true)
end function
@@ -20,7 +21,7 @@ function PushScreen(node as object)
FocusTopScreen(invalid)
end function
function PopScreen(unused as dynamic)
function PopScreen(_unused as dynamic)
childCount = m.stack.getChildCount()
if childCount > 1
m.stack.removeChildIndex(childCount - 1)
@@ -28,7 +29,7 @@ function PopScreen(unused as dynamic)
end if
end function
function FocusTopScreen(unused as dynamic)
function FocusTopScreen(_unused as dynamic)
childCount = m.stack.getChildCount()
topScreen = m.stack.getChild(childCount - 1)
NodeSetFocus(topScreen, true)
@@ -59,7 +60,7 @@ function ShowRootScreen(screenName as string) as void
' insert child at 0 to make sure it is behind the navbar
m.root.insertChild(screen, 0)
if screen.hasField("binding_done")
screen@.BindNode(invalid)
screen@.BindNode()
end if
end if
screen = m.screens[screenName]
@@ -80,12 +81,50 @@ function GetRootScreen(screenName as string) as object
end function
function onKeyEvent(key as string, press as boolean) as boolean
if LongPressHandler(key, press)
return true
end if
if key = OPTIONS_LONG_PRESS_KEY and press
LogInfo("Opening PlayQueueView")
PlayQueueViewUtils.Open(m.top.playQueue, m.top)
return true
end if
if key = "options" and not press
if VideoUtils.ToggleVideoPictureInPicture()
return true
end if
end if
if not press
return false
end if
if key = "options"
VideoUtils.ToggleVideoPictureInPicture()
else if key = "back"
if key = "play"
if VideoUtils.TogglePause()
return true
end if
end if
if key = "pause"
if VideoUtils.PauseVideo()
return true
end if
end if
if key = "playonly"
if VideoUtils.ResumeVideo()
return true
end if
end if
if key = "back"
if VideoUtils.IsVideoPlayerOpen() and not VideoUtils.IsVideoPlayerFullScreen()
if VideoUtils.ToggleVideoPictureInPicture()
return true
end if
end if
dialog = DialogUtils.ShowDialogButtons("Do you want to exit Playlet?", "Exit", ["Exit", "Cancel"])
dialog.observeField("buttonSelected", FuncName(OnExitDialog), ["buttonSelected"])
return true
@@ -97,7 +136,7 @@ end function
function OnExitDialog(event as object)
buttonIndex = event.GetData()
if buttonIndex = 0 ' Exit
m.log.info("Exiting app")
LogInfo("Exiting app")
m.top.getScene().exitChannel = true
end if
end function
@@ -1,9 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<component name="AppController" extends="Group" includes="AutoBind">
<interface>
<field id="root" type="node" />
<field id="stack" type="node" />
<field id="playQueue" type="node" />
<function name="PushScreen" />
<function name="PopScreen" />
<function name="FocusTopScreen" />
@@ -1,4 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<component name="AppRoot" extends="Group" includes="Focus">
</component>
@@ -0,0 +1,11 @@
namespace ChannelUtils
function Open(contentNode as object, appController = invalid as object)
channelView = CreateObject("roSGNode", "ChannelView")
if appController = invalid
appController = m.appController
end if
appController@.PushScreen(channelView)
channelView@.BindNode()
channelView.content = contentNode
end function
end namespace
@@ -0,0 +1,254 @@
import "pkg:/components/Navigation/Navigation.bs"
import "pkg:/source/AsyncTask/AsyncTask.bs"
import "pkg:/source/AsyncTask/Tasks.bs"
import "pkg:/source/utils/DisposableObserve.bs"
import "pkg:/source/utils/FocusManagement.bs"
import "pkg:/source/utils/Logging.bs"
import "pkg:/source/utils/StringUtils.bs"
import "pkg:/source/utils/Types.bs"
function Init()
m.container = m.top.findNode("container")
m.scrollAnimation = m.top.findNode("scrollAnimation")
m.containerTranslation = m.scrollAnimation.findNode("containerTranslation")
m.bannerTranslation = m.scrollAnimation.findNode("bannerTranslation")
m.banner = m.top.findNode("banner")
m.thumbnail = m.top.findNode("thumbnail")
m.authorLabel = m.top.findNode("authorLabel")
m.subscribeButton = m.top.findNode("subscribeButton")
m.rowList = m.top.FindNode("rowList")
m.rowList.focusable = true
m.rowList.screen = m.top
DisposableObserveFieldScoped(m.banner, "loadStatus", FuncName(OnBannerLoadStatus))
m.author = ""
m.authorId = ""
InitializeTabs()
end function
function OnNodeready()
m.rowList@.BindNode()
SetNavigation(m.rowList, "up", m.subscribeButton)
SetNavigation(m.subscribeButton, "down", m.rowList)
m.subscribeButton.text = "Subscribe"
DisposableObserveFieldScoped(m.subscribeButton, "buttonSelected", FuncName(OnSubscribeButtonSelected))
SetSubscribeButtonVisibility()
DisposableObserveFieldScoped(m.invidious, "authToken", FuncName(SetSubscribeButtonVisibility))
OnSubscriptionChanged()
DisposableObserveFieldScoped(m.invidious, "subscriptions", FuncName(OnSubscriptionChanged))
end function
function OnFocusChange() as void
if not m.top.focus
return
end if
NodeSetFocus(m.rowList, true)
end function
function OnContentSet() as void
content = m.top.content
if content = invalid
m.top.authorId = ""
return
end if
' NOTE: "_author" not "author". See PlaylistContentNode.xml for explanation.
m.authorLabel.text = content._author
m.banner.uri = content.banner
if StringUtils.IsNullOrEmpty(content.thumbnail)
m.thumbnail.uri = ""
else
if m.thumbnail.uri <> content.thumbnail or m.thumbnail.loadStatus = "failed"
m.thumbnail.loadingBitmapUri = m.thumbnail.uri
m.thumbnail.uri = content.thumbnail
end if
end if
content@.LoadChannel(m.invidious)
authorId = ValidString(content.authorId)
author = ValidString(content._author)
m.top.authorId = authorId
if (authorId <> m.authorId or author <> m.author) and IsArray(content.tabs)
m.authorId = authorId
m.author = author
m.rowList.feeds = CreateChannelFeeds(m.authorId, author, content.tabs)
end if
end function
function CreateChannelFeeds(authorId as string, author as string, tabs as object) as object
if authorId = ""
return invalid
end if
feeds = []
for i = 0 to tabs.count() - 1
tabName = tabs[i]
if m.tabs.DoesExist(tabName)
feeds.Push(m.tabs[tabName](authorId, author))
end if
end for
return feeds
end function
function OnkeyEvent(key as string, press as boolean) as boolean
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.appController@.PopScreen()
m.top.dispose = true
end function
function OnDispose()
m.rowList.dispose = true
DisposeObservers()
if m.subscribeTask <> invalid
m.subscribeTask.cancel = true
m.subscribeTask = invalid
end if
end function
function OnSubscribeButtonSelected()
if m.subscribeTask <> invalid
m.subscribeTask.cancel = true
end if
isSubbed = IsSubscribed()
m.subscribeTask = AsyncTask.Start(Tasks.SubscribeTask, {
invidious: m.invidious
ucid: m.authorId
subscribe: not isSubbed
})
end function
function OnBannerLoadStatus() as void
status = m.banner.loadStatus
if status <> "ready"
return
end if
bannerAspect = m.banner.bitmapWidth / m.banner.bitmapHeight
bannerHeight = m.banner.width / bannerAspect
m.banner.height = bannerHeight
m.banner.translation = [0, -bannerHeight]
m.banner.visible = true
startPos = [0, -bannerHeight]
endPos = [0, 0]
midPos = [0, (startPos[1] + endPos[1]) / 2]
m.bannerTranslation.keyValue = [startPos, midPos, endPos]
startPos = [0, 0]
endPos = [0, bannerHeight - m.thumbnail.height * 0.4]
midPos = [0, (startPos[1] + endPos[1]) / 2]
m.containerTranslation.keyValue = [startPos, midPos, endPos]
m.scrollAnimation.control = "start"
end function
function InitializeTabs()
m.tabs = {
videos: function(authorId as string, author as string) as object
return CreateChannelFeed("Latest videos", "channel_videos", authorId, author)
end function
shorts: function(authorId as string, author as string) as object
return CreateChannelFeed("Shorts", "channel_shorts", authorId, author)
end function
streams: function(authorId as string, author as string) as object
return CreateChannelFeed("Live", "channel_streams", authorId, author)
end function
podcasts: function(authorId as string, author as string) as object
return CreateChannelFeed("Podcasts", "channel_podcasts", authorId, author)
end function
playlists: function(authorId as string, author as string) as object
return CreateChannelFeed("Playlists", "channel_playlists", authorId, author)
end function
}
end function
function CreateChannelFeed(title as string, endpoint as string, ucid as string, author as string) as object
return {
title: title
feedSources: [{
"id": `inv_${endpoint}_${ucid}`
"title": `${author} - ${title}`
"apiType": "Invidious"
"endpoint": endpoint
"pathParams": {
"ucid": ucid
}
}]
}
end function
function GetContextMenuOptionsForItem(video as object) as object
if StringUtils.IsNullOrEmpty(m.top.authorId)
return []
end if
return m.bookmarks@.GetMenuForChannel(m.top.content)
end function
function IsLoggedIn() as boolean
return m.invidious.authToken <> invalid
end function
function IsSubscribed() as boolean
authorId = m.top.authorId
if StringUtils.IsNullOrEmpty(authorId)
return false
end if
subscriptions = m.invidious.subscriptions
if subscriptions = invalid
return false
end if
if not subscriptions.DoesExist(authorId)
return false
end if
return subscriptions[authorId]
end function
function OnAuthorIdChange()
SetSubscribeButtonVisibility()
OnSubscriptionChanged()
end function
function SetSubscribeButtonVisibility()
isLogged = IsLoggedIn()
m.subscribeButton.visible = isLogged and not StringUtils.IsNullOrEmpty(m.top.authorId)
m.subscribeButton.focusable = m.subscribeButton.visible
if not m.subscribeButton.visible and m.subscribeButton.hasFocus()
NodeSetFocus(m.rowList, true)
end if
end function
function OnSubscriptionChanged()
isSubbed = IsSubscribed()
if isSubbed
m.subscribeButton.text = "Unsubscribe"
else
m.subscribeButton.text = "Subscribe"
end if
end function
@@ -0,0 +1,82 @@
<component name="ChannelView" extends="Group" includes="AutoBind,Focus,ContextMenuProvider,Disposable">
<interface>
<field id="content" type="node" onChange="OnContentSet" />
<field id="authorId" type="string" onChange="OnAuthorIdChange" />
<field id="appController" type="node" bind="/AppController" />
<field id="invidious" type="node" bind="/Invidious" />
<field id="bookmarks" type="node" bind="/Bookmarks" />
</interface>
<children>
<Rectangle
width="1280"
height="720"
color="0x242424">
</Rectangle>
<Poster
id="banner"
width="1280"
visible="false" />
<Group id="container">
<Poster
translation="[115,20]"
width="104"
height="104"
uri="pkg:/images/circle-mask-500.png">
<CirclePoster
id="thumbnail"
width="100"
height="100"
translation="[2,2]"
failedBitmapUri="pkg:/images/thumbnail-missing.jpg" />
<Label
id="authorLabel"
translation="[115,40]"
font="font:MediumBoldSystemFont" />
</Poster>
<Button
id="subscribeButton"
iconUri=""
focusedIconUri=""
showFocusFootprint="true"
minWidth="200"
translation="[930,64]" />
<VideoRowList
itemComponentName="RowCell"
id="rowList"
focusable="false"
translation="[0,160]"
numRows="2"
rowitemSize="[[350,196]]"
rowItemSpacing="[[25,0]]"
itemSize="[1280,326]"
itemSpacing="[0,65]"
rowLabelOffset="[[115,20]]"
focusXOffset="[115]"
showRowLabel="[true]"
rowFocusAnimationStyle="floatingfocus"
variableWidthItems="true"
focusBitmapUri="pkg:/images/focus_grid.9.png" />
<Animation
id="scrollAnimation"
delay="0.3"
duration="0.6">
<Vector2DFieldInterpolator
id="bannerTranslation"
key="[ 0.0, 0.5, 1.0 ]"
fieldToInterp="banner.translation" />
<Vector2DFieldInterpolator
id="containerTranslation"
key="[ 0.0, 0.5, 1.0 ]"
fieldToInterp="container.translation" />
</Animation>
</Group>
</children>
</component>
@@ -0,0 +1,35 @@
import "pkg:/components/Services/Invidious/InvidiousService.bs"
@asynctask
function SubscribeTask(input as object) as object
invidiousNode = input.invidious
ucid = input.ucid
subscribe = input.subscribe
if m.top.cancel
return invalid
end if
service = new Invidious.InvidiousService(invidiousNode)
if subscribe
response = service.Subscribe(ucid)
else
response = service.Unsubscribe(ucid)
end if
if not response.IsSuccess()
error = response.ErrorMessage()
LogError("Failed to subscribe/unsubscribe to channel:", error)
return {
success: false
error: error
}
end if
invidiousNode.refreshSubscribtions = true
return {
success: true
}
end function
@@ -0,0 +1,33 @@
function Init()
m.top.poster = m.top.findNode("Poster")
m.top.maskGroup = m.top.findNode("MaskGroup")
end function
function UpdateMaskSize()
width = m.top.width
height = m.top.height
m.top.maskSize = [width * GetUIScaleFactor(), height * GetUIScaleFactor()]
end function
' MaskGroup component do not scale with with UI resolution
function GetUIScaleFactor() as float
if m.uiScaleFactor <> invalid
return m.uiScaleFactor
end if
if m.global.uiScaleFactor <> invalid
return m.global.uiScaleFactor
end if
deviceInfo = CreateObject("roDeviceInfo")
uiResolutionWidth = deviceInfo.GetUIResolution().width
' divide by 1280 because we have ui_resolutions=hd in manifest
m.uiScaleFactor = uiResolutionWidth / 1280
if not m.global.hasField("uiScaleFactor")
m.global.addField("uiScaleFactor", "float", false)
end if
m.global.uiScaleFactor = m.uiScaleFactor
return m.uiScaleFactor
end function
@@ -0,0 +1,24 @@
<component name="CirclePoster" extends="Group">
<interface>
<field id="poster" type="node" />
<field id="maskGroup" type="node" />
<field id="width" type="integer" alias="Poster.width" onChange="UpdateMaskSize" />
<field id="height" type="integer" alias="Poster.height" onChange="UpdateMaskSize" />
<field id="uri" type="uri" alias="Poster.uri" />
<field id="loadingBitmapUri" type="uri" alias="Poster.loadingBitmapUri" />
<field id="failedBitmapUri" type="uri" alias="Poster.failedBitmapUri" />
<field id="loadStatus" type="string" alias="Poster.loadStatus" />
<field id="maskUri" type="uri" value="pkg:/images/circle-mask-500.png" alias="MaskGroup.maskuri" />
<field id="maskSize" type="vector2d" alias="MaskGroup.maskSize" />
</interface>
<children>
<MaskGroup
id="MaskGroup"
maskuri="pkg:/images/circle-mask-500.png">
<Poster
id="Poster" />
</MaskGroup>
</children>
</component>
@@ -0,0 +1,5 @@
<component name="BookmarkContentNode" extends="ContentNode">
<interface>
<field id="feedSource" type="assocarray" />
</interface>
</component>
@@ -0,0 +1,49 @@
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 Init()
end function
function LoadChannel(invidiousNode as object) 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.ChannelContentTask, {
content: m.top
invidious: invidiousNode
}, OnChannelContentTaskResult)
end function
function OnChannelContentTaskResult(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)
authorId = output.task.input.content.authorId
message = `Failed to load channel ${authorId}\n${error}`
DialogUtils.ShowDialog(message, "Channel load fail", true)
return
end if
end function
@@ -1,7 +1,23 @@
<component name="ChannelContentNode" extends="ContentNode">
<interface>
<field id="type" type="string" value="channel" />
<function name="LoadChannel" />
<field id="HDItemWidth" type="float" value="200" />
<field id="type" type="string" value="channel" />
<field id="loadState" type="string" />
<!-- index in a feed -->
<field id="feedSourcesIndex" type="integer" value="-1" />
<field id="HDItemWidth" type="float" value="196" />
<!-- NOTE: "_author" not "author". See PlaylistContentNode.xml for explanation -->
<field id="_author" type="string" />
<field id="authorId" type="string" />
<field id="banner" type="string" />
<field id="channelHandle" type="string" />
<field id="description" type="string" />
<field id="subCount" type="integer" />
<field id="subCountText" type="string" />
<field id="tabs" type="array" />
<field id="thumbnail" type="string" />
<field id="videoCount" type="integer" />
<field id="videoCountText" type="string" />
</interface>
</component>
@@ -0,0 +1,40 @@
import "pkg:/components/Services/Invidious/InvidiousService.bs"
import "pkg:/components/Services/Invidious/InvidiousToContentNode.bs"
@asynctask
function ChannelContentTask(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)
response = service.GetChannel(contentNode.authorId, 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.ToChannelContentNode(contentNode, metadata, instance)
contentNode.loadState = FeedLoadState.Loaded
return {
success: true
}
end function
@@ -0,0 +1,7 @@
<component name="ContextMenuItemContentNode" extends="ContentNode">
<interface>
<field id="node" type="node" />
<field id="func" type="string" />
<field id="args" type="array" />
</interface>
</component>
@@ -1,8 +1,7 @@
<component name="FeedContentNode" extends="ContentNode">
<interface>
<field id="feed" type="assocarray" />
<field id="feedSources" type="array" />
<field id="feedSourcesIndex" type="integer" />
<field id="loadState" type="string" />
<field id="pagination" type="boolean" />
<field id="page" type="integer" value="0" />
</interface>
</component>
@@ -2,7 +2,9 @@
<interface>
<field id="type" type="string" value="playlist" />
<field id="loadState" type="string" />
<!--
<!-- index in a feed -->
<field id="feedSourcesIndex" type="integer" value="-1" />
<!--
For some strange reason, the "author" field can only be set once.
If you try to set it again, it will not be updated, with type mismatch warning:
@@ -20,11 +22,16 @@
Although we use the field "author" in other components, this is the only place where we modify it after
we set it for the first time (because a saved Playlist belongs to the Invidious user at first, but then
we can query it's original owner)
The issue happens on PlaylistContentNode and ChannelContentNode, but not VideoContentNode.
-->
<field id="_author" type="string" />
<field id="authorId" type="string" />
<field id="playlistId" type="string" />
<field id="thumbnail" type="uri" />
<field id="thumbnailBackground" type="uri" />
<field id="updated" type="integer" />
<field id="updatedText" type="string" />
<field id="videoCount" type="integer" value="-1" />
<field id="videoCountText" type="string" />
<field id="viewCount" type="integer" />
@@ -1,11 +1,13 @@
<component name="VideoContentNode" extends="ContentNode">
<interface>
<field id="type" type="string" value="video" />
<field id="author" type="string" />
<field id="hlsUrl" type="uri" />
<!-- index in a playlist -->
<field id="index" type="integer" value="-1" />
<!-- index in a feed -->
<field id="feedSourcesIndex" type="integer" value="-1" />
<field id="author" type="string" />
<field id="authorId" type="string" />
<field id="isUpcoming" type="boolean" />
<field id="lengthSeconds" type="integer" />
<field id="lengthText" type="string" />
@@ -0,0 +1,171 @@
import "pkg:/source/utils/FocusManagement.bs"
import "pkg:/source/utils/Logging.bs"
import "pkg:/source/utils/StringUtils.bs"
import "pkg:/source/utils/Types.bs"
' TODO:P1 Web app support
' TODO:P1 Web apis and open api spec updates
'
' From the main screen:
' When a video is selected:
' - "Play" - DONE
' - "Queue" - DONE
' - "Open Channel" - DONE
' - "Add to "Videos" bookmark" - DONE
' - If video is already in a bookmark, "Remove from Bookmarks" - DONE
'
' When a channel is selected:
' - "Open" - DONE
' - "Add to "Channels" bookmark" - DONE
' - "Add to <ChannelName> bookmark" - DONE
' - If channel is already in a bookmark, "Remove from Bookmarks" - DONE
' - PlaylistId starting with "IV" cannot be added to a bookmark - DONE
'
' When a playlist is selected:
' - "Play" - DONE
' - "Queue" - DONE
' - "Open" - DONE
' - "Add to "Playlists" bookmark" - DONE
' - "Add to <PlaylistName> bookmark" - DONE
' - If playlist is already in a bookmark, "Remove from Bookmarks" - DONE
' When any:
' - "Reload feed" - DONE
'
' From Playlist view:
' When a video is selected:
' - "Play" - DONE
' - "Queue" - DONE
' - "Play video" - DONE
' - "Queue video" - DONE
' - "Open Channel" - DONE
' - "Add to "Playlists" bookmark" - DONE
' - "Add to <PlaylistName> bookmark" - DONE
' - "Add to "Videos" bookmark" - DONE
'
' From Channel view:
' When a video is selected:
' - "Play" - DONE
' - "Queue" - DONE
' - "Add to "Channels" bookmark" - DONE
' - "Add to <ChannelName> - <feed> bookmark" feed being latest videos, live, shorts, etc - DONE
' - "Add to "Videos" bookmark" - DONE
'
' When a playlist is selected:
' - "Play" - DONE
' - "Queue" - DONE
' - "Open" - DONE
' - "Add to "Channels" bookmark" - DONE
' - "Add to <ChannelName> - <feed> bookmark" feed being latest videos, live, shorts, etc - DONE
' - "Add to "Playlists" bookmark" - DONE
' - "Add to <PlaylistName> bookmark" - DONE
'
' From search view:
' When a video/channel/playlist is selected:
' - Inherit options - DONE
' - "Add to "Search - ${q}" bookmark" - this includes the search filters used - DONE
'
' From bookmarks view:
' When a video/channel/playlist is selected:
' - Inherit options
' - "Remove item from Bookmarks"
' - "Remove group from Bookmarks"
' - "Reload bookmarks" - DONE
'
' TODO:P1 Playlist item seletected from the bookmarks need to play as a playlist, not as a single video
' TODO:P1 Context menu might need to be scrollable (both horizontally and vertically)
' TODO:P1 Context menu might need sections. Example:
' In a Channel view, while selecting a playlist:
' - Channel
' - Add to "Channels" bookmark
' - Other "Channels" related context menu items
' - Playlist
' - Add to "Playlists" bookmark
' - "Play/Queue"
' - Other "Playlists" related context menu items
function Init()
m.optionsList = m.top.findNode("optionsList")
m.showAnimation = m.top.findNode("showAnimation")
end function
function Show(unsued as dynamic)
m.optionsList.ObserveField("itemSelected", FuncName(OnItemSelected))
m.showAnimation.control = "start"
end function
function OnFocusChange() as void
if not m.top.focus
return
end if
NodeSetFocus(m.optionsList, true)
end function
function OnOptionsSet() as void
options = m.top.options
if options = invalid
return
end if
content = CreateObject("roSGNode", "ContentNode")
for each option in options
optionNode = CreateObject("roSGNode", "ContentNode")
optionNode.title = option.title
content.appendChild(optionNode)
end for
m.optionsList.content = content
end function
function OnItemSelected(event as object) as void
index = event.getData()
button = m.optionsList.content.getChild(index)
Close()
LogInfo("Menu button selected:", button.title)
options = m.top.options
if index >= options.count()
LogError("Menu button index out of range:", index)
return
end if
option = options[index]
node = option.node
func = option.func
args = option.args
if node = invalid or StringUtils.IsNullOrEmpty(func) or args = invalid
LogError("Menu button action is invalid")
return
end if
if args.count() = 1
node.callFunc(func, args[0])
else if args.count() = 2
node.callFunc(func, args[0], args[1])
else if args.count() = 3
node.callFunc(func, args[0], args[1], args[2])
else if args.count() = 4
node.callFunc(func, args[0], args[1], args[2], args[3])
else if args.count() = 5
node.callFunc(func, args[0], args[1], args[2], args[3], args[4])
else
LogError("Menu button action has too many arguments")
end if
end function
function OnkeyEvent(key as string, press as boolean) as boolean
if press = false
return false
end if
if key = "back"
Close()
return true
end if
return false
end function
function Close()
m.top.appController@.PopScreen()
end function
@@ -0,0 +1,70 @@
<component name="ContextMenu" extends="Group" includes="Focus">
<interface>
<field id="thumbnail" type="uri" alias="thumbnail.uri" />
<field id="title" type="string" alias="titleLabel.text" />
<field id="subtitle" type="string" alias="subtitleLabel.text" />
<field id="options" type="nodearray" onChange="OnOptionsSet" />
<field id="appController" type="node" />
<function name="Show" />
</interface>
<children>
<Rectangle
id="background"
width="1280"
height="720"
color="#000000"
opacity="0" />
<Rectangle
id="container"
width="470"
height="720"
translation="[-470,0]"
color="0x242424">
<Poster
id="thumbnail"
width="190"
height="110"
loadDisplayMode="scaleToFit"
translation="[40,50]" />
<LayoutGroup
translation="[40,180]"
itemSpacings="[10]">
<Label
id="titleLabel"
width="390"
maxLines="2"
font="font:MediumBoldSystemFont"
wrap="true" />
<Label
id="subtitleLabel"
width="390"
font="font:SmallestBoldSystemFont"
wrap="true" />
</LayoutGroup>
<MarkupList
id="optionsList"
itemSize="[420,50]"
translation="[25,310]"
itemComponentName="ContextMenuRow"
vertFocusAnimationStyle="floatingFocus"
numRows="8" />
</Rectangle>
<Animation id="showAnimation"
duration="0.3"
optional="true">
<FloatFieldInterpolator
id="fadeInterpolator"
key="[0.0, 0.5, 1.0]"
keyValue="[0.0, 0.4, 0.8]"
fieldToInterp="background.opacity" />
<Vector2DFieldInterpolator
id="translationInterpolator"
key="[0.0, 0.5, 1.0]"
keyValue="[[-470,0], [-235,0], [0,0]]"
fieldToInterp="container.translation" />
</Animation>
</children>
</component>
@@ -0,0 +1,29 @@
function OnContentSet() as void
content = m.top.itemContent
if content = invalid
return
end if
m.top.text = content.title
end function
function OnItemHasFocus()
hasFocus = m.top.itemHasFocus
if hasFocus
m.top.font = "font:SmallestBoldSystemFont"
m.top.color = "#262626ff"
else
m.top.font = "font:SmallestSystemFont"
m.top.color = "#DBDBDBFF"
end if
end function
function OnFocusPercent()
if m.top.focusPercent > 0.5
m.top.font = "font:SmallestBoldSystemFont"
m.top.color = "#262626FF"
else
m.top.font = "font:SmallestSystemFont"
m.top.color = "#DBDBDBFF"
end if
end function
@@ -0,0 +1,19 @@
<component name="ContextMenuRow" extends="Group">
<interface>
<field id="text" type="string" alias="label.text" />
<field id="font" type="node" alias="label.font" />
<field id="color" type="color" alias="label.color" />
<field id="itemContent" type="node" onChange="OnContentSet" />
<field id="itemHasFocus" type="boolean" onChange="OnItemHasFocus" />
<field id="listHasFocus" type="boolean" />
<field id="focusPercent" type="float" onChange="OnFocusPercent" />
</interface>
<children>
<ScrollingLabel
id="label"
maxWidth="420"
height="50"
vertAlign="center"
font="font:SmallestSystemFont" />
</children>
</component>
@@ -0,0 +1,76 @@
import "pkg:/source/utils/Logging.bs"
namespace ContextMenuUtils
function Open(providers as object, appController as object, item as object) as object
if item = invalid
return invalid
end if
options = GetOptions(item, providers)
if options.Count() = 0
LogWarn("No context menu options available for item")
return invalid
end if
contextMenu = CreateObject("roSGNode", "ContextMenu")
contextMenu.appController = appController
appController@.PushScreen(contextMenu)
ContextMenuUtils.SetItem(contextMenu, item)
contextMenu.options = options
contextMenu@.Show()
return contextMenu
end function
function SetItem(contextMenu as object, item as object)
title = ""
subtitle = ""
thumbnail = ""
if item.type = "video"
LogInfo("Opening context menu for video:", item.videoId)
title = item.title
subtitle = item.author
thumbnail = item.thumbnail
else if item.type = "playlist"
LogInfo("Opening context menu for playlist:", item.playlistId)
title = item.title
subtitle = item._author
thumbnail = item.thumbnail
else if item.type = "channel"
LogInfo("Opening context menu for channel:", item.authorId)
title = item._author
thumbnail = item.thumbnail
end if
contextMenu.title = title
contextMenu.subtitle = subtitle
contextMenu.thumbnail = thumbnail
end function
function GetOptions(item as object, providers as object) as object
allOptions = []
for each provider in providers
if provider <> invalid and provider.hasField("supportsContextMenu") and provider.supportsContextMenu = true
options = provider@.GetContextMenuOptionsForItem(item)
if options <> invalid
allOptions.append(options)
end if
end if
end for
return allOptions
end function
function CreateOption(title as string, node as object, func as string, args as object) as object
option = CreateObject("roSGNode", "ContextMenuItemContentNode")
option.title = title
option.node = node
option.func = func
option.args = args
return option
end function
end namespace
@@ -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
@@ -12,9 +12,12 @@ namespace DialogUtils
dialog.title = title
dialog.buttons = buttons
if large
deviceInfo = CreateObject("roDeviceInfo")
displaySize = deviceInfo.GetDisplaySize()
dialog.width = displaySize.w - 100
if m._deviceDisplayWidth = invalid
deviceInfo = CreateObject("roDeviceInfo")
displaySize = deviceInfo.GetDisplaySize()
m._deviceDisplayWidth = displaySize.w
end if
dialog.width = m._deviceDisplayWidth - 100
end if
m.top.getScene().dialog = dialog
return dialog
@@ -1,9 +1,11 @@
import "pkg:/source/utils/Types.bs"
import "pkg:/source/asyncTask/asyncTask.bs"
import "pkg:/components/Screens/WebAppScreen/GenerateQrCodeTask.bs"
import "DialogPalette.bs"
import "pkg:/source/AsyncTask/AsyncTask.bs"
import "pkg:/source/AsyncTask/Tasks.bs"
import "pkg:/source/utils/StringUtils.bs"
import "pkg:/source/utils/Types.bs"
function Init()
SetPalette(m.top)
m.urlLabel = m.top.findNode("urlLabel")
m.qrCode = m.top.findNode("QrCodePoster")
@@ -12,9 +14,9 @@ function Init()
end function
function OnNodeReady()
address = m.webserver@.GetServerAddress(invalid)
isValidIp = not StringUtils.IsNullOrEmpty(address)
if isValidIp
address = m.webserver@.GetServerAddress()
isValidAddress = not StringUtils.IsNullOrEmpty(address)
if isValidAddress
m.top.url = `${address}/invidious/login`
else
m.urlLabel.text = "No IP address found"
@@ -31,10 +33,10 @@ function OnUrlSet()
url = m.top.url
m.urlLabel.text = url
StartAsyncTask(GenerateQrCodeTask, {
poster: m.qrCode,
text: url,
size: m.qrCode.loadWidth,
AsyncTask.Start(Tasks.GenerateQrCodeTask, {
poster: m.qrCode
text: url
size: m.qrCode.loadWidth
padding: 10
})
end function
@@ -18,7 +18,7 @@
horizAlign="right"
width="400"
extendToDialogEdge="false"
showDivider="true">
showDivider="false">
<Label
text="Scan the QR Code"
horizAlign="center"
@@ -26,11 +26,11 @@
<Font role="font" uri="font:SystemFontFile" size="24" />
</Label>
<Poster
id='QrCodePoster'
width='300'
height='300'
loadWidth='300'
loadHeight='300'
id="QrCodePoster"
width="300"
height="300"
loadWidth="300"
loadHeight="300"
translation="[50, 50]" />
<Label
id="urlLabel"
@@ -1,6 +1,8 @@
import "DialogPalette.bs"
import "pkg:/source/utils/Types.bs"
function Init()
SetPalette(m.top)
m.top.observeField("buttonSelected", FuncName(CloseDialog))
end function
@@ -1,4 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<component name="SimpleDialog" extends="StandardMessageDialog">
</component>
+4 -3
View File
@@ -1,5 +1,6 @@
import "pkg:/source/utils/StringUtils.bs"
import "pkg:/components/VideoPlayer/VideoUtils.bs"
import "pkg:/source/utils/Logging.bs"
import "pkg:/source/utils/StringUtils.bs"
import "pkg:/source/utils/Types.bs"
function InitEcpArgs()
@@ -14,13 +15,13 @@ end function
function LaunchArgumentsReceived() as void
launchArgs = m.scene.launchArgs
m.log.info("LaunchArgumentsReceived", launchArgs)
LogInfo("LaunchArgumentsReceived", launchArgs)
ProcessArguments(launchArgs)
end function
function InputArgumentsReceived() as void
inputArgs = m.scene.inputArgs
m.log.info("InputArgumentsReceived", inputArgs)
LogInfo("InputArgumentsReceived", inputArgs)
ProcessArguments(inputArgs)
end function
@@ -0,0 +1,86 @@
import "pkg:/source/utils/Logging.bs"
import "pkg:/source/utils/StringUtils.bs"
function Init()
m.top.functionName = "LoggerLoop"
port = CreateObject("roMessagePort")
m.top.ObserveField("logLine", port)
scene = m.top.getScene()
if scene.hasField("systemLogEvent")
scene.ObserveFieldScoped("systemLogEvent", port)
end if
m.port = port
StartLogger(m.top)
end function
function StartLogger(logger as object, logLevel = LogLevel.Info as LogLevel) as void
if m.global.logger <> invalid
return
end if
logger.logLevel = logLevel
m.global.addFields({ logger: logger })
logger.control = "run"
end function
function LoggerLoop()
port = m.port
buffer = CreateObject("roByteArray")
logsFile = m.top.folder + "/" + m.top.filename
previousLogsFile = m.top.folder + "/" + m.top.filenamePrevious
filenameStartup = m.top.filenameStartup
CreateDirectory(m.top.folder)
DeleteFile(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
msg = wait(0, port)
msgType = type(msg)
if msgType = "roSGNodeEvent"
field = msg.getField()
if field = "logLine"
OnLineLog(msg, logsFile, buffer)
else if field = "systemLogEvent"
OnLineSysLog(msg, logsFile, buffer)
end if
end if
end while
end function
function OnLineLog(event as object, logsFile as string, buffer as object)
line = event.getData()
' bs:disable-next-line LINT3012
print line
buffer.FromAsciiString(line + `\n`)
buffer.AppendFile(logsFile)
end function
function OnLineSysLog(event as object, logsFile as string, buffer as object) as void
info = event.getData()
if info.LogType <> "http.error"
return
end if
line = "[ERROR][SysLog] " + ToString(info)
' bs:disable-next-line LINT3012
print line
buffer.FromAsciiString(line + `\n`)
buffer.AppendFile(logsFile)
end function
@@ -0,0 +1,10 @@
<component name="Logger" extends="Task">
<interface>
<field id="logLevel" type="int" value="2" />
<field id="logLine" type="string" alwaysNotify="true" />
<field id="folder" type="string" value="cachefs:/logs" />
<field id="filename" type="string" value="app_logs.txt" />
<field id="filenamePrevious" type="string" value="app_logs_previous.txt" />
<field id="filenameStartup" type="string" value="cachefs:/playlet_startup_logs.txt" />
</interface>
</component>
@@ -1,19 +0,0 @@
import "pkg:/source/asyncTask/asyncTask.bs"
function Init()
m.buffer = CreateObject("roByteArray")
previousLogs = m.top.folder + "/" + m.top.filenamePrevious
newLogs = m.top.folder + "/" + m.top.filename
CreateDirectory(m.top.folder)
DeleteFile(previousLogs)
MoveFile(newLogs, previousLogs)
m.logsPath = newLogs
end function
function logItem(name as string, levelNum as integer, text as string) as void
m.buffer.FromAsciiString(`[${name}] ${text}\n`)
m.buffer.AppendFile(m.logsPath)
end function
@@ -1,10 +0,0 @@
<?xml version='1.0' encoding='UTF-8'?>
<component name='log_FileTransport' extends='Node'>
<interface>
<field id='folder' type='string' value='cachefs:/logs' />
<field id='filename' type='string' value='app_logs.txt' />
<field id='filenamePrevious' type='string' value='app_logs_previous.txt' />
<function name='logItem' />
</interface>
<children />
</component>
+5 -6
View File
@@ -1,11 +1,9 @@
import "pkg:/components/parts/AutoBind/AutoBind.part.bs"
import "pkg:/source/utils/LoadingScreen.bs"
import "pkg:/source/utils/Logging.bs"
import "pkg:/components/EcpArgs.bs"
import "pkg:/components/parts/AutoBind/AutoBind.part.bs"
import "pkg:/components/parts/AutoBind/OnNodeReadyNoOp.bs"
import "pkg:/source/utils/LoadingScreen.bs"
function Init()
InitializeLogging()
m.log = new log.Logger("MainScene")
m.scene = m.top.getScene()
' At this point, the "MainScene" node is not yet added to the scene, and does not have a parent yet.
' Let's wait until it has one.
@@ -19,9 +17,10 @@ function MainSceneContainerChanged()
HideLoadingScreen()
InitEcpArgs()
m.scene.signalBeacon("AppLaunchComplete")
CopyLoadingMessagesToCache()
end function
function StartWebServer()
m.webServer = m.top.findNode("WebServer")
m.webServer@.StartServer(invalid)
m.webServer@.StartServer()
end function
@@ -1,13 +1,10 @@
'import "pkg:/components/parts/AutoBind/AutoBind.part.bs"
'import "pkg:/source/utils/LoadingScreen.bs"
'import "pkg:/source/utils/Logging.bs"
'import "pkg:/components/EcpArgs.bs"
'import "pkg:/components/parts/AutoBind/AutoBind.part.bs"
'import "pkg:/components/parts/AutoBind/OnNodeReadyNoOp.bs"
'import "pkg:/source/utils/LoadingScreen.bs"
function Init()
InitializeBindings() ' auto-generated!
InitializeLogging()
m.log = log_Logger("MainScene")
m.__le = m.log.enabled
m.scene = m.top.getScene()
' At this point, the "MainScene" node is not yet added to the scene, and does not have a parent yet.
' Let's wait until it has one.
@@ -21,6 +18,7 @@ function MainSceneContainerChanged()
HideLoadingScreen()
InitEcpArgs()
m.scene.signalBeacon("AppLaunchComplete")
CopyLoadingMessagesToCache()
end function
function StartWebServer()
Loaded 100 of 400 files, more files were not shown because too many files have changed in this diff. Show more