Compare commits

...
333 Commits
Author SHA1 Message Date
Brahim Hadriche 33ee04fed6 Release v0.24.1 (#401) 2024-06-09 13:02:27 -04:00
Brahim Hadriche cb7e6e4987 tweak 2024-06-09 12:54:39 -04:00
Brahim Hadriche feb58d5209 Add link to "This helps protect our community" error 2024-06-09 12:47:50 -04:00
Brahim Hadriche 52f88ac611 Add channel stability to wiki 2024-06-08 23:48:22 -04:00
Brahim Hadriche ead183f9dc Release v0.24.0 (#398) 2024-06-08 14:56:09 -04:00
Weblate (bot)andBrahim Hadriche 2a3e755953 Translated using Weblate (French (Canada)) (#397)
Currently translated at 100.0% (316 of 316 strings)

Translation: Playlet/Playlet
Translate-URL: https://hosted.weblate.org/projects/playlet/playlet/fr_CA/

Co-authored-by: Brahim Hadriche <brahim.hadriche@gmail.com>
2024-06-08 14:06:51 -04:00
417d4b6954 Translations + UI Refactor (#396)
* Translated using Weblate (English (United States))

Currently translated at 100.0% (316 of 316 strings)

Translation: Playlet/Playlet
Translate-URL: https://hosted.weblate.org/projects/playlet/playlet/en_US/

* Translated using Weblate (German)

Currently translated at 100.0% (316 of 316 strings)

Translation: Playlet/Playlet
Translate-URL: https://hosted.weblate.org/projects/playlet/playlet/de/

* Translated using Weblate (French (Canada))

Currently translated at 98.7% (312 of 316 strings)

Translation: Playlet/Playlet
Translate-URL: https://hosted.weblate.org/projects/playlet/playlet/fr_CA/

* Fix case

* remove "unfinished" attribute

* UI Refactor (#394)

* Setting category refactor

* tweak

* Wip navbar

* profile icon support

* screen offset

* Nav bar animation

* Flexible navbar

* initial focus fix

* Fix settings

* changelog

* comment

* Lint fix

---------

Co-authored-by: Lacey Anaya <yecakeh263@anawalls.com>
Co-authored-by: github-action linter <githubaction@githubaction.com>
2024-06-08 13:18:10 -04:00
Brahim Hadriche a6d8a12bc7 update dependencies (#395) 2024-06-08 13:14:59 -04:00
Brahim Hadriche e6d1fa12d5 [skip ci] update spec 2024-06-04 17:37:53 -04:00
Brahim Hadriche efa4db80de Add colors to test result icons 2024-06-04 13:42:54 -04:00
Brahim Hadriche 4cf4b9e45f update dependencies (#392) 2024-05-31 22:54:27 -04:00
Brahim Hadriche f9bcf1ff78 Memory warnings logs 2024-05-31 13:52:20 -04:00
Brahim Hadriche a8a4915d0e [skip ci] comment 2024-05-31 09:23:16 -04:00
Brahim Hadriche d72c987c33 [skip ci] add duration of lib load time in case of error 2024-05-28 12:15:23 -04:00
Brahim Hadriche a4c4f3d622 Release v0.23.7 (#391) 2024-05-28 11:49:59 -04:00
Brahim Hadriche 91a62cd3ac Bugfix 2024-05-27 09:38:06 -04:00
Brahim Hadriche 057b1fa1ee [skip ci] Error log 2024-05-27 09:32:14 -04:00
Brahim Hadricheandgithub-action linter 090d96c602 Feature/clock (#388)
* Clock

* Adjust clock work

* Lint fix

* Formatting

---------

Co-authored-by: github-action linter <githubaction@githubaction.com>
2024-05-26 19:01:33 -04:00
Brahim Hadriche 1afd295c7c [skip ci] todo 2024-05-26 09:32:27 -04:00
Brahim Hadriche 0d4c224703 update dependencies (#387) 2024-05-24 22:56:14 -04:00
Brahim Hadriche ca1399c60c Release v0.23.6 (#386) 2024-05-23 13:28:42 -04:00
Brahim Hadriche 1acf1da00d Fix failed to create media player error (#385) 2024-05-23 13:11:35 -04:00
Brahim Hadriche 55c811adb7 Add a setting to clear cache 2024-05-21 17:41:30 -04:00
Brahim Hadriche 0bbb876a84 Adjust font weight 2024-05-21 16:41:39 -04:00
Brahim Hadriche 8b15d1113b Fix a bug where video cast from web app would not play if there's an error dialog on screen 2024-05-21 13:05:40 -04:00
Brahim Hadriche ff35ad61ab [skip ci] update user agent 2024-05-20 14:29:47 -04:00
Brahim Hadriche b8fd099d5c Small tweak 2024-05-20 14:12:49 -04:00
Brahim Hadriche 795435ff4b Fix duplicate bookmarked items bug (#383)
* Fix duplicate bookmarked items bug

* Add a check on task state
2024-05-20 14:00:40 -04:00
Brahim Hadriche 7ce5105434 Release v0.23.5 (#382) 2024-05-19 16:44:45 -04:00
Brahim Hadriche 71f32d1305 Seek to end of stream on live videos (#297)
* Seek to end of stream on live videos

* Adjust timestamp and live seeking

* tweak

* Another tweak
2024-05-19 16:27:45 -04:00
Brahim Hadriche ff1ef8c9d8 [skip ci] simplify upgrade command 2024-05-19 15:09:23 -04:00
Brahim Hadriche aebb79a738 update dependencies (#379) 2024-05-19 14:01:41 -04:00
Brahim Hadriche 7bf54c4357 update dependencies (#378) 2024-05-10 22:34:47 -04:00
Brahim Hadriche 0366e54a80 add loading message 2024-05-10 12:33:45 -04:00
Brahim Hadriche 015e84b41e Lounge session crash bug fix 2024-05-10 12:24:53 -04:00
Brahim Hadriche b254a1fe93 Small refactor last exit info 2024-05-06 21:04:21 -04:00
Brahim Hadriche 18445fdcc4 add last exit info 2024-05-06 20:58:38 -04:00
Brahim Hadriche 9af9033462 [skip ci] Update PRIVACY.md 2024-05-05 09:20:48 -04:00
Weblate (bot)andBrahim Hadriche 6ef038492c Translated using Weblate (French (Canada)) (#376)
Currently translated at 100.0% (313 of 313 strings)

Translation: Playlet/Playlet
Translate-URL: https://hosted.weblate.org/projects/playlet/playlet/fr_CA/

Co-authored-by: Brahim Hadriche <brahim.hadriche@gmail.com>
2024-05-04 10:10:53 -04:00
Brahim Hadriche 1606ea9e2c Apply OT region fix to web app 2024-05-04 00:18:31 -04:00
Brahim Hadriche 30a75dc229 update dependencies (#373) 2024-05-03 22:18:03 -04:00
Brahim Hadriche 6a13575681 Release v0.23.4 (#375) 2024-05-03 21:20:20 -04:00
Brahim Hadriche 1f67b307f1 Fix trending and search for OT region (#374) 2024-05-03 21:15:23 -04:00
Brahim Hadriche 37bce62b14 remove unnecessary check 2024-05-01 19:28:58 -04:00
Brahim Hadriche 5dbc8611ed Make enough space for playlists with long names 2024-05-01 13:22:23 -04:00
Brahim Hadriche 4151b39456 [skip ci] small change 2024-04-30 23:23:15 -04:00
Brahim Hadriche b59a0797c9 xml object test 2024-04-29 20:20:40 -04:00
Brahim Hadriche a5766c41ce Add "fetch with CORS" test 2024-04-29 13:17:25 -04:00
Brahim Hadriche 383522372f Fix for public instance field 2024-04-29 09:59:29 -04:00
Brahim Hadriche 92d8cc4f55 [skip ci] changelog typo 2024-04-28 21:14:14 -04:00
Brahim Hadriche 07b4fb7a60 Release v0.23.3 (#369) 2024-04-28 11:28:07 -04:00
Brahim Hadriche e49f1e3023 [skip ci] remove announcement 2024-04-28 11:25:45 -04:00
Brahim Hadriche 83d0b707b5 Change token on PR jobs 2024-04-27 11:23:59 -04:00
Brahim Hadriche ad23a85e4f Small tweaks to trigger job 2024-04-27 11:05:32 -04:00
Brahim Hadriche da417f4fb2 Update docs 2024-04-27 10:51:38 -04:00
github-actions[bot]andiBicha 797b536380 Release v0.23.2 (#366)
Co-authored-by: iBicha <iBicha@users.noreply.github.com>
2024-04-27 10:47:20 -04:00
Brahim Hadriche 8016d66a46 remove default 2024-04-27 10:43:56 -04:00
Brahim Hadriche b08e7c07f3 Add a release trigger for faster releases 2024-04-27 10:42:52 -04:00
Brahim Hadriche a018264f76 Update announcement 2024-04-27 10:22:02 -04:00
github-actions[bot]andiBicha 416a1b86d4 update dependencies (#365)
Co-authored-by: iBicha <iBicha@users.noreply.github.com>
2024-04-26 20:55:38 -04:00
Brahim Hadriche 2e826e02cd Fix for api/queue wrong response parsing 2024-04-25 22:33:06 -04:00
Brahim Hadriche c156865de7 Release v0.23.1 (#364) 2024-04-24 09:19:53 -04:00
Brahim Hadriche faa4b928d9 Add announcement 2024-04-24 09:14:10 -04:00
github-actions[bot]andiBicha 254efb289d update dependencies (#363)
Co-authored-by: iBicha <iBicha@users.noreply.github.com>
2024-04-19 20:37:17 -04:00
github-actions[bot]andiBicha 151d05831c update dependencies (#361)
Co-authored-by: iBicha <iBicha@users.noreply.github.com>
2024-04-12 20:38:25 -04:00
Brahim Hadriche e35fad7d9c Small fix in dial server 2024-04-10 17:49:09 -04:00
Brahim Hadriche f15202593b [skip ci] Update README badge 2024-04-08 09:03:42 -04:00
Brahim Hadriche 58b3405cdc [skip ci] update todos 2024-04-07 11:09:06 -04:00
github-actions[bot]andiBicha 2b1e0fa154 update dependencies (#359)
Co-authored-by: iBicha <iBicha@users.noreply.github.com>
2024-04-05 23:06:53 -04:00
Brahim Hadriche 8a9f0e4dfa small fix 2024-04-04 17:54:10 -04:00
Brahim Hadriche 7ebccaa812 Add on device prerelease testing 2024-04-04 17:49:50 -04:00
Brahim Hadriche 23336c36e8 Navbar version fix 2024-04-04 13:43:46 -04:00
Brahim Hadriche 117fe0ce81 fix for lib selector 2024-04-04 13:37:49 -04:00
Brahim Hadriche 005bf0146d Update changelog 2024-04-04 12:44:49 -04:00
Brahim Hadriche 3697eafc43 Release v0.23.0 (#358) 2024-04-04 12:22:14 -04:00
Brahim Hadriche c741466a85 shorten link in web app 2024-04-04 11:24:20 -04:00
Brahim Hadriche 1cbb52fad4 Load playlet lib as squashfs (#357)
* Load playlet lib as squashfs

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

* Add zip to squash

* squashfs signing

* Format

* add secrets

* release fix

* revert testing

* check for needed commands

* changelog
2024-04-03 17:31:35 -04:00
Brahim Hadriche dc7cded3f5 shorten link 2024-04-02 13:32:03 -04:00
Brahim Hadriche 76a57af5a0 use short git commit hash 2024-04-02 12:13:15 -04:00
Brahim Hadriche e73fc9ab72 http logging tweak 2024-04-02 09:31:35 -04:00
Brahim Hadriche cac9090f4d Fix for disabled popular endpoint 2024-04-01 09:42:30 -04:00
Brahim Hadriche b8ed900769 Adjust web app video rows 2024-04-01 08:29:21 -04:00
Brahim Hadriche 5b452d527e Release v0.22.3 (#355) 2024-03-31 21:50:23 -04:00
Brahim Hadriche 900881e649 remove annoucement - bug is fixed 2024-03-31 21:40:03 -04:00
Brahim Hadriche 2a2cdd8652 Release v0.22.2 (#354) 2024-03-31 14:12:06 -04:00
Brahim Hadriche 15d06c0432 Push transpiled files 2024-03-31 14:09:08 -04:00
Brahim Hadriche ad99fbbf03 Update announcement 2024-03-31 14:08:25 -04:00
Brahim Hadriche d6005115a2 Release v0.22.1 (#353) 2024-03-30 19:43:31 -04:00
Brahim Hadriche c36745c6aa Transpiled files 2024-03-30 19:37:34 -04:00
Brahim Hadriche 595bd87970 Add outage announcement 2024-03-30 19:34:42 -04:00
fcf0334667 [chore] update dependencies (#352)
* update dependencies

* Update lint exceptions for colors

---------

Co-authored-by: iBicha <iBicha@users.noreply.github.com>
Co-authored-by: Brahim Hadriche <brahim.hadriche@gmail.com>
2024-03-29 22:13:56 -04:00
Brahim Hadriche a0b6175858 lounge log command index 2024-03-29 19:50:03 -04:00
Brahim Hadriche 99be2071d1 Simplify timed dialog 2024-03-29 12:48:03 -04:00
Brahim Hadriche 305ddaa737 Add some timestamps to logs 2024-03-29 11:30:54 -04:00
Brahim Hadriche 20816d09f7 Fix/lounge lost session (#351)
* Maybe a fix

* Update CHANGELOG.md

* status reset
2024-03-28 18:38:14 -04:00
Brahim Hadriche 839f49888f todo 2024-03-28 17:28:54 -04:00
Brahim Hadriche b67587df2b TimedDialog bug fix 2024-03-28 17:06:25 -04:00
Brahim Hadriche e5062c34d7 No history sync in tools 2024-03-27 12:39:33 -04:00
Brahim Hadriche 29f5373492 remove duplicate translation 2024-03-25 22:18:36 -04:00
Weblate (bot)andBrahim Hadriche f17e93936c Translated using Weblate (French (Canada)) (#344)
Currently translated at 100.0% (310 of 310 strings)

Translation: Playlet/Playlet
Translate-URL: https://hosted.weblate.org/projects/playlet/playlet/fr_CA/

Co-authored-by: Brahim Hadriche <brahim.hadriche@gmail.com>
2024-03-25 22:15:11 -04:00
Brahim Hadriche c69ab716f5 small refactor modals 2024-03-25 17:29:35 -04:00
Brahim Hadriche bd389473e5 Adjust spacing in settings 2024-03-25 16:45:44 -04:00
Brahim Hadriche cfa7662f2e Update CHANGELOG.md 2024-03-24 23:26:05 -04:00
Brahim Hadriche 609c4622fd Bookmarks to feed refactor 2024-03-24 23:23:23 -04:00
Brahim Hadriche 45262c6394 tweak to registry tool 2024-03-24 21:51:32 -04:00
Brahim Hadriche 7ce3b2636c Release v0.22.0 (#341) 2024-03-24 21:32:22 -04:00
Brahim Hadriche a75ce42373 Adjust queue clear button 2024-03-24 21:12:02 -04:00
Brahim Hadriche fd8b61ad44 Add support for channel releases (#340) 2024-03-24 15:30:43 -04:00
Brahim Hadriche 3391e3d787 Fix search sort filters (#338) 2024-03-24 14:37:40 -04:00
Brahim Hadriche 862fea74e7 Update screenshots 2024-03-24 12:38:23 -04:00
Brahim Hadriche de4f64d38f Small tweak 2024-03-24 12:34:09 -04:00
Brahim Hadriche aab99b2a2e Small fix for lounge api 2024-03-23 23:38:11 -04:00
Brahim Hadriche 51eb7bdfa2 Translation files 2024-03-23 18:34:13 -04:00
Brahim Hadriche 3d52d00bde Update README.md 2024-03-23 18:29:01 -04:00
Brahim Hadriche bd26e727c1 Playlet is now available in English and French 2024-03-23 18:02:57 -04:00
Brahim Hadriche 3b622f65f3 Localize loading messages 2024-03-23 17:14:55 -04:00
Brahim Hadriche 615439650e Locale for context menu (#337) 2024-03-23 14:30:32 -04:00
Brahim Hadriche 25330a6494 More translation work 2024-03-23 00:19:15 -04:00
github-actions[bot]andiBicha 37e429f648 update dependencies (#336)
Co-authored-by: iBicha <iBicha@users.noreply.github.com>
2024-03-22 21:50:19 -04:00
Brahim Hadriche 6e6ea94544 Bug fix 2024-03-22 21:49:16 -04:00
Brahim Hadricheandgithub-action linter 42dadec020 locale for web app (#334)
* locale for web app

* more translations

* Rename profiles service to avoid locale conflict

* More translation work

* Lint fix

---------

Co-authored-by: github-action linter <githubaction@githubaction.com>
2024-03-22 17:43:03 -04:00
Brahim Hadriche 019fde1e67 localize sort options 2024-03-21 21:02:26 -04:00
Brahim Hadriche fb0b1b8894 queue locale 2024-03-20 17:42:46 -04:00
Brahim Hadriche 66df27cf0b locale of publish date fix 2024-03-20 13:19:36 -04:00
Brahim Hadriche feb968a72e Notifications locale 2024-03-20 00:36:38 -04:00
Brahim Hadriche 9061275d6f Missed one 2024-03-19 23:28:32 -04:00
Brahim Hadriche 059167ac56 Changelog 2024-03-19 23:17:39 -04:00
Brahim Hadriche 7330b321a5 Localization part 3 (#333)
* TODO

* TODO

* Add some translations

* Remote screen and settings

* Video player and http client
2024-03-19 23:16:39 -04:00
Brahim Hadriche 9a7db6aab2 Localization part 2 (#332)
* More localization work

* instance testing translation

* Row cell translations

* safety check
2024-03-18 22:53:08 -04:00
Brahim Hadriche 48993dd9f5 Split locale enum, add duplicate values validation 2024-03-18 09:21:42 -04:00
Brahim Hadriche 7d9817994c Localization test (#331)
* Localization test

* More translations

* More translations

* Setup the tooling and validation for the localization

* More translations

* Docs
2024-03-17 22:22:53 -04:00
Brahim Hadriche 403ed94e97 Remove invalid properties 2024-03-17 00:13:00 -04:00
Brahim Hadriche 67252cd5d5 Add network throttling for debugging 2024-03-16 13:49:33 -04:00
Brahim Hadriche e4efc6832f Broadcast safe colors (#330)
* Broadcast safe colors

* changelog
2024-03-16 13:17:17 -04:00
github-actions[bot]andiBicha 13138740fb update dependencies (#329)
Co-authored-by: iBicha <iBicha@users.noreply.github.com>
2024-03-15 21:53:03 -04:00
Brahim Hadriche b37b89bffc Adjust icons 2024-03-13 17:19:28 -04:00
Brahim Hadriche 888f7da214 Buttons, mostly 2024-03-13 13:34:59 -04:00
Brahim Hadricheandgithub-action linter 750e24f724 ButtonEx (#319)
* Finish buttons

* optional animation

* Lint fix

* Remove test stuff

* Lint fix

* Use button

---------

Co-authored-by: github-action linter <githubaction@githubaction.com>
2024-03-12 18:00:07 -04:00
Brahim Hadriche bfd4f3e298 Sort channel videos and playlists (#328)
* Sort channel videos and playlists

* changelog
2024-03-12 16:59:50 -04:00
Brahim Hadriche 7b7801d7a5 Sort channel videos and playlists (#327) 2024-03-12 16:42:03 -04:00
Brahim Hadriche ffb84d1c89 [chore] deps and versions (java version) 2024-03-11 15:48:37 -04:00
Brahim Hadriche d29e51c7f2 [chore] deps and versions 2024-03-11 15:48:03 -04:00
Brahim Hadriche b72a6d4614 Use bold letters for the device display name 2024-03-10 12:19:59 -04:00
Brahim Hadriche 289b845876 Add cancellation support to instance testing 2024-03-10 11:48:11 -04:00
Brahim Hadriche 910d57795a Release v0.21.2 (#324) 2024-03-10 11:14:57 -04:00
Brahim Hadriche ef733d8d88 Fix deep linking 2024-03-10 11:06:16 -04:00
Brahim Hadriche 6ad42f3fcd update metadata 2024-03-09 23:11:28 -05:00
Brahim Hadriche 1ba5184d95 Release v0.21.1 (#323) 2024-03-09 22:59:04 -05:00
Brahim Hadriche 26ed985ecc Bug fixes 2024-03-09 22:55:07 -05:00
Brahim Hadriche 6b47440cb5 Add launch arg to clear 2024-03-09 19:09:11 -05:00
Brahim Hadriche ee3312763d Add a loading indicator to QR codes 2024-03-09 18:34:32 -05:00
Brahim Hadriche 7bb73e0fb6 Dev video player (#321) 2024-03-09 08:44:32 -05:00
f71ad7b873 [chore] update dependencies (#320)
* update dependencies

* no message

---------

Co-authored-by: iBicha <iBicha@users.noreply.github.com>
Co-authored-by: Brahim Hadriche <brahim.hadriche@gmail.com>
2024-03-08 23:30:09 -05:00
Brahim Hadriche 0f6329997d tweak optional chaining rule 2024-03-08 23:14:32 -05:00
Brahim Hadriche 58918f68fb Add a /watch endpoint for easier casting 2024-03-08 13:19:40 -05:00
Brahim Hadriche 8a63bc848d Disallow optional chaining operator 2024-03-08 12:06:41 -05:00
Brahim Hadriche 9315fa6cf7 Added subscriber count in the channel page 2024-03-07 23:12:35 -05:00
Brahim Hadriche 15841cf5bf Release v0.21.0 (#318) 2024-03-07 22:30:36 -05:00
Brahim Hadriche 9c7de8f41f Add user agent to player 2024-03-06 08:26:33 -05:00
Brahim Hadriche 405e1aa703 Revert "use region param in videos api endpoint" (#317)
This reverts commit 79d9e0f069.
2024-03-06 08:26:08 -05:00
Brahim Hadriche 79d9e0f069 use region param in videos api endpoint 2024-03-05 18:14:42 -05:00
Brahim Hadriche d8bfd8859e remove todo 2024-03-04 23:44:36 -05:00
Brahim Hadriche 1c8d075e87 Fix empty invidious instance in preferences 2024-03-04 13:03:59 -05:00
13bb21c1f7 [chore] update dependencies (#314)
* update dependencies

* revert rooibos

---------

Co-authored-by: iBicha <iBicha@users.noreply.github.com>
Co-authored-by: Brahim Hadriche <brahim.hadriche@gmail.com>
2024-03-04 12:40:43 -05:00
Brahim Hadricheandgithub-action linter 394dd23999 Multiple profiles (#312)
* Navbar user profile

* profiles stuff

* fix profile

* Lint fix

* Some ui experiments

* More ui work

* progress

* Lint fix

* migration, web api, wip

* profile view and web app

* web app and apis

* Invidious and profiles

* Lint fix

* bug fix

* Remove ActionContentNode

* Profile icon button, profile color

* Lint fix

* reset server url

* href that doesn't work

* remove activate button on active profile

* TODO

* Fin.

* Final touches

---------

Co-authored-by: github-action linter <githubaction@githubaction.com>
2024-03-04 09:04:34 -05:00
Brahim Hadriche 8e03ca0ea6 Fix empty search results bug 2024-02-27 20:45:32 -05:00
Brahim Hadriche aebdc579a9 Small cleanup 2024-02-27 20:04:12 -05:00
Brahim Hadriche 87e7d91169 Format fix 2024-02-27 17:20:15 -05:00
Brahim Hadriche c334736325 play next video on fail 2024-02-27 17:14:15 -05:00
Brahim Hadriche bb0a0725d6 Release 0.20.2 (#311) 2024-02-26 18:57:52 -05:00
Brahim Hadriche f2ffb42876 refactor url encoded form requests 2024-02-26 18:44:57 -05:00
Brahim Hadriche edbfc86e56 changelog 2024-02-26 09:47:18 -05:00
Brahim Hadriche b25eaafc82 Fix for sponsorblock highlight label 2024-02-26 09:46:20 -05:00
Brahim Hadriche ef9c653ad7 Device connected notification only show once every half hour per device to avoid spam 2024-02-25 22:16:01 -05:00
Andrey LazarevichandBrahim Hadriche e9f015bb19 OK button as Play/Pause (#307)
* OK button as Play/Pause

First OK press now shows Video UI.
It's achievable via hidden Roku Video node property `showUI`, which allows you to override how trickplay should be displayed by specifying parts of the UI to be rendered (like 'titleAndTime', 'trickplayBar', e.t.c). A timer is started every time custom UI is shown to prevent UI from staying forever.

Second OK press while UI is visible pauses the video (pause poster animation is not added yet).

However, since we shouldn't break default OK button actions, we must track whether user is seeking in video UI and if they do, fallback to Video internal OK handler.

Also, auto-formatted VideoPlayer.xml

* fix comment typo

* move HideUI function slightly higher

* Addressed the feedback:

* Add a workaround to leave Live video behavior intact (no pause, ok simply switches UI back and forth)
* Hide UI when minimizing to avoid a bug where title and time element could stay forver
* More aggressive `isSeeking` detection, so every left/right/ff/rw button press would cause us to fall back to default OK button handler

* More accurate liveNow handling

* Changelog

---------

Co-authored-by: Brahim Hadriche <brahim.hadriche@gmail.com>
2024-02-25 20:05:11 -05:00
Brahim Hadriche 544671f246 remove old todo 2024-02-25 19:55:13 -05:00
Brahim Hadriche f45ba30979 Colored logs for debugging (#308)
* Colored logs for debugging

* disable colors
2024-02-25 19:06:27 -05:00
Brahim Hadriche 4953e4481f Rename files for consistency 2024-02-24 19:08:43 -05:00
Brahim Hadriche c7b0815768 New focus 9 patch textures 2024-02-24 19:03:12 -05:00
Brahim Hadriche 4ab7f74a4e More adjustments to context menu 2024-02-24 16:58:18 -05:00
Brahim Hadriche 96916f6c37 Formatting 2024-02-24 11:44:03 -05:00
Brahim Hadriche eafad684b6 Small improvement 2024-02-24 11:40:52 -05:00
Brahim Hadriche 14d3e38aeb Tweaks to remote screen UI 2024-02-23 22:21:44 -05:00
afe281c094 [chore] update dependencies (#306)
* update dependencies

* Update package.json

* lock file

---------

Co-authored-by: iBicha <iBicha@users.noreply.github.com>
Co-authored-by: Brahim Hadriche <brahim.hadriche@gmail.com>
2024-02-23 20:04:14 -05:00
Brahim Hadriche 436078bdf8 Release 0.20.1 (#305) 2024-02-23 18:24:00 -05:00
Brahim Hadriche 20120538e4 Small perf optm 2024-02-23 17:04:33 -05:00
Brahim Hadriche eec4101d29 Fix for repeated 2024-02-23 12:44:55 -05:00
Brahim Hadriche b135ba2a0a Log connect and disconnect events 2024-02-22 23:40:40 -05:00
Brahim Hadriche 9c9f24cb39 rollback rooibos 2024-02-22 19:37:17 -05:00
Brahim Hadriche 6aeb4bc8b9 Changelog 2024-02-22 19:16:55 -05:00
Brahim Hadriche 4beb7fbf3c humor 2024-02-22 19:16:23 -05:00
Brahim Hadriche 4f3512023f Move devices array to lounge api class 2024-02-22 18:58:47 -05:00
Brahim Hadriche f38115171b Error handling for registry script 2024-02-22 17:11:51 -05:00
Brahim Hadriche 7456917cec fix rale tracker warnings 2024-02-22 13:30:51 -05:00
Brahim Hadriche 4482d3333f Update info and screenshots 2024-02-21 19:52:40 -05:00
Brahim Hadriche 1112070f63 Release v0.20.0 (#301) 2024-02-21 19:39:53 -05:00
Brahim Hadriche 37dde57c67 Adjust lounge notification 2024-02-21 19:27:54 -05:00
Brahim Hadriche b52cd6f01b silence unused var warnings 2024-02-21 18:40:42 -05:00
Brahim Hadriche aa5be75e06 changelog typo 2024-02-21 12:57:05 -05:00
Brahim Hadriche 188463c6a7 queue fix 2024-02-20 22:43:02 -05:00
Brahim Hadriche 793842f4dd Do not add entire playlist if it already exists 2024-02-20 22:28:54 -05:00
Brahim Hadriche 7ca98e7ef2 remove region arg from video fetch job 2024-02-20 21:47:49 -05:00
Brahim Hadriche 77204c4449 randomize zx 2024-02-20 16:23:29 -05:00
Brahim Hadriche 190548245a changelog 2024-02-20 12:10:03 -05:00
Brahim Hadriche 71f9820ed6 Improve video queue caching 2024-02-20 11:47:48 -05:00
Brahim Hadriche 87e50e713f Add a TODO 2024-02-19 22:20:55 -05:00
Brahim Hadriche 2d55569614 another small adjustment 2024-02-19 16:32:09 -05:00
Brahim Hadriche 83a59a5e9c small adjustment 2024-02-19 16:31:47 -05:00
Brahim Hadricheandgithub-action linter 7d1ba07286 Cast using Youtube app (DIAL/LoungeAPI) (#276)
* Dial+Lounge API PoC

* format

* Fix for chrome

* comments

* Rate limit and logger stuff

* rename route

* remove invalid routes

* remove device image

* Simplify device description

* command test

* Lint fix

* register pairing code

* tv code UI

* Lint fix

* Avoid creating lots of objects

* dpad command

* small refactor

* tweak

* validation

* timer

* fix

* Revert "timer"

This reverts commit e349565910882408898c9bddda55dadaa9d743de.

* Commands

* setVolume command

* lounge service timer

* Some state messages

* Lint fix

* player state sync

* voice handler

* Adjustments, and add a TODO list

* Lint fix

* comment

* play at timestamp

* Remote screen UI

* UI adjustment

* Small refactor

* Refactor long polling

* Add TODO

* Manage logging a bit better to avoid spam in DIAL server

* cache dial file

* logging

* comment

* Join lounge lazily

* long poller tweak

* ui tweak

* set shouldQuit field

* remote connect notification

* Lint fix

* Randomize device id, new device on start

* Lint fix

* Lounge disconnect on start

* Speed up lounge by not blocking on sent messages

* add version to lounge data saved

* dial server fix rendezvous

* todo

* no message

* Display network name

* playlist changes

* Lint fix

* tweak params

* tweak

* player state

* comments

* Refactor Video Queue (#295)

* Refactor Video Queue

* Video queue and playlists

* Web app casting

* queue playlist notification

* VideoQueueView work

* restore properties

* changes

* queue notification and previous/next state

* Lint fix

* very basic error handling

* Update changelog and privacy policy

---------

Co-authored-by: github-action linter <githubaction@githubaction.com>
2024-02-19 16:30:48 -05:00
github-actions[bot]andiBicha ec9178d687 update dependencies (#294)
Co-authored-by: iBicha <iBicha@users.noreply.github.com>
2024-02-16 21:56:38 -05:00
Brahim Hadriche 84c6d822e2 load embedded lib if libs are not being served in dev mode 2024-02-16 12:24:28 -05:00
Brahim Hadriche 7503c2dbd6 handle live links 2024-02-16 12:22:17 -05:00
Brahim Hadriche ca3cad4058 Adjust filters button 2024-02-13 18:34:04 -05:00
Brahim Hadriche c7f14dfc38 Removed fields from Invidious requests 2024-02-12 22:35:59 -05:00
Brahim Hadriche ac3d1cea17 Small logger optimization 2024-02-12 12:33:39 -05:00
Brahim Hadriche 93ea822f27 Release v0.19.2 (#291) 2024-02-11 10:51:42 -05:00
Brahim Hadriche d73a03d3bf Bug fixes 2024-02-11 10:45:08 -05:00
Brahim Hadriche 45736dd8ec Missed one 2024-02-10 12:57:57 -05:00
Brahim Hadriche 90565ccb07 Name fix 2024-02-10 12:42:34 -05:00
Brahim Hadriche b72173f588 Update transpiled files 2024-02-09 19:49:02 -05:00
github-actions[bot]andiBicha 2d759c1c39 update dependencies (#285)
Co-authored-by: iBicha <iBicha@users.noreply.github.com>
2024-02-09 19:45:13 -05:00
Brahim Hadricheandgithub-action linter 11fb644fc6 Fix queue notification hint (#284)
* Fix queue notification hint

* Lint fix

* duplicate import

---------

Co-authored-by: github-action linter <githubaction@githubaction.com>
2024-02-09 19:34:48 -05:00
Brahim Hadriche b076517c1b Logging fix 2024-02-05 15:20:18 -05:00
Brahim Hadriche 74082f406a Number control (#282) 2024-02-05 10:36:14 -05:00
Brahim Hadriche f3aeb58b38 Misc. (#281)
* Logger

* etag cache fix

* xml refactor

* whitespace

* NodePathUtils

* Http2
2024-02-05 09:56:22 -05:00
github-actions[bot]andiBicha 44ee6681c5 update dependencies (#278)
Co-authored-by: iBicha <iBicha@users.noreply.github.com>
2024-02-02 23:19:46 -05:00
Brahim Hadriche 85e30c8b22 Add additional logs to token verification (#279) 2024-02-02 20:23:06 -05:00
Brahim Hadriche 80d3d24e39 Loop context menu items 2024-01-28 19:00:01 -05:00
Brahim Hadriche a7bdab30bc Plugin fix 2024-01-26 21:12:15 -05:00
github-actions[bot]andiBicha 3858681b80 update dependencies (#274)
Co-authored-by: iBicha <iBicha@users.noreply.github.com>
2024-01-26 21:02:15 -05:00
Brahim Hadriche e0cf59d90f Use POST for search history 2024-01-26 15:52:36 -05:00
Brahim Hadriche d9b8aaa222 Fix dialog not closing on load failure 2024-01-24 16:29:22 -05:00
Brahim Hadriche b1a373f98d Adjust image mask 2024-01-23 16:36:13 -05:00
Brahim Hadricheandgithub-action linter 1078459eb7 Registry router (#273)
* Registry router

* Lint fix

---------

Co-authored-by: github-action linter <githubaction@githubaction.com>
2024-01-22 20:36:47 -05:00
Brahim Hadriche 14cc537032 Clarify that Invidious account is different from Youtube 2024-01-22 18:02:11 -05:00
Brahim Hadriche db755c4158 [skip ci] tweak 2024-01-22 13:51:52 -05:00
Brahim Hadriche ed068f6599 Add a null check 2024-01-22 08:00:19 -05:00
github-actions[bot]andiBicha 45011a54f0 update dependencies (#272)
Co-authored-by: iBicha <iBicha@users.noreply.github.com>
2024-01-20 12:15:16 -05:00
Brahim Hadriche 8c71a5be88 [skip ci] comment 2024-01-17 14:52:04 -05:00
Brahim Hadriche d059fced58 adjust config 2024-01-16 21:44:42 -05:00
Brahim Hadriche ea2be153b0 bug fix 2024-01-16 11:26:09 -05:00
Brahim Hadriche 7e5b2246fa [refactor] web server routing system (#270)
* [refactor] web server routing system

* regex literal

* Docs
2024-01-15 19:25:13 -05:00
Brahim Hadriche a710a23444 Update spinner asset 2024-01-15 12:13:26 -05:00
Brahim Hadriche a3b3a143a5 Add colorInfo to dash 2024-01-13 14:49:10 -05:00
Brahim Hadriche 1172a82a26 Release v0.19.1 (#266) 2024-01-13 11:42:59 -05:00
Brahim Hadriche c002028727 bug fix in retry code 2024-01-13 10:54:22 -05:00
github-actions[bot]andiBicha 3ab65587df update dependencies (#265)
Co-authored-by: iBicha <iBicha@users.noreply.github.com>
2024-01-12 23:04:15 -05:00
Brahim Hadriche 4d4fab4e06 Update README.md 2024-01-12 16:51:02 -05:00
Brahim Hadriche 9cfe14e87e Update README.md 2024-01-12 16:50:45 -05:00
Brahim Hadriche e80a41ca72 [skip ci] various small changes 2024-01-12 10:26:06 -05:00
Brahim Hadriche 4e8dfe1a23 [skip ci] rename 2024-01-11 21:19:05 -05:00
Brahim Hadriche e6302e48fe Full screen hint (#264) 2024-01-11 14:56:41 -05:00
Brahim Hadriche 7796c63291 Change for the search keyboard layout (#262) 2024-01-11 12:19:33 -05:00
Brahim Hadriche dc148a7c59 Bookmark groups added to top of list (#263)
* Bookmark groups added to top of list

* changelog
2024-01-11 11:58:26 -05:00
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
472 changed files with 21683 additions and 5239 deletions

No files matched your search

+3 -3
View File
@@ -24,10 +24,10 @@ jobs:
git config --local user.email "githubaction@githubaction.com"
git config --local user.name "github-action linter"
- name: Use Node.js 18.x
uses: actions/setup-node@v3
- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 18.x
node-version: 20.x
cache: "npm"
- name: Install dependencies
+50
View File
@@ -0,0 +1,50 @@
name: Release trigger
on:
workflow_dispatch:
inputs:
version:
description: "Release version (X.Y.Z)"
required: true
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
jobs:
release-pr:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Set package version
run: npm version ${{ github.event.inputs.version }} --no-git-tag-version
# Replace "## [Unreleased]" with "## [X.Y.Z] - YYYY-MM-DD" in CHANGELOG.md
- name: Set changelog version
run: |
sed -i "s/## \[Unreleased\]/## \[${{ github.event.inputs.version }}\] - $(date +%Y-%m-%d)/" CHANGELOG.md
# Building for release should sync the version in multiple files, and then fail if there are any changes.
- name: Build for release
run: npm run build:release || exit 0
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
commit-message: "Release v${{ github.event.inputs.version }}"
branch: release/${{ github.event.inputs.version }}
title: "Release v${{ github.event.inputs.version }}"
body: "Release ${{ github.event.inputs.version }}. See CHANGELOG.md and roadmap #6 for details."
token: ${{ secrets.GH_TOKEN }}
+26 -11
View File
@@ -17,26 +17,36 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: Use Node.js 18.x
uses: actions/setup-node@v3
- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 18.x
node-version: 20.x
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Build tests
run: npm run test:build
- name: Run tests
run: npm run test
env:
ROKU_DEV_TARGET: ${{ secrets.ROKU_DEV_TARGET }}
ROKU_DEV_TARGET_PORT: ${{ secrets.ROKU_DEV_TARGET_PORT }}
ROKU_DEVPASSWORD: ${{ secrets.ROKU_DEVPASSWORD }}
ROKU_DEV_TARGET_TELNET_PORT: ${{ secrets.ROKU_DEV_TARGET_TELNET_PORT }}
- name: Build Playlet
run: npm run build:release:ci
- name: Build Playlet for release
run: npm run build:release
env:
ROKU_DEV_TARGET: ${{ secrets.ROKU_DEV_TARGET }}
ROKU_DEV_TARGET_PORT: ${{ secrets.ROKU_DEV_TARGET_PORT }}
ROKU_DEVPASSWORD: ${{ secrets.ROKU_DEVPASSWORD }}
ROKU_SIGN_PASSWORD: ${{ secrets.ROKU_SIGN_PASSWORD }}
- name: Use Java 17
uses: actions/setup-java@v3
- name: Use Java 21
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: "17"
java-version: "21"
- name: Download the Static Channel Analysis CLI
run: |
@@ -64,7 +74,12 @@ jobs:
latest_release=$(awk 'BEGIN { RS="## \\[" } NR==2 { print "## ["$0 }' CHANGELOG.md)
echo -e "\n$latest_release" >> docs/canary-changelog.md
# A bug in gh cli causes the release to be created as a draft, and not released.
# See https://github.com/cli/cli/issues/8458
- name: Wait 10 seconds
run: sleep 10
- name: Create Canary release
run: gh release create canary ./release/playlet.zip ./release/playlet-lib.zip --notes-file docs/canary-changelog.md --prerelease --title Canary
run: gh release create canary ./release/playlet.zip ./release/playlet.squashfs.pkg ./release/playlet-lib.zip ./release/playlet-lib.squashfs.pkg --notes-file docs/canary-changelog.md --prerelease --title Canary
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
+3 -3
View File
@@ -24,10 +24,10 @@ jobs:
git config --local user.name "github-action wiki updater"
working-directory: ./playlet.wiki
- name: Use Node.js 18.x
uses: actions/setup-node@v3
- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 18.x
node-version: 20.x
cache: "npm"
- name: Install dependencies
+4 -6
View File
@@ -12,10 +12,10 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: Use Node.js 18.x
uses: actions/setup-node@v3
- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 18.x
node-version: 20.x
cache: "npm"
- name: Install dependencies
@@ -24,9 +24,6 @@ jobs:
- 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:
@@ -34,3 +31,4 @@ jobs:
branch: chore/update-deps
title: "[chore] update dependencies"
body: "Weekly pull request to update dependencies."
token: ${{ secrets.GH_TOKEN }}
+3
View File
@@ -1,4 +1,7 @@
{
"files.associations": {
"**/locale/**/*.ts": "xml"
},
"brightscript.output.clearConsoleOnChannelStart": false,
"brightscript.bsdk": "node_modules/brighterscript",
"editor.formatOnSave": true,
+300 -5
View File
@@ -2,9 +2,304 @@
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [0.24.1] - 2024-06-09
### Added
- A link to [https://github.com/iBicha/playlet/issues/400](https://github.com/iBicha/playlet/issues/400) in error dialog
## [0.24.0] - 2024-06-08
### Added
- Low memory warnings to the app logs for easier memory issue debugging
- German translations (Thanks to Lacey Anaya)
- Sliding navbar (primarily to support German as it has longer words for the menu screens)
### Changed
- Some UI refactors to support the different languages (English, French, German)
## [0.23.7] - 2024-05-28
### Added
- A clock to show the time
### Fixed
- Attempt to fix a race condition when closing player
## [0.23.6] - 2024-05-23
### Added
- A dev setting to clear the cache
### Fixed
- A bug where bookmarked channels can be duplicated
- A bug where video cast from web app would not play if there's an error dialog on screen
- failed to create media player error, by waiting for previous video to stop before starting a new one
### Changed
- Font weight to be less bold
## [0.23.5] - 2024-05-19
### Fixed
- a bug where trending and search wouldn't work in certain countries (web app)
- A crash when lounge session is lost and fails to recover
- A bug where live videos to not start at the "edge" of the stream
## [0.23.4] - 2024-05-04
### Added
- An invidious instance "fetch with CORS" test
### Fixed
- a bug where public Invidious instances all showed `N/A` in the health column
- a bug where trending and search wouldn't work in certain countries
## [0.23.3] - 2024-04-28
### Changed
- Removed announcement - most public instances are now updated
## [0.23.2] - 2024-04-27
### Changed
- Updated announcement
## [0.23.1] - 2024-04-24
### Added
- Announcement dialog to indicate outage
## [0.23.0] - 2024-04-04
### Added
- Loading Playlet lib as squashfs, with fallback to the zip file. This significantly decreases load times.
### Changed
- Bumped minimum OS version to 11, this is required for squashfs-zstd
## [0.22.3] - 2024-03-31
### Changed
- Removed announcement
## [0.22.2] - 2024-03-31
### Changed
- Updated announcement
## [0.22.1] - 2024-03-30
### Added
- Announcement dialog to indicate outage
### Fixed
- [Attempt] A bug where the lounge would randomly lose the session id, making it unable to cast, and spam the same error over and over
- Dialog with timer now stops as expected if any button is pressed
## [0.22.0] - 2024-03-24
### Added
- Context menu sort options for channel videos and playlists
- Localization support and French translations
- Channel releases
### Changed
- Colors to be more broadcast safe
### Fixed
- A bug where instance testing is not immediately cancelled when the testing page is closed
- A bug in the web app where "upcoming" videos show up as "live"
- Search sort filters
## [0.21.2] - 2024-03-10
### Fixed
- Deeplinking required for certification
## [0.21.1] - 2024-03-09
### Added
- Subscriber count in the channel page
### Fixed
- A bug where videos that did not premiere yet would error with a playback error
- A bug where a playback error dialog is dismissed too fast before playing the next video
## [0.21.0] - 2024-03-07
### Added
- Support for multiple profiles. You can now use multiple Invidious accounts.
- When a video error dialog shows, a timer with 10 seconds starts to play the next video
### Fixed
- A bug where the loading screen does not disappear if search results are empty.
- Empty invidious instance in preferences when default instance is being used
## [0.20.2] - 2024-02-26
### Added
- Small improvement in the context menu of the Playlist view
- Videos can be paused and resumed using the `OK` remote button
### Fixed
- `Device connected` notification only show once every 30 minutes per device to avoid spam
- SponsorBlock category "highlight" was not visible in chapter label
### Changed
- UI focus images are now with rounded corners, and with a slight glow
## [0.20.1] - 2024-02-23
### Fixed
- `Device connected` notification showing repeatedly
## [0.20.0] - 2024-02-21
### Added
- Support for casting from the YouTube app (also known as Lounge API, or LeanBack)
- Connect to Playlet from the YouTube mobile app or from certain browsers (such as Chrome)
- Connect to Playlet from local network, or through the TV code.
- On the cast dialog in your YouTube mobile app, you might see two listings for the same device. E.g. `Roku TV` and `Playlet on Roku TV`. Use the `Playlet on` one to cast to Playlet, and the other one to cast to the regular YouTube TV app.
- The functionality is still experiemntal, and has some limitations. To name a few:
- The queue does not perfectly sync between the mobile app and Playlet, espeically if it gets modified by the web app or in Playlet.
- Many functions (such as d-pad controls or setting the volume) are not working due to OS limitations
- Many functions (such as changing the subtitle settings) are not currently implemented
- **ATTENTION**: This feature is not very privacy friendly. When connected to a lounge, all network traffic (videos played, queued, etc) go through YouTube servers. For this reason, certain measures are taken:
- While Playlet broadcasts its casting capabilities to the local network, it does not connect to a lounge for the first time until:
- A device connects to Playlet (using DIAL/Connect using Wi-Fi)
- A `Link with TV code` is generated, by visiting the `Remote` -> `Link with TV code` tab.
- Playlet disconnects from previous lounge sessions on start, and joins a new one instead of one continous session. In other words, restarting Playlet will disconnect your second device. This is a feature, not a bug.
- Playlet does not expose device details, and uses a randomly generated id on each start, instead of consistent device id.
### Changed
- The queue no longer contains playlists. When a playlist is added to the queue, the entire playlist is loaded.
- It can take a few seconds to load large playlist before it can be added to the queue
- This is done to be more compatible more the lounge, which does not contain "Playlists in the queue" concept.
- The `Web App` tab is now called `Remote`. It can be used to open the web app, or connect using Lounge (cast from YouTube)
- Removed `fields` from Invidious requests, as per [https://github.com/iv-org/invidious/pull/4276](https://github.com/iv-org/invidious/pull/4276)
- The `POST /api/queue/` no longer returns the current queue. Instead it returns a 204.
### Fixed
- [Perf] improved some caching of videos in the queue
## [0.19.2] - 2024-02-11
### Fixed
- [Attempt #2] to fix a crash caused by execution timeout when stopping a video takes too long
- Wrong hint on the "added to queue" notification when in fullscreen
- A rare crash when listing Invidious public instances
- Restoring video to full screen not working when on certain screens
## [0.19.1] - 2024-01-13
### Added
- A hint on how to restore video to full screen
### Changed
- Bookmarks are now added to the top of the list
- The search screen keyboard to make it easier to clear the search field
### Fixed
- A bug with request retry mechanism introduced in 0.19.0
## [0.19.0] - 2024-01-10
### Added
- A home screen editor allowing to enable/disable feeds, and change their order.
- The editor can be accessed from the Settings screen.
### Fixed
- `HTTP/0.9 when not allowed` errors by adding a retry to web requests
- Issue where a bookmarked video is no longer valid (such as a video made private, or a live stream that ended)
- [Perf] App loads slightly faster (~500ms)
## [0.18.1] - 2024-01-02
### Fixed
- A rare bug that causes the app to crash when displaying video cells
- A rare bug where a long press can cause a crash
- [Attempt] to fix a crash caused by execution timeout when stopping a video takes too long
- Unsupported subtitles (subtitles that can't be rendered will not be used)
### Removed
- `Funny` and `News` from the Home screen.
- These are not standard feeds (like `Trending`), and are just search results for `Funny` and `News`. They were added in earlier Playlet versions to have more content in the Home screen.
- If you like to add these two feeds to your bookmarks:
- Search for `Funny` (or `News`)
- Set the `Sort by` filter to `Upload date`
- Press and hold the `OK` button while a video from the search result is selected
- Choose the `Add to "Search - Funny"` option
## [0.18.0] - 2023-12-28
### Added
- Medium video quality in the settings (For most videos, this is 360p)
- Invidious watch history feed
### Fixed
- (Regression) Issue where auto-play keeps playing the same videos in a loop
- Small search box styling bug for Safari
- A bug where the skipping of a sponsored section at the end of a video leads to an infinite loop
- A couple of bugs when listing Invidious public instances
### Removed
- Xmas theme logo - can't publish it before end of year... ([link](https://blog.roku.com/developer/channel-store-blackouts-2023))
## [0.17.3] - 2023-12-13
### Added
- Xmas theme logo
## [0.17.2] - 2023-12-10
### Added
@@ -223,7 +518,7 @@ This version went through a major refactor, which resulted in a different arcite
- It reads the response data, headers, error codes and etc even if they are not needed
- Excessive logging without a way to toggle it, or redirect it to a file
- Some unused parts of the code (Like basic auth in the server, WebSockets, RegistryRouter, Kanji QR Code)
- These were unsued and/or feature flagged features. Things can be restored as needed.
- These were unused and/or feature flagged features. Things can be restored as needed.
- The video player loading spinner when the video is minimized: this added too much hacky code with minimum value.
### Fixed
@@ -277,7 +572,7 @@ This version went through a major refactor, which resulted in a different arcite
- Dark mode
- Also includes a dev menu
- Hidden by default, use `dev=1` in the browser to show it
- Improved drag and drop functionality (drag and drop a link from Youtube into the web app)
- Improved drag and drop functionality (drag and drop a link from YouTube into the web app)
- New settings page, available on TV and web app
- New preferences system
- Unified settings between TV and web app
@@ -334,7 +629,7 @@ This version went through a major refactor, which resulted in a different arcite
### Added
- A script to sync between Youtube profile and and Invidious profile
- A script to sync between YouTube profile and and Invidious profile
- Moved most of Playlet logic to Playlet Lib
- Support for multiple caption languages
@@ -382,7 +677,7 @@ This version went through a major refactor, which resulted in a different arcite
- Loading spinner
- Picture in picture support
- [Deep linking support](https://developer.roku.com/en-ca/docs/developer-program/discovery/implementing-deep-linking.md)
- Both Launch arguments and Input arguments are supported, using the "contentId" key as the Youtube video id
- Both Launch arguments and Input arguments are supported, using the "contentId" key as the YouTube video id
- Error and Exit dialogs
### Fixed
+24 -11
View File
@@ -1,39 +1,52 @@
# PRIVACY POLICY
## Playlet
Playlet, the Roku app, does not collect any user information whatsoever.
In fact, it does not have any servers capable of collecting any form of data.
Playlet does not show advertising, whether personalized or non personalized.
## Invidious
Playlet may request information from one or more [Invidious](https://invidious.io/)
servers, depending on user configuration. With these requests, absolutely no
user data is collected, and only the bare minimum and necessary information
servers, depending on user configuration. With these requests, absolutely no
user data is collected, and only the bare minimum and necessary information
is sent, which is used to enable the viewing of content.
Please note that some of the [Invidious](https://invidious.io/) servers used
could be public instances hosted by volenteers. These instances are available
[here](https://api.invidious.io/).
[here](https://api.invidious.io/).
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
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 has privacy concerns, they can host their own
Invidious instance and use it from Playlet.
## SponsorBlock
Playlet may request information from a [SponsorBlock](https://github.com/ajayyy/SponsorBlock)
server, in order to get sponsor sections for requested videos to watch.
With these requests, absolutely no
user data is collected, and only the bare minimum and necessary information
With these requests, absolutely no
user data is collected, and only the bare minimum and necessary information
is sent, which is used to enable the viewing of content.
Playlet uses hashing when requesting video metadata, which obfuscates
Playlet uses hashing when requesting video metadata, which obfuscates
the video id requested. This is a SponsorBlock privacy feature that protects
user privacy.
Additionally, Playlet may send a "skipped" event to SponsorBlock, to indicate
that a section of a video has been skipped. This event does not have any
tracking information attached to it, and it is anonymous. It is merely to
indicate to contributers how much their contributions are being used in the wild.
that a section of a video has been skipped. This event does not have any
tracking information attached to it, and it is anonymous. It is merely to
indicate to contributors how much their contributions are being used in the wild.
## LeanBack
LeanBack, also known as Lounge API, also known as "cast from phone". Is a feature that Playlet implmements as a convenience to allow users to use a separate device to browse and cast videos.
When this feature is used, all traffic related to the videos being watched, added to the queue, and the video player state is routed through YouTube servers.
Playlet tries to preserve user privacy, to the best of its ability, by implementing several techniques, such as randomizing device id, using a fresh session on each start, and only providing necessary fields for the feature to function.
Additionally, Playlet does not join a session/lounge, until a device is attempting to connect using DIAL (**DI**scovery **A**nd **L**aunch spec) also know sa "Connect with Wi-Fi", or when a `Link with TV code` is generated, by visiting the appropriate settings page.
If you have privacy concerns and do not wish to use this functionality, simply do not connect from a local network using the YouTube app or the browser, and do not visit the `Link with TV code` tab.
+17 -13
View File
@@ -7,7 +7,10 @@
</a>
<a href="https://github.com/iBicha/playlet/releases">
<img alt="Current Release" src="https://img.shields.io/github/release/iBicha/playlet.svg"/>
<img alt="Total Downloads" src="https://img.shields.io/github/downloads/iBicha/playlet/latest/playlet-lib.zip.svg"/>
<img alt="Total Downloads" src="https://img.shields.io/github/downloads/iBicha/playlet/latest/playlet-lib.squashfs.pkg.svg"/>
</a>
<a href="https://hosted.weblate.org/engage/playlet/">
<img src="https://hosted.weblate.org/widget/playlet/svg-badge.svg" alt="Translation status" />
</a>
<a href="/LICENSE">
<img alt="AGPL-3.0 license" src="https://img.shields.io/github/license/iBicha/playlet.svg"/>
@@ -19,7 +22,7 @@
# Playlet
Playlet is an unofficial Youtube client for Roku 📺
Playlet is an unofficial YouTube client for Roku 📺
## Screenshots
@@ -42,16 +45,16 @@ More under [Screenshots](./docs/screenshots/README.md)
- 🕵️ No Tracking
- 🛡️ Privacy driven (uses Invidious backend)
- ⚔️ SponsorBlock integration (skips undesirable sections in videos)
- 📱 Browse, search, and cast from phone using the web app
- 📱 Browse, search, and cast from phone using the YouTube app or the browser
- 🔮 Picture-in-picture mode
- ⚡ Fast! [Check out how we compare with the official Youtube app](https://youtu.be/qmSvA-QQW20)
- ⚡ Fast! [Check out how we compare with the official YouTube app](https://youtu.be/qmSvA-QQW20)
### Cast from phone
1. Open "Web app" tab in Playlet
1. Scan QR Code with Phone
1. Browse or search videos
1. Click the video and choose the "Play on TV" option
- Open "Remote" tab in Playlet
- Scan QR Code with Phone, and use the browser; OR
- Use the YouTube app to connect using the same Wi-Fi; OR
- Use the `Link with TV code` to connect
### Picture-in-picture
@@ -63,7 +66,7 @@ More under [Screenshots](./docs/screenshots/README.md)
1. Open settings in Playlet
1. Select Invidious -> Instance
1. Set a custom instance, or choose a public one hosted by volunteers (from https://api.invidious.io/)
1. Set a custom instance, or choose a public one hosted by volunteers (from [api.invidious.io](https://api.invidious.io/))
1. Optionally, Select `Test instance` to make sure it works
1. Hit save
@@ -76,7 +79,7 @@ For everything related to Playlet app development, please see the [documentation
## 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.
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.
@@ -89,10 +92,10 @@ play•let /ˈplālət/
: a short play
```
**Playlet** is about keeping the time you spend on Youtube short and useful. It values your time, so it does not show you ads, and allows you to skip sponsored sections and other irrelevant information that's designed to monitize you and/or waste your time.
**Playlet** is about keeping the time you spend on YouTube short and useful. It values your time, so it does not show you ads, and allows you to skip sponsored sections and other irrelevant information that's designed to monitize you and/or waste your time.
There's a cliché about how a lot of open source software is **`"Made with ♡"`**. This project in particular is **not**.<br/>
**Playlet** was created out of **spite**, because I believe I have watched enough back-to-back, unskippable Youtube ads for a lifetime.
**Playlet** was created out of **spite**, because I believe I have watched enough back-to-back, unskippable YouTube ads for a lifetime.
By removing all the bloat, the ads, the tracking, we could end up with an even faster app than the official one.
@@ -101,6 +104,7 @@ In any case, I hope you find **Playlet** useful, and pleasant to use.
## Disclaimer
**Playlet** does not serve or distribute any material from unauthorized sources.<br/>
**Playlet** is simply a frontend to other systems (such as [Invidious](https://github.com/iv-org/invidious)), bringing the watching experience to the TV, as opposed to the existing frontends that are web and mobile focused.
**Playlet** is simply a frontend to other systems (such as [Invidious](https://github.com/iv-org/invidious)), bringing the watching experience to the TV, as opposed to the existing frontends that are web and mobile focused.<br/>
**Playlet** authors acknowledge that all trademarks and registered trademarks mentioned in this repository and related pages are the property of their respective owners. The use of these trademarks or trade names is for identification purposes only and does not imply any endorsement, affiliation, or sponsorship by the trademark owner.
<!-- markdownlint-configure-file {"MD024": { "siblings_only": true } } -->
-65
View File
@@ -1,65 +0,0 @@
{
"autoImportComponentScript": true,
"createPackage": false,
"diagnosticFilters": [
{
"src": "**/roku_modules/**/*.*"
},
1090
],
"diagnosticLevel": "error",
"validation": [
{
"code": "NO_SET_FOCUS",
"regex": "\\.SetFocus\\(.+\\)",
"regexFlags": "ig",
"message": "SetFocus() is not allowed. Use NodeSetFocus() instead."
},
{
"code": "NO_OBSERVE_STRING_CALLBACK",
"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."
}
],
"files": [
"source/**",
"components/**",
"images/**",
"!**/*.svg",
"!**/*.svg.meta.json5",
"fonts/**",
"config/**",
"lib/**",
"www/**",
"manifest",
"!**/*.transpiled/**",
"!**/*.transpiled.*",
"!**/*.spec.bs",
"!**/tests/**"
],
"lintConfig": "./config/bslint.jsonc",
"plugins": [
"@rokucommunity/bslint",
"../tools/bs-plugins/asynctask-plugin.ts",
"../tools/bs-plugins/manifest-edit-plugin.ts",
"../tools/bs-plugins/component-includes-plugin.ts",
"../tools/bs-plugins/bindings-plugin.ts",
"../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/logger-plugin.ts",
"../tools/bs-plugins/image-gen-plugin.ts"
],
"retainStagingDir": true,
"require": [
"ts-node/register"
],
"rokuLog": {
"insertPkgPath": true,
"removeComments": false,
"strip": false
},
"sourceMap": true
}
+98
View File
@@ -0,0 +1,98 @@
{
"autoImportComponentScript": true,
"createPackage": false,
"diagnosticFilters": [
{
"src": "components/**/*.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",
"regex": "\\.SetFocus\\(.+\\)",
"regexFlags": "ig",
"message": "SetFocus() is not allowed. Use NodeSetFocus() instead."
},
{
"code": "NO_OBSERVE_STRING_CALLBACK",
"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)"
},
{
"code": "NO_OPTIONAL_CHAINING",
"regex": "\\?[\\.|\\[|\\(|@]",
"regexFlags": "ig",
"message": "No optional chaning (var1?.property). Do a type check instead."
},
{
"code": "NO_TRANSLATE_STRING_LITERAL",
"regex": "\\bTr\\s*\\(\\s*\"[^\\\"]*\"\\s*\\)",
"regexFlags": "ig",
"message": "Tr(\"String\") is not allowed. Use Tr(Locale.Key) instead."
}
],
"files": [
"source/**",
"components/**",
"!components/**/*.part.xml",
"images/**",
"!**/*.psd",
"!**/*.svg",
"!**/*.svg.meta.json5",
"locale/**",
"config/**",
"lib/**",
"www/**",
"manifest",
"!**/*.transpiled/**",
"!**/*.transpiled.*",
"!**/*.spec.bs",
"!**/tests/**"
],
"lintConfig": "./config/bslint.jsonc",
"plugins": [
"@rokucommunity/bslint",
"../tools/bs-plugins/asynctask-plugin.ts",
"../tools/bs-plugins/manifest-edit-plugin.ts",
"../tools/bs-plugins/component-includes-plugin.ts",
"../tools/bs-plugins/bindings-plugin.ts",
"../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/logger-plugin.ts",
"../tools/bs-plugins/image-gen-plugin.ts",
"../tools/bs-plugins/type-gen-plugin.ts",
"../tools/bs-plugins/web-server-plugin.ts",
"../tools/bs-plugins/locale-validation-plugin.ts"
],
"retainStagingDir": true,
"require": [
"ts-node/register"
],
"sourceMap": true,
"pruneEmptyCodeFiles": true
}
@@ -1,12 +1,14 @@
{
"extends": "bsconfig.base.json",
"extends": "bsconfig.base.jsonc",
"files": [
"source/**",
"components/**",
"!components/**/*.part.xml",
"images/**",
"!**/*.psd",
"!**/*.svg",
"!**/*.svg.meta.json5",
"fonts/**",
"locale/**",
"config/**",
"lib/**",
"www/**",
@@ -26,7 +28,10 @@
"../tools/bs-plugins/json-yaml-plugin.ts",
"../tools/bs-plugins/validation-plugin.ts",
"../tools/bs-plugins/logger-plugin.ts",
"../tools/bs-plugins/image-gen-plugin.ts"
"../tools/bs-plugins/image-gen-plugin.ts",
"../tools/bs-plugins/type-gen-plugin.ts",
"../tools/bs-plugins/web-server-plugin.ts",
"../tools/bs-plugins/locale-validation-plugin.ts"
],
"rooibos": {
"logLevel": 2,
+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"
}
}
+10 -4
View File
@@ -142,7 +142,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.
- Playlet relies on [Invidious](https://github.com/iv-org/invidious). Invidious tries to keep up with YouTube making changes to their platform, but sometimes, a breaking change happens that requires Playlet to react quickly. Releasing through the Roku Channel store can take days, or a week. During this time, Playlet would be not functional, and that's not acceptable.
- The ability to roll back: Sometimes an app breaking bug gets released. Allowing users to choose a seperate version is a flexible way to keep things working. For example, it's possible to choose a different verrsion from the developer settings in the web app.
- 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.
@@ -163,7 +163,7 @@ Playlet lib comes equipped with a web server that runs on port 8888 when the app
- Allows remotely casting videos, change preferences, etc.
- 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)
@@ -294,14 +294,20 @@ This is mostly useful to QA the `canary` release (see [Canary release](https://e
#### In case of a softlock
If the dev menu is used to load a custom Playlet lib url, but the lib does not have a functionality to revert back:
If the dev menu is used to load a custom Playlet lib url, but you couldn't revert back:
```bash
curl -d '' "http://$ROKU_DEV_TARGET:8060/launch/dev?clearPlayletLibUrls=true"
curl -d '' "http://$ROKU_DEV_TARGET:8060/launch/693751?clearPlayletLibUrls=true"
```
This will remove the custom lib, and revert to using default (latest release from Github).
If you need to clear all the data from the registry, use
```bash
curl -d '' "http://$ROKU_DEV_TARGET:8060/launch/693751?clearRegistry=true"
```
## CI/CD
On pull requests, a Github action will run `lint:fix` and `format:fix` and push changes to the PR branch, to keep things tidy.
+6 -18
View File
@@ -13,16 +13,11 @@ These are mostly the steps when releasing a new version:
## Playlet lib
- Create local branch `release/$VERSION` e.g. `release/0.10.0`
- Set version in package.json
- Update CHANGELOG.md section from `[Unreleased]` to `[$VERSION] - DATE`
- `npm run build:release`
- This should fail because there are uncommitted changes. This is expected.
- Commit changes
- Create pull request
- Title: `Release v$VERSION`
- Comment: `Release $VERSION \nIt should contain everything planned from #6`
- Wait for CI and merge
- Use the [Release trigger](https://github.com/iBicha/playlet/actions/workflows/release-trigger.yml) to trigger a release
- Run workflow from **main** branch
- Set the new version in the format X.Y.Z
- Wait for the PR to be created
- Inspect PR, wait for CI and merge
- Wait for CI on main branch to create the `canary` release
- Edit `canary` release
- Tag: `v$VERSION`
@@ -40,11 +35,4 @@ These are mostly the steps when releasing a new version:
## Playlet
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: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)
For releasing to the store (when needed), signed packages are attached to Github releases, ready to publish
+2 -3
View File
@@ -4,8 +4,7 @@ This is an automated release. It is generated when new code is pushed to the mai
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 `canary` and click `Apply`
- Open Playlet web app settings in a browser (`http://ROKU_IP_ADDRESS:8888/index.html#settings`)
- Scroll down to `Developer settings` and set `Playlet Library version` to `canary` and click `Apply`
- Restart Playlet
- You can verify that you're testing the `canary` release in the `Info` tab in Playlet or the web app
+134 -46
View File
@@ -2,7 +2,7 @@ openapi: 3.0.0
info:
title: Playlet Web API
version: 0.17.2
version: 0.24.1
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
@@ -46,6 +46,7 @@ paths:
- device
- invidious
- preferences
- profiles
responses:
"200":
description: OK
@@ -106,7 +107,7 @@ paths:
type: array
items:
type: string
put:
post:
summary: Add to search history
description: |
Add a query to the search history.
@@ -140,9 +141,9 @@ paths:
description: No Content
/api/queue:
get:
summary: Get play queue
summary: Get video queue
description: Get the current videos in the queue.
operationId: getPlayQueue
operationId: getVideoQueue
responses:
"200":
description: OK
@@ -151,56 +152,43 @@ paths:
schema:
type: object
properties:
index:
type: integer
playlistIndex
type: integer
items:
type: array
items:
$ref: "#/components/schemas/PlayQueueObject"
$ref: "#/components/schemas/VideoQueueObject"
index:
type: integer
nowPlaying:
$ref: "#/components/schemas/VideoQueueObject"
post:
summary: Add to play queue
summary: Add to video queue
description: Add a video or a playlist to the queue.
operationId: addToPlayQueue
operationId: addToVideoQueue
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/PlayQueueObject"
$ref: "#/components/schemas/VideoQueueObject"
responses:
"200":
description: OK
content:
application/json:
schema:
type: object
properties:
index:
type: integer
playlistIndex
type: integer
items:
type: array
items:
$ref: "#/components/schemas/PlayQueueObject"
"204":
description: No Content
delete:
summary: Clear play queue
description: Clear the play queue.
operationId: clearPlayQueue
summary: Clear video queue
description: Clear the video queue.
operationId: clearVideoQueue
responses:
"204":
description: No Content
/api/queue/play:
post:
summary: Play video or playlist
summary: Play video
description: Play a video or playlist. This adds the video or playlist to the current position in the queue and plays it.
operationId: playPlayQueue
operationId: playVideoQueue
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/PlayQueueObject"
$ref: "#/components/schemas/VideoQueueObject"
responses:
"204":
description: No Content
@@ -227,6 +215,41 @@ paths:
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
@@ -300,14 +323,63 @@ paths:
schema:
type: string
format: uri
/invidious/logout:
/api/profiles:
get:
summary: Logout from Invidious
description: Logout from Invidious, and invalidate the token if any.
operationId: invidiousLogout
summary: Get profiles
description: Get the logged profiles, and the currently active profile.
operationId: getProfiles
responses:
"204":
description: No Content
"200":
description: OK
content:
application/json:
schema:
type: object
properties:
currentProfile:
type: string
profiles:
type: array
items:
$ref: "#/components/schemas/ProfileObject"
delete:
summary: Logout from a profile
description: Logout from a profile. This will remove the profile from the list of logged profiles.
operationId: logoutProfile
parameters:
- name: id
in: query
description: The ID of the profile to logout
required: true
schema:
type: string
responses:
"200":
description: OK
"400":
description: Bad Request
"404":
description: Not Found
/api/profiles/activate:
post:
summary: Activate a profile
description: Activate a profile. This will set the profile as the active profile.
operationId: activateProfile
requestBody:
content:
application/json:
schema:
type: object
properties:
id:
type: string
responses:
"200":
description: OK
"400":
description: Bad Request
"404":
description: Not Found
# Roku External Control Protocol (ECP)
/input/{appId}:
@@ -501,6 +573,8 @@ components:
type: string
friendly_name:
type: string
current_locale:
type: string
invidious:
type: object
properties:
@@ -508,14 +582,17 @@ components:
type: string
auth_url:
type: string
logged_in:
type: boolean
logged_in_instance:
type: string
logged_in_username:
type: string
preferences:
$ref: "#/components/schemas/PreferencesObject"
profiles:
type: object
properties:
currentProfile:
type: string
profiles:
type: array
items:
$ref: "#/components/schemas/ProfileObject"
PreferencesObject:
type: object
properties:
@@ -538,8 +615,19 @@ components:
type: boolean
sponsorblock.show_notifications:
type: boolean
ProfileObject:
type: object
properties:
id:
type: string
type:
type: string
username:
type: string
serverUrl:
type: string
# TODO:P1 add the rest of properties
PlayQueueObject:
VideoQueueObject:
type: object
properties:
videoId:
+94 -5
View File
@@ -10,6 +10,9 @@
- [Async Task Generator](#async-task-generator)
- [Tracking transpilied files](#tracking-transpilied-files)
- [Logger](#logger)
- [Type Gen](#type-gen)
- [Web Server](#web-server)
- [Locale validation](#locale-validation)
Playlet implements a few [Brighterscript Plugins](https://github.com/rokucommunity/brighterscript/blob/master/docs/plugins.md). The plugins inject themselves in the compilation process, allowing the modification of bs scripts, xml components, and even assets or the app manifest. Let's start with a simple one:
@@ -428,7 +431,7 @@ 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.
@@ -469,7 +472,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
@@ -478,7 +484,7 @@ end function)
The rest will be taken care of by the plugin, which will generate an `xml` file containing the task component, and a script that handles calling the function.
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
@@ -512,10 +518,12 @@ The logger plugin does some code transformation to log calls, which can add call
### 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
@@ -524,13 +532,94 @@ function LogError2(arg0, arg1) as void
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
```
## Web Server
**[Source](/tools/bs-plugins/web-server-plugin.ts)**
### Why
Handles routing annotations (e.g. `@get("/api/something")) so that they are handled by the routers/middlewares. It's nicer than having to register things by hand.
### How
Routers need to inherit from `Http.HttpRouter`. Then, once a request handled is annotated, e.g.
```bs
@get("/")
function GoHome(context as object) as boolean
response = context.response
response.Redirect("/index.html")
return true
end function
```
The route and the handler are added to the router. In this example, the `/` route redirects to `index/html`.
There one special annotation, and one special route:
- `@all` matches all methods
- `*` matches all paths
So `@all(*)` would be a middleware that will be matched with any request.
## Locale validation
**[Source](/tools/bs-plugins/locale-validation-plugin.ts)**
### Why
Roku's built-in localization system has some undesired side effects: for example, it might translate node ids, which would break the relationship between the nodes.
This plugin enforces some rules to ensure translation files are kept up to date with code implementation.
See the next section for the validation rules.
### How
The plugin checks for the following:
- Translated words and sentenses are defined in an enum annotated with `@locale`
- All the values in the `@locale` enums must be provided in the English (`en_US`) translation. This is because `en_US` is the fallback translation when the current localte translations are not complete.
- `en_US` must have matching source and translation values, so it can act as a fallback translation.
- All `source` translations from all languages must be present in the `@locale` enums. This is to prevent renaming the values in the code without updating translation files.
- Translation `source` keys can't be used except for certain fields such as `"text"` and `"title"`. This is to prevent the accidental localization of non-display fields, such as node ids.
+30 -19
View File
@@ -1,30 +1,41 @@
# 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
| Profiles | Settings |
| --------------------------- | --------------------------- |
| ![Profiles](./profiles.jpg) | ![Settings](./settings.jpg) |
![Settings](./settings.jpg)
| Invidious instances | Invidious testing |
| ------------------------------------------------ | --------------------------------------------- |
| ![Invidious instances](./invidious-settings.jpg) | ![Invidious testing](./invidious-testing.jpg) |
## Playlist
| Remote | Info |
| ----------------------- | ------------------- |
| ![Remote](./remote.jpg) | ![Info](./info.jpg) |
![Playlist](./playlist.jpg)
## Playlet web app
## 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

Binary file not shown.

After

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 122 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 83 KiB

After

Width:  |  Height:  |  Size: 109 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 74 KiB

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 80 KiB

After

Width:  |  Height:  |  Size: 87 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 43 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

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

+814 -285
View File
File diff suppressed because it is too large. Load diff
+24 -22
View File
@@ -1,46 +1,46 @@
{
"name": "playlet",
"version": "0.17.2",
"description": "Unofficial Youtube client for Roku",
"version": "0.24.1",
"description": "Unofficial YouTube client for Roku",
"devDependencies": {
"@rokucommunity/bslint": "^0.8.13",
"@types/crypto-js": "^4.2.1",
"@rokucommunity/bslint": "^0.8.21",
"@types/crypto-js": "^4.2.2",
"@types/fs-extra": "^11.0.4",
"@types/node": "^20.10.4",
"@types/node": "^20.14.2",
"@types/xml2js": "^0.4.14",
"argparse": "^2.0.1",
"brighterscript": "0.65.13",
"brighterscript-formatter": "^1.6.36",
"brighterscript": "0.67.2",
"brighterscript-formatter": "^1.7.3",
"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",
"dotenv": "^16.4.5",
"express": "^4.19.2",
"fs-extra": "^11.2.0",
"glob": "^10.3.10",
"glob": "^10.4.1",
"imap": "^0.8.19",
"ip": "^1.1.8",
"ip": "^2.0.1",
"json5": "^2.2.3",
"mailparser": "^3.6.5",
"roku-deploy": "^3.11.1",
"rooibos-roku": "^5.8.0",
"semver": "^7.5.4",
"mailparser": "^3.7.1",
"roku-deploy": "^3.12.0",
"rooibos-roku": "5.12.0",
"rounded-rect-9patch": "^1.0.1",
"semver": "^7.6.2",
"shelljs": "^0.8.5",
"ts-node": "^10.9.2",
"typescript": "^5.3.3",
"typescript": "^5.4.5",
"xml2js": "^0.6.2",
"yaml": "^2.3.4"
"yaml": "^2.4.3"
},
"engines": {
"node": "18"
"node": "20"
},
"scripts": {
"dev:web": "cd playlet-web && npm run dev",
"prebuild": "rm -rf dist",
"build:dev": "npm run build:web && npm run build:lib:dev && npm run build:app:dev",
"build:prod": "npm run build:web && npm run build:lib:prod && npm run build:app:prod",
"build:release": "npm run build:release:ci && npm run sign-package",
"build:release:ci": "npm run format:fix && npm run lint:fix && npm run version-sync && npm run manifest-git-hash && npm run build:prod",
"build:release": "npm run format:fix && npm run lint:fix && npm run version-sync && npm run manifest-git-hash && npm run build:prod",
"build:app:dev": "cd playlet-app && npm run build:dev",
"build:app:prod": "cd playlet-app && npm run build:prod",
"build:lib:dev": "cd playlet-lib && npm run build:dev",
@@ -58,13 +58,15 @@
"test:build:lib": "cd playlet-lib && npm run test:build",
"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",
"update-rale-component": "cd tools/RALE && rm TrackerTask.xml && curl -o TrackerTask.zip https://devtools.web.roku.com/roku-advanced-layout-editor/app/TrackerTask.zip && unzip TrackerTask.zip && rm TrackerTask.zip",
"postinstall": "cd playlet-lib && npm install && cd ../playlet-app && npm install && cd ../playlet-web && npm install",
"update-deps": "npx npm-check-updates -u && cd playlet-app && npx npm-check-updates -u && cd ../playlet-lib && npx npm-check-updates -u && cd ../playlet-web && npx npm-check-updates -u"
"update-deps": "npx npm-check-updates --deep --upgrade --install always",
"registry:write": "node tools/registry.js --input registry.json",
"registry:read": "node tools/registry.js --output registry.json",
"registry:clear": "node tools/registry.js --clear"
}
}
+1 -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 -2
View File
@@ -1,12 +1,12 @@
{
"name": "playlet-app",
"version": "0.17.2",
"version": "0.24.1",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "playlet-app",
"version": "0.17.2"
"version": "0.24.1"
}
}
}
+6 -4
View File
@@ -1,14 +1,16 @@
{
"name": "playlet-app",
"version": "0.17.2",
"description": "Unofficial Youtube client for Roku",
"version": "0.24.1",
"description": "Unofficial YouTube client for Roku",
"scripts": {
"prebuild": "rm -rf build/playlet-app",
"prebuild": "rm -rf ../build/playlet-app",
"prebuild:dev": "npm run prebuild",
"prebuild:prod": "npm run prebuild",
"build:dev": "bsc --create-package --debug --sourceMap=true --lintConfig ../config/bslint.jsonc",
"build:prod": "bsc --create-package --sourceMap=false --lintConfig ../config/bslint.jsonc",
"postbuild:prod": "mkdir -p ../release && cp ../dist/playlet-app.zip ../release/playlet.zip",
"postbuild:prod": "mkdir -p ../release && cp ../dist/playlet-app.zip ../release/playlet.zip && npm run squash-fs && npm run sign-package",
"squash-fs": "node ../tools/squash-fs.js --in-file ../release/playlet.zip --out-file ../release/playlet.squashfs.zip",
"sign-package": "node ../tools/sign-package.js --out-file playlet.squashfs.zip --out-dir ../release --staging-dir ../build/playlet-app",
"lint": "bslint --project bsconfig.lint.json --lintConfig ../config/bslint.jsonc",
"lint:fix": "npm run lint -- --fix",
"format:base": "bsfmt \"src/**/*.brs\" \"src/**/*.bs\" \"!**/bslib.brs\" \"!**/roku_modules/**/*\" \"!**/*.transpiled/**\" \"!**/*.transpiled.*\" --bsfmt-path ../config/bsfmt.jsonc",
@@ -1,7 +1,9 @@
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")
@@ -20,18 +22,24 @@ end function
function GetPlayletLibUrls() as object
#if DEBUG
debug = { type: "debug", link: ReadManifestValue("playlet_lib_debug_url") }
return [debug]
debug = { type: "debug-zip", link: Manifest.ReadValue("playlet_lib_zip_debug_url") }
embedded = { type: "embedded-zip", link: Manifest.ReadValue("playlet_lib_zip_embedded_url") }
#if DEBUG_FALLBACK_TO_EMBEDDED
return [debug, embedded]
#else
return [debug]
#end if
#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") }
return [github, embedded]
githubSquashFs = { type: "github-squashfs", link: Manifest.ReadValue("playlet_lib_squashfs_remote_url") }
githubZip = { type: "github-zip", link: Manifest.ReadValue("playlet_lib_zip_remote_url") }
embedded = { type: "embedded-zip", link: Manifest.ReadValue("playlet_lib_zip_embedded_url") }
return [githubSquashFs, githubZip, embedded]
#end if
end function
@@ -39,39 +47,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} in ${m.timer.TotalMilliseconds()} ms`)
' Try next url
m.playletLibUrlIndex += 1
LoadPlayletLib()
@@ -83,11 +83,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:",
@@ -103,5 +115,5 @@ function ShowPlayletLibLoadErrorDialog()
"If the problem persist, contact Playlet authors."
]
ShowErrorDialog(message, bulletText, bottomText)
DialogShowError(message, bulletText, bottomText)
end function
@@ -14,16 +14,33 @@ function GetLoadingMessage() as string
"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...",
"Unfortunately, the internet is closed today...",
"Unfortunately, we have no ads to show you...",
"Looking for the remote...",
"Finding that song that goes 'La la lala la'...",
"Waiting for the spinny thing to finish...",
]
end if
index = Rnd(messages.count()) - 1
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 = ""
if 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
@@ -16,10 +16,10 @@
id="messageLabel"
inheritParentOpacity="false"
width="1280"
height="50"
height="200"
horizAlign="center"
vertAlign="center"
translation="[0,450]">
translation="[0,460]"
wrap="true">
<Font role="font" uri="font:SystemFontFile" size="28" />
</Label>
</Rectangle>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.5 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.
@@ -3,24 +3,24 @@
outputs: [
{
outputFilePath: 'images/channel-poster_fhd.png',
outputHash: 'd644a0db84deed0bcc41a41d08a4ef75',
outputHash: '49c39d7f33e37a8214bf05d7db016e97',
width: 540,
height: 405,
background: '#FFFFFF',
background: '#EBEBEB',
},
{
outputFilePath: 'images/channel-poster_hd.png',
outputHash: 'd07a4ffaa021b55528bee91710f4e9d2',
outputHash: '4968cb52fca911be47fa17e61f0af4a5',
width: 290,
height: 218,
background: '#FFFFFF',
background: '#EBEBEB',
},
{
outputFilePath: 'images/channel-poster_sd.png',
outputHash: '66a311c639f89ff009e4624468282b2f',
outputHash: 'e976889af6743044db344219ec44514c',
width: 246,
height: 140,
background: '#FFFFFF',
background: '#EBEBEB',
},
],
}
+7 -6
View File
@@ -2,8 +2,8 @@ title=Playlet
# Do not update version manually, it is auto updated from package.json
major_version=0
minor_version=17
build_version=00002
minor_version=24
build_version=00001
ui_resolutions=hd
@@ -27,10 +27,11 @@ 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:8086/playlet-lib.zip
playlet_lib_squashfs_remote_url=https://github.com/iBicha/playlet/releases/latest/download/playlet-lib.squashfs.pkg
playlet_lib_zip_remote_url=https://github.com/iBicha/playlet/releases/latest/download/playlet-lib.zip
playlet_lib_zip_embedded_url=pkg:/lib/playlet-lib.zip
playlet_lib_zip_debug_url=http://DEBUG_HOST_IP_ADDRESS:8086/playlet-lib.zip
git_commit_sha=unknown
bs_const=DEBUG=false
bs_const=DEBUG=false;DEBUG_FALLBACK_TO_EMBEDDED=true
+27 -15
View File
@@ -1,26 +1,38 @@
function ShowErrorDialog(message as object, bulletText as object, bottomMessage as object)
' TODO:P2 a null check on StandardMessageDialog, only available on 10.0 and later
dialog = CreateObject("roSGNode", "StandardMessageDialog")
dialog.message = message
dialog.bulletText = bulletText
dialog.bottomMessage = bottomMessage
dialog.title = "Error loading Playlet"
dialog.buttons = ["Exit"]
function DialogShowError(message as object, bulletText as object, bottomMessage as object)
' Note: dialog can be null since StandardMessageDialog is only available on 10.0 and later
msgDialog = CreateObject("roSGNode", "StandardMessageDialog")
DialogSetPalette(msgDialog)
msgDialog.message = message
msgDialog.bulletText = bulletText
msgDialog.bottomMessage = bottomMessage
msgDialog.title = "Error loading Playlet"
msgDialog.buttons = ["Exit"]
' bs:disable-next-line NO_OBSERVE_STRING_CALLBACK
dialog.observeField("buttonSelected", "OnButtonSelected")
msgDialog.observeField("buttonSelected", "DialogOnButtonSelected")
' bs:disable-next-line NO_OBSERVE_STRING_CALLBACK
dialog.observeField("wasClosed", "OnDialogClosed")
msgDialog.observeField("wasClosed", "DialogOnClosed")
m.top.getScene().dialog = dialog
m.top.getScene().dialog = msgDialog
end function
function OnButtonSelected()
function DialogSetPalette(msgDialog as object)
palette = createObject("roSGNode", "RSGPalette")
palette.colors = {
DialogBackgroundColor: "#242424FF"
DialogFocusColor: "#CECECEFF"
DialogFocusItemColor: "#202020FF"
DialogSecondaryTextColor: "#EBEBEBFF"
DialogSecondaryItemColor: "#FF1C30FF"
DialogTextColor: "#EBEBEBFF"
}
msgDialog.palette = palette
end function
function DialogOnButtonSelected()
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
function DialogOnClosed()
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
+8 -7
View File
@@ -1,5 +1,5 @@
' Playlet (App to play videos from an Invidious server on Roku TVs)
' Copyright (C) 2023 Brahim Hadriche
' Copyright (C) 2024 Brahim Hadriche
' This program is free software: you can redistribute it and/or modify
' it under the terms of the GNU Affero General Public License as published by
@@ -19,8 +19,10 @@ function Main(args as object) as void
port = CreateObject("roMessagePort")
screen.setMessagePort(port)
m.global = screen.getGlobalNode()
Logger.Init()
ClearPlayletLibUrlsIfNeeded(args)
Registry.ClearPlayletLibUrlsIfNeeded(args)
Registry.ClearRegistryIfNeeded(args)
scene = screen.CreateScene("BootstrapScene")
screen.show()
@@ -32,9 +34,9 @@ function Main(args as object) as void
' These vars are needed to pass certification.
' The actual work is done in Playlet Lib
' bs:disable-next-line LINT1005
contentId = args.contentId
_contentId = args.contentId
' bs:disable-next-line LINT1005
mediaType = args.mediaType
_mediaType = args.mediaType
' Do not signal app launch complete here, we're doing it over at Playlet Lib
' This is needed to pass cetification
@@ -44,10 +46,9 @@ function Main(args as object) as void
input = CreateObject("roInput")
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)
' Although all types are enabled, they are filtered in Playlet Lib to avoid spamming the logs
systemLog.EnableType("http.connect")
systemLog.EnableType("http.error")
systemLog.EnableType("http.complete")
@@ -77,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()
+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
+4 -3
View File
@@ -8,10 +8,11 @@ namespace Tests
@it("Reads values from manifest")
@params("title", "Playlet")
@params("supports_input_launch", "1")
@params("playlet_lib_remote_url", "https://github.com/iBicha/playlet/releases/latest/download/playlet-lib.zip")
@params("playlet_lib_embedded_url", "pkg:/lib/playlet-lib.zip")
@params("playlet_lib_squashfs_remote_url", "https://github.com/iBicha/playlet/releases/latest/download/playlet-lib.squashfs.pkg")
@params("playlet_lib_zip_remote_url", "https://github.com/iBicha/playlet/releases/latest/download/playlet-lib.zip")
@params("playlet_lib_zip_embedded_url", "pkg:/lib/playlet-lib.zip")
function _(key as string, expectedValue as string)
m.assertEqual(ReadManifestValue(key), expectedValue)
m.assertEqual(Manifest.ReadValue(key), expectedValue)
end function
end class
+48 -26
View File
@@ -1,29 +1,51 @@
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 ClearPlayletLibUrlsIfNeeded(launchArgs as object) as void
if launchArgs = invalid or launchArgs.clearPlayletLibUrls = invalid
return
end if
DeleteRegistryKey("playlet_lib_urls", "Playlet")
end function
function DeleteAll()
reg = CreateObject("roRegistry")
sectionNames = reg.GetSectionList()
for each sectionName in sectionNames
reg.Delete(sectionName)
end for
reg.Flush()
end function
function GetPlayletLibUrlsFromRegistry() as object
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
function ClearRegistryIfNeeded(launchArgs as object) as void
if launchArgs = invalid or launchArgs.clearRegistry = invalid
return
end if
DeleteAll()
Logger.Log("Cleared all data from registry")
end function
end namespace
+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 -2
View File
@@ -1,12 +1,12 @@
{
"name": "playlet-lib",
"version": "0.17.2",
"version": "0.24.1",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "playlet-lib",
"version": "0.17.2"
"version": "0.24.1"
}
}
}
+6 -4
View File
@@ -1,16 +1,18 @@
{
"name": "playlet-lib",
"version": "0.17.2",
"description": "Unofficial Youtube client for Roku",
"version": "0.24.1",
"description": "Unofficial YouTube client for Roku",
"scripts": {
"prebuild": "rm -rf build/playlet-lib",
"prebuild": "rm -rf ../build/playlet-lib",
"prebuild:dev": "npm run prebuild",
"prebuild:prod": "npm run prebuild",
"build:dev": "bsc --create-package --debug --sourceMap=true --lintConfig ../config/bslint.jsonc",
"build:prod": "bsc --create-package --sourceMap=false --lintConfig ../config/bslint.jsonc",
"postbuild": "mkdir -p ../release && mkdir -p ../playlet-app/src/lib && cp ../dist/playlet-lib.zip ../playlet-app/src/lib/playlet-lib.zip",
"postbuild:dev": "npm run postbuild",
"postbuild:prod": "npm run postbuild && cp ../dist/playlet-lib.zip ../release/playlet-lib.zip",
"postbuild:prod": "npm run postbuild && cp ../dist/playlet-lib.zip ../release/playlet-lib.zip && npm run squash-fs && npm run sign-package",
"squash-fs": "node ../tools/squash-fs.js --in-file ../release/playlet-lib.zip --out-file ../release/playlet-lib.squashfs.zip",
"sign-package": "node ../tools/sign-package.js --out-file playlet-lib.squashfs.zip --out-dir ../release --staging-dir ../build/playlet-lib",
"lint": "bslint --project bsconfig.lint.json --lintConfig ../config/bslint.jsonc",
"lint:fix": "npm run lint -- --fix",
"format:base": "bsfmt \"src/**/*.brs\" \"src/**/*.bs\" \"!**/bslib.brs\" \"!**/roku_modules/**/*\" \"!**/*.transpiled/**\" \"!**/*.transpiled.*\" --bsfmt-path ../config/bsfmt.jsonc",
@@ -1,14 +1,16 @@
import "pkg:/components/Dialog/DialogUtils.bs"
import "pkg:/components/Navigation/LongPress.bs"
import "pkg:/components/PlayQueue/PlayQueueViewUtils.bs"
import "pkg:/components/VideoPlayer/VideoUtils.bs"
import "pkg:/components/VideoQueue/VideoQueueUtils.bs"
import "pkg:/components/VideoQueue/VideoQueueViewUtils.bs"
import "pkg:/source/utils/FocusManagement.bs"
import "pkg:/source/utils/Locale.bs"
import "pkg:/source/utils/Logging.bs"
import "pkg:/source/utils/StringUtils.bs"
import "pkg:/source/utils/Types.bs"
function Init()
m.screens = {}
m.firstScreenCalled = false
end function
function OnNodeReady()
@@ -21,7 +23,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)
@@ -29,7 +31,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)
@@ -58,9 +60,9 @@ function ShowRootScreen(screenName as string) as void
screen.id = screenName
m.screens[screenName] = screen
' insert child at 0 to make sure it is behind the navbar
m.root.insertChild(screen, 0)
m.screensContainer.insertChild(screen, 0)
if screen.hasField("binding_done")
screen@.BindNode(invalid)
screen@.BindNode()
end if
end if
screen = m.screens[screenName]
@@ -68,6 +70,10 @@ function ShowRootScreen(screenName as string) as void
return
end if
screen.visible = true
if not m.firstScreenCalled
m.firstScreenCalled = true
NodeSetFocus(screen, true)
end if
end function
function GetRootScreen(screenName as string) as object
@@ -86,13 +92,13 @@ function onKeyEvent(key as string, press as boolean) as boolean
end if
if key = OPTIONS_LONG_PRESS_KEY and press
LogInfo("Opening PlayQueueView")
PlayQueueViewUtils.Open(m.top.playQueue, m.top)
LogInfo("Opening VideoQueueView")
VideoQueueViewUtils.Open(m.top.videoQueue, m.top)
return true
end if
if key = "options" and not press
if VideoUtils.ToggleVideoPictureInPicture()
if VideoQueueUtils.ToggleVideoPictureInPicture(m.top.videoQueue)
return true
end if
end if
@@ -102,30 +108,30 @@ function onKeyEvent(key as string, press as boolean) as boolean
end if
if key = "play"
if VideoUtils.TogglePause()
if VideoQueueUtils.TogglePause(m.top.videoQueue)
return true
end if
end if
if key = "pause"
if VideoUtils.PauseVideo()
if VideoQueueUtils.Pause(m.top.videoQueue)
return true
end if
end if
if key = "playonly"
if VideoUtils.ResumeVideo()
if VideoQueueUtils.Play(m.top.videoQueue)
return true
end if
end if
if key = "back"
if VideoUtils.IsVideoPlayerOpen() and not VideoUtils.IsVideoPlayerFullScreen()
if VideoUtils.ToggleVideoPictureInPicture()
if VideoQueueUtils.IsVideoPlayerOpen(m.top.videoQueue) and not VideoQueueUtils.IsVideoPlayerFullScreen(m.top.videoQueue)
if VideoQueueUtils.ToggleVideoPictureInPicture(m.top.videoQueue)
return true
end if
end if
dialog = DialogUtils.ShowDialogButtons("Do you want to exit Playlet?", "Exit", ["Exit", "Cancel"])
dialog = DialogUtils.ShowDialogButtons(Tr(Locale.Dialogs.ExitPlayletQuestion), Tr(Locale.Buttons.exit), [Tr(Locale.Buttons.exit), Tr(Locale.Buttons.Cancel)])
dialog.observeField("buttonSelected", FuncName(OnExitDialog), ["buttonSelected"])
return true
end if
@@ -1,8 +1,9 @@
<component name="AppController" extends="Group" includes="AutoBind">
<interface>
<field id="screensContainer" type="node" />
<field id="root" type="node" />
<field id="stack" type="node" />
<field id="playQueue" type="node" />
<field id="videoQueue" type="node" />
<function name="PushScreen" />
<function name="PopScreen" />
<function name="FocusTopScreen" />
@@ -15,7 +15,7 @@ function OnFocusChange() as void
if m.lastFocusedChild <> invalid
focusNode = m.lastFocusedChild
else if m.top.getChildCount() > 0
focusNode = m.top.getChild(0)
focusNode = m.top.getChild(m.top.getChildCount() - 1)
end if
if focusNode <> invalid
@@ -0,0 +1,47 @@
import "pkg:/source/utils/FocusManagement.bs"
import "pkg:/source/utils/Types.bs"
' TODO:P1 this is a duplicate of AppRoot, refactor to use the same code
function Init()
m.scrollAnimation = m.top.findNode("scrollAnimation")
m.scrollAnimationInterpolator = m.scrollAnimation.findNode("scrollAnimationInterpolator")
m.lastFocusedChild = invalid
m.top.observeField("focusedChild", FuncName(OnFocusedChildChange))
end function
function OnFocusChange() as void
if not m.top.focus
return
end if
focusNode = invalid
if m.lastFocusedChild <> invalid
focusNode = m.lastFocusedChild
else if m.top.getChildCount() > 0
focusNode = m.top.getChild(0)
end if
if focusNode <> invalid
NodeSetFocus(focusNode, true)
end if
end function
function OnFocusedChildChange() as void
if m.top.focusedChild <> invalid
m.lastFocusedChild = m.top.focusedChild
end if
end function
function OnAnimateToPosition() as void
m.scrollAnimation.control = "stop"
current = m.top.translation[0]
destination = m.top.animateToPosition
if current = destination
return
end if
m.scrollAnimationInterpolator.keyValue = [[current, 0], [(current + destination) / 2, 0], [destination, 0]]
m.scrollAnimation.control = "start"
end function
@@ -0,0 +1,15 @@
<component name="AppScreens" extends="Group" includes="Focus">
<interface>
<field id="animateToPosition" type="float" onChange="OnAnimateToPosition" />
</interface>
<children>
<Animation
id="scrollAnimation"
duration="0.2">
<Vector2DFieldInterpolator
id="scrollAnimationInterpolator"
key="[ 0.0, 0.5, 1.0 ]"
fieldToInterp="AppScreens.translation" />
</Animation>
</children>
</component>
@@ -0,0 +1,146 @@
import "pkg:/source/utils/MathUtils.bs"
import "pkg:/source/utils/Types.bs"
function Init()
m.backgroundNode = m.top.findNode("background")
m.labelNode = m.top.findNode("label")
m.iconNode = m.top.findNode("icon")
m.anchorNode = m.top.findNode("anchor")
m.focusAnimation = m.top.findNode("focusAnimation")
m.normalFont = m.top.findNode("normalFont")
m.boldFont = m.top.findNode("boldFont")
DoLayout()
OnDisabledChange()
m.top.observeField("focusedChild", FuncName(OnFocusedChild))
end function
function DoLayout() as void
minWidth = m.top.minWidth
height = m.top.height
padding = m.top.padding
textVisible = m.top.textVisible
iconVisible = m.top.iconVisible
if not textVisible and not iconVisible
m.top.width = minWidth
return
end if
contentWidth = 0
iconWidth = 0
iconHeight = 0
textWidth = 0
iconTextSpacing = 0
if iconVisible
iconWidth = m.top.iconWidth
iconHeight = m.top.iconHeight
contentWidth += iconWidth
end if
if textVisible
labelRect = m.labelNode.boundingRect()
textWidth = labelRect.width
contentWidth += textWidth
end if
if iconVisible and textVisible
iconTextSpacing = m.top.iconTextSpacing
contentWidth += iconTextSpacing
end if
contentWidth += padding[0] + padding[1]
width = MathUtils.Max(contentWidth, minWidth)
m.top.width = width
if iconVisible
x = (width - contentWidth) / 2 + padding[0]
y = (height - iconHeight) / 2
m.iconNode.translation = [x, y]
end if
if textVisible
x = (width - contentWidth) / 2 + padding[0] + iconWidth + iconTextSpacing
m.labelNode.height = height
m.labelNode.translation = [x, 0]
end if
OnAnchorChange()
end function
function OnAnchorChange()
width = m.top.width
height = m.top.height
anchor = m.top.anchor
m.anchorNode.scaleRotateCenter = [width / 2, height / 2]
m.anchorNode.translation = [-width * anchor[0], -height * anchor[1]]
end function
function OnDisabledChange()
disabled = m.top.disabled
if disabled
if m.top.textVisible
m.labelNode.color = m.top.disabledTextColor
m.labelNode.font = m.normalFont
end if
if m.top.iconVisible
m.iconNode.blendColor = m.top.disabledIconColor
end if
m.backgroundNode.blendColor = m.top.disabledBackgroundColor
else
OnButtonFocused()
end if
m.top.focusable = not disabled
end function
function OnFocusedChild()
m.top.buttonFocused = m.top.hasFocus()
end function
function OnButtonFocused()
buttonFocused = m.top.buttonFocused
textVisible = m.top.textVisible
iconVisible = m.top.iconVisible
if buttonFocused
if textVisible
m.labelNode.color = m.top.focusedTextColor
m.labelNode.font = m.boldFont
end if
if iconVisible
m.iconNode.blendColor = m.top.focusedIconColor
end if
m.backgroundNode.blendColor = m.top.focusedBackgroundColor
m.focusAnimation.control = "start"
else
if textVisible
m.labelNode.color = m.top.textColor
m.labelNode.font = m.normalFont
end if
if iconVisible
m.iconNode.blendColor = m.top.iconColor
end if
m.backgroundNode.blendColor = m.top.backgroundColor
end if
end function
function OnkeyEvent(key as string, press as boolean) as boolean
if not press
return false
end if
if key = "OK"
disabled = m.top.disabled
if not disabled
m.top.buttonSelected = true
end if
return true
end if
return false
end function
@@ -0,0 +1,60 @@
<component name="ButtonEx" extends="Group">
<interface>
<field id="text" type="string" alias="label.text" onChange="DoLayout" />
<field id="textVisible" type="boolean" alias="label.visible" onChange="DoLayout" />
<field id="textColor" type="color" value="#DDDDDD" />
<field id="focusedTextColor" type="color" value="#262626" />
<field id="disabledTextColor" type="color" value="#606060" />
<field id="normalFontSize" type="integer" alias="normalFont.size" onChange="DoLayout" />
<field id="boldFontSize" type="integer" alias="boldFont.size" onChange="DoLayout" />
<field id="iconTextSpacing" type="float" value="10" onChange="DoLayout" />
<field id="iconUri" type="uri" alias="icon.uri" />
<field id="iconVisible" type="boolean" alias="icon.visible" onChange="DoLayout" />
<field id="iconWidth" type="float" alias="icon.width" value="42" onChange="DoLayout" />
<field id="iconHeight" type="float" alias="icon.height" value="42" onChange="DoLayout" />
<field id="iconColor" type="color" value="#DDDDDD" />
<field id="focusedIconColor" type="color" value="#262626" />
<field id="disabledIconColor" type="color" value="#606060" />
<field id="backgroundColor" type="color" value="#3C3C3C" />
<field id="focusedBackgroundColor" type="color" value="#DDDDDD" />
<field id="disabledBackgroundColor" type="color" value="#292929" />
<field id="width" type="float" alias="background.width" onChange="DoLayout" />
<field id="minWidth" type="float" onChange="DoLayout" />
<field id="height" type="float" alias="background.height" onChange="DoLayout" value="58" />
<field id="padding" type="vector2d" value="[20,20]" onChange="DoLayout" />
<field id="anchor" type="vector2d" onChange="OnAnchorChange" />
<field id="disabled" type="boolean" onChange="OnDisabledChange" />
<field id="buttonSelected" type="boolean" alwaysNotify="true" />
<field id="buttonFocused" type="boolean" onChange="OnButtonFocused" />
</interface>
<children>
<Font id="normalFont" uri="font:SystemFontFile" size="24" />
<Font id="boldFont" uri="font:MediumSystemFontFile" size="24" />
<Group id="anchor">
<Poster
id="background"
uri="pkg:/images/button-ex.9.png">
<Poster id="icon" />
<Label
id="label"
horizAlign="center"
vertAlign="center" />
</Poster>
</Group>
<Animation
id="focusAnimation"
optional="true"
duration="0.15">
<Vector2DFieldInterpolator
id="scale"
key="[ 0.0, 0.5, 1.0 ]"
keyValue="[ [ 1.0, 1.0 ], [ 1.05, 1.05 ], [ 1.0, 1.0 ] ]"
fieldToInterp="anchor.scale" />
</Animation>
</children>
</component>
@@ -5,7 +5,7 @@ namespace ChannelUtils
appController = m.appController
end if
appController@.PushScreen(channelView)
channelView@.BindNode(invalid)
channelView@.BindNode()
channelView.content = contentNode
end function
end namespace
@@ -1,11 +1,14 @@
import "pkg:/components/ContextMenu/ContextMenuUtils.bs"
import "pkg:/components/Dialog/DialogUtils.bs"
import "pkg:/components/Navigation/Navigation.bs"
import "pkg:/source/asyncTask/asyncTask.bs"
import "pkg:/source/AsyncTask/AsyncTask.bs"
import "pkg:/source/AsyncTask/Tasks.bs"
import "pkg:/source/utils/DisposableObserve.bs"
import "pkg:/source/utils/FocusManagement.bs"
import "pkg:/source/utils/Locale.bs"
import "pkg:/source/utils/Logging.bs"
import "pkg:/source/utils/StringUtils.bs"
import "pkg:/source/utils/Types.bs"
import "SubscribeTask.bs"
function Init()
m.container = m.top.findNode("container")
@@ -16,6 +19,7 @@ function Init()
m.banner = m.top.findNode("banner")
m.thumbnail = m.top.findNode("thumbnail")
m.authorLabel = m.top.findNode("authorLabel")
m.subCountLabel = m.top.findNode("subCountLabel")
m.subscribeButton = m.top.findNode("subscribeButton")
m.rowList = m.top.FindNode("rowList")
m.rowList.focusable = true
@@ -26,15 +30,16 @@ function Init()
m.authorId = ""
InitializeTabs()
InitializeSortOptions()
end function
function OnNodeready()
m.rowList@.BindNode(invalid)
m.rowList@.BindNode()
SetNavigation(m.rowList, "up", m.subscribeButton)
SetNavigation(m.subscribeButton, "down", m.rowList)
m.subscribeButton.text = "Subscribe"
m.subscribeButton.text = Tr(Locale.Buttons.Subscribe)
DisposableObserveFieldScoped(m.subscribeButton, "buttonSelected", FuncName(OnSubscribeButtonSelected))
SetSubscribeButtonVisibility()
@@ -60,6 +65,7 @@ function OnContentSet() as void
' NOTE: "_author" not "author". See PlaylistContentNode.xml for explanation.
m.authorLabel.text = content._author
m.subCountLabel.text = content.subCountText
m.banner.uri = content.banner
if StringUtils.IsNullOrEmpty(content.thumbnail)
m.thumbnail.uri = ""
@@ -115,7 +121,7 @@ function OnkeyEvent(key as string, press as boolean) as boolean
end function
function Close()
m.appController@.PopScreen(invalid)
m.appController@.PopScreen()
m.top.dispose = true
end function
@@ -134,9 +140,9 @@ function OnSubscribeButtonSelected()
end if
isSubbed = IsSubscribed()
m.subscribeTask = StartAsyncTask(SubscribeTask, {
invidious: m.invidious,
ucid: m.authorId,
m.subscribeTask = AsyncTask.Start(Tasks.SubscribeTask, {
invidious: m.invidious
ucid: m.authorId
subscribe: not isSubbed
})
end function
@@ -170,35 +176,58 @@ 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
"videos": function(authorId as string, author as string) as object
return CreateChannelFeed("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
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
end function
"releases": function(authorId as string, author as string) as object
return CreateChannelFeed("Releases", "channel_releases", authorId, author)
end function
"podcasts": function(authorId as string, author as string) as object
return CreateChannelFeed("Podcasts", "channel_podcasts", authorId, author)
end function,
playlists: function(authorId as string, author as string) as object
end function
"playlists": function(authorId as string, author as string) as object
return CreateChannelFeed("Playlists", "channel_playlists", authorId, author)
end function,
channels: function(authorId as string, author as string) as object
return CreateChannelFeed("Channels", "channel_channels", authorId, author)
end function
}
end function
function InitializeSortOptions()
m.sortOptions = {
"channel_videos": [{
"id": "newest"
"title": "Latest"
}, {
"id": "popular"
"title": "Popular"
}, {
"id": "oldest"
"title": "Oldest"
}]
"channel_playlists": [{
"id": "newest"
"title": "Date added (newest)"
}, {
"id": "last"
"title": "Last video added"
}]
}
end function
function CreateChannelFeed(title as string, endpoint as string, ucid as string, author as string) as object
title = Tr(title)
return {
title: title,
title: title
feedSources: [{
"id": `inv_${endpoint}_${ucid}`,
"title": `${author} - ${title}`,
"apiType": "Invidious",
"endpoint": endpoint,
"id": `inv_${endpoint}_${ucid}`
"title": `${author} - ${title}`
"apiType": "Invidious"
"endpoint": endpoint
"pathParams": {
"ucid": ucid
}
@@ -210,7 +239,32 @@ function GetContextMenuOptionsForItem(video as object) as object
if StringUtils.IsNullOrEmpty(m.top.authorId)
return []
end if
return m.bookmarks@.GetMenuForChannel(m.top.content)
options = m.bookmarksService@.GetMenuForChannel(m.top.content)
options.Append(GetSortingContextMenuOptionsForItem(video))
return options
end function
function GetSortingContextMenuOptionsForItem(video as object) as object
feedContentNode = video.getParent()
if feedContentNode = invalid or not feedContentNode.hasField("feedSources")
return []
end if
feedSources = feedContentNode.feedSources
if feedSources = invalid or feedSources.Count() = 0
return []
end if
feedSource = feedSources[0]
endpoint = feedSource.endpoint
if not m.sortOptions.DoesExist(endpoint)
return []
end if
title = Tr(Locale.Dialogs.SortFeedBy).replace("%1", `"${feedSource.title}"`)
sortOptions = m.sortOptions[endpoint]
return [ContextMenuUtils.CreateOption(title + "...", m.top, "ShowSortDialog", [title, sortOptions, feedContentNode])]
end function
function IsLoggedIn() as boolean
@@ -239,10 +293,10 @@ function OnAuthorIdChange()
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()
isEnabled = IsLoggedIn() and not StringUtils.IsNullOrEmpty(m.top.authorId)
m.subscribeButton.visible = isEnabled
m.subscribeButton.focusable = isEnabled
if not isEnabled and m.subscribeButton.hasFocus()
NodeSetFocus(m.rowList, true)
end if
end function
@@ -250,8 +304,56 @@ end function
function OnSubscriptionChanged()
isSubbed = IsSubscribed()
if isSubbed
m.subscribeButton.text = "Unsubscribe"
m.subscribeButton.text = Tr(Locale.Buttons.Unsubscribe)
else
m.subscribeButton.text = "Subscribe"
m.subscribeButton.text = Tr(Locale.Buttons.Subscribe)
end if
end function
function ShowSortDialog(title as string, sortOptions as object, feedContentNode as object)
buttons = []
for i = 0 to sortOptions.Count() - 1
buttons.Push(Tr(sortOptions[i].title))
end for
dialog = DialogUtils.ShowDialogButtons("", title, buttons)
dialog.addFields({
"feedContentNode": feedContentNode
"sortOptions": sortOptions
})
dialog.observeField("buttonSelected", FuncName(OnSortDialogResult), ["buttonSelected"])
end function
function OnSortDialogResult(event as object) as void
dialog = event.getRoSGNode()
sortOptions = dialog.sortOptions
buttonIndex = event.GetData()
if not IsInt(buttonIndex) or buttonIndex < 0 or buttonIndex >= sortOptions.Count()
return
end if
selected = sortOptions[buttonIndex]
feedContentNode = dialog.feedContentNode
feedSources = feedContentNode.feedSources
if feedSources = invalid or feedSources.Count() = 0
return
end if
selectedFeedSource = feedSources[0]
currentFeeds = m.rowList.feeds
for i = 0 to currentFeeds.Count() - 1
feed = currentFeeds[i]
feedSource = feed.feedSources[0]
if feedSource.id = selectedFeedSource.id
if feedSource.queryParams = invalid
feedSource.queryParams = {}
end if
feedSource.queryParams["sort_by"] = selected.id
m.rowList.feeds = currentFeeds
return
end if
end for
end function
@@ -4,7 +4,8 @@
<field id="authorId" type="string" onChange="OnAuthorIdChange" />
<field id="appController" type="node" bind="/AppController" />
<field id="invidious" type="node" bind="/Invidious" />
<field id="bookmarks" type="node" bind="/Bookmarks" />
<field id="bookmarksService" type="node" bind="/BookmarksService" />
<function name="ShowSortDialog" />
</interface>
<children>
<Rectangle
@@ -23,7 +24,8 @@
translation="[115,20]"
width="104"
height="104"
uri="pkg:/images/circle-mask-500.png">
blendColor="#DDDDDDFF"
uri="pkg:/images/white-circle.png">
<CirclePoster
id="thumbnail"
@@ -36,15 +38,18 @@
id="authorLabel"
translation="[115,40]"
font="font:MediumBoldSystemFont" />
<Label
id="subCountLabel"
translation="[115,70]"
font="font:SmallestSystemFont" />
</Poster>
<Button
<ButtonEx
id="subscribeButton"
iconUri=""
focusedIconUri=""
showFocusFootprint="true"
minWidth="200"
translation="[930,64]" />
iconVisible="false"
anchor="[0.5,0.5]"
padding="[30,30]"
translation="[1050,90]" />
<VideoRowList
itemComponentName="RowCell"
@@ -61,7 +66,7 @@
showRowLabel="[true]"
rowFocusAnimationStyle="floatingfocus"
variableWidthItems="true"
focusBitmapUri="pkg:/images/focus_grid.9.png" />
focusBitmapUri="pkg:/images/focus-glow-padding-19.9.png" />
<Animation
id="scrollAnimation"
@@ -22,7 +22,7 @@ function SubscribeTask(input as object) as object
error = response.ErrorMessage()
LogError("Failed to subscribe/unsubscribe to channel:", error)
return {
success: false,
success: false
error: error
}
end if
@@ -10,13 +10,13 @@
<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="maskUri" type="uri" value="pkg:/images/white-circle.png" alias="MaskGroup.maskuri" />
<field id="maskSize" type="vector2d" alias="MaskGroup.maskSize" />
</interface>
<children>
<MaskGroup
id="MaskGroup"
maskuri="pkg:/images/circle-mask-500.png">
maskuri="pkg:/images/white-circle.png">
<Poster
id="Poster" />
</MaskGroup>
+62
View File
@@ -0,0 +1,62 @@
import "pkg:/source/utils/Types.bs"
function Init()
m.top.font.size = 18
m.top.horizAlign = "right"
m.top.translation = [1034, 34]
m.top.width = 200
m.dateTime = CreateObject("roDateTime")
Update()
seconds = m.dateTime.GetSeconds()
m.timer = CreateObject("roSGNode", "Timer")
' add 2 seconds delay between real clock time and the displayed time to in case of inaccuracy of the timer
m.timer.duration = 60 - seconds + 2
m.timer.repeat = false
m.timer.ObserveField("fire", FuncName(FirstUpdate))
m.timer.control = "start"
end function
function FirstUpdate()
m.timer.control = "stop"
m.timer.unobserveField("fire")
m.timer.ObserveField("fire", FuncName(Update))
m.timer.duration = 60
m.timer.repeat = true
m.timer.control = "start"
Update()
end function
' format time HH:MM AM/PM
function Update()
m.dateTime.Mark()
m.dateTime.ToLocalTime()
hours = m.dateTime.GetHours()
minutes = m.dateTime.GetMinutes()
if hours >= 12
ampm = "PM"
else
ampm = "AM"
end if
if hours > 12
hours = hours - 12
end if
hoursStr = hours.ToStr()
minutesStr = minutes.ToStr()
if hours < 10
hoursStr = "0" + hoursStr
end if
if minutes < 10
minutesStr = "0" + minutesStr
end if
m.top.text = hoursStr + ":" + minutesStr + " " + ampm
end function
@@ -0,0 +1,2 @@
<component name="Clock" extends="Label">
</component>
@@ -1,6 +0,0 @@
<component name="ActionContentNode" extends="ContentNode">
<interface>
<field id="type" type="string" value="action" />
<field id="action" type="string" />
</interface>
</component>
@@ -1,10 +1,10 @@
import "pkg:/components/ContentNode/ChannelContentTask.bs"
import "pkg:/components/Dialog/DialogUtils.bs"
import "pkg:/source/asyncTask/asyncTask.bs"
import "pkg:/components/VideoFeed/FeedLoadState.bs"
import "pkg:/source/AsyncTask/AsyncTask.bs"
import "pkg:/source/AsyncTask/Tasks.bs"
import "pkg:/source/utils/ErrorUtils.bs"
function Init()
end function
import "pkg:/source/utils/Locale.bs"
import "pkg:/source/utils/Logging.bs"
function LoadChannel(invidiousNode as object) as void
if m.contentTask <> invalid
@@ -17,8 +17,8 @@ function LoadChannel(invidiousNode as object) as void
end if
m.top.loadState = FeedLoadState.Loading
m.contentTask = StartAsyncTask(ChannelContentTask, {
content: m.top,
m.contentTask = AsyncTask.Start(Tasks.ChannelContentTask, {
content: m.top
invidious: invidiousNode
}, OnChannelContentTaskResult)
end function
@@ -40,8 +40,8 @@ function OnChannelContentTaskResult(output as object) as void
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)
message = Tr(Locale.Dialogs.FailedToLoadChannel).Replace("%1", authorId) + `\n${error}`
DialogUtils.ShowDialog(message, Tr(Locale.Dialogs.ChannelLoadError), true)
return
end if
end function
@@ -24,13 +24,12 @@ function ChannelContentTask(input as object) as object
if not response.IsSuccess() or metadata = invalid
contentNode.loadState = FeedLoadState.Error
return {
success: false,
success: false
error: response.ErrorMessage()
}
end if
instance = service.GetInstance()
InvidiousContent.ToChannelContentNode(contentNode, metadata, instance)
InvidiousContent.ToChannelContentNode(contentNode, metadata)
contentNode.loadState = FeedLoadState.Loaded
@@ -0,0 +1,56 @@
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/Locale.bs"
import "pkg:/source/utils/Logging.bs"
function LoadPlaylistPage(invidiousNode as object) as void
LoadPlaylist(invidiousNode, true)
end function
function LoadPlaylistAll(invidiousNode as object) as void
LoadPlaylist(invidiousNode, false)
end function
function LoadPlaylist(invidiousNode as object, singlePage as boolean) as void
if m.contentTask <> invalid
m.contentTask.cancel = true
end if
loadState = m.top.loadState
if loadState = FeedLoadState.Loading or loadState = FeedLoadState.Loaded
return
end if
m.top.loadState = FeedLoadState.Loading
m.contentTask = AsyncTask.Start(Tasks.PlaylistContentTask, {
content: m.top
invidious: invidiousNode
singlePage: singlePage
}, OnPlaylistContentTaskResult)
end function
function OnPlaylistContentTaskResult(output as object) as void
m.contentTask = invalid
if output.cancelled
return
end if
if not output.success or not output.result.success
' output.error for unhandled exception
error = output.error
if error = invalid
' output.result.error for network errors
error = output.result.error
end if
error = ErrorUtils.Format(error)
LogError(error)
playlistId = output.task.input.content.playlistId
message = Tr(Locale.Dialogs.FailedToLoadPlaylist).Replace("%1", playlistId) + `\n${error}`
DialogUtils.ShowDialog(message, Tr(Locale.Dialogs.PlaylistLoadError), true)
return
end if
end function
@@ -1,5 +1,8 @@
<component name="PlaylistContentNode" extends="ContentNode">
<interface>
<function name="LoadPlaylistPage" />
<function name="LoadPlaylistAll" />
<field id="type" type="string" value="playlist" />
<field id="loadState" type="string" />
<!-- index in a feed -->
@@ -0,0 +1,57 @@
import "pkg:/components/Services/Invidious/InvidiousService.bs"
import "pkg:/components/Services/Invidious/InvidiousToContentNode.bs"
import "pkg:/components/VideoFeed/FeedLoadState.bs"
@asynctask
function PlaylistContentTask(input as object) as object
contentNode = input.content
invidiousNode = input.invidious
singlePage = input.singlePage
if m.top.cancel
contentNode.loadState = FeedLoadState.None
return invalid
end if
service = new Invidious.InvidiousService(invidiousNode)
instance = service.GetInstance()
while true
index = contentNode.getChildCount()
response = service.GetPlaylist(contentNode.playlistId, index, m.top.cancellation)
if m.top.cancel
contentNode.loadState = FeedLoadState.None
return invalid
end if
metadata = response.Json()
if not response.IsSuccess() or metadata = invalid
contentNode.loadState = FeedLoadState.Error
return {
success: false
error: response.ErrorMessage()
}
end if
InvidiousContent.ToPlaylistContentNode(contentNode, metadata, instance)
childCount = contentNode.getChildCount()
if metadata.videos.Count() = 0 or childCount >= metadata.videoCount
contentNode.loadState = FeedLoadState.Loaded
return {
success: true
}
else
contentNode.loadState = FeedLoadState.LoadedPage
if singlePage
return {
success: true
}
end if
end if
end while
return invalid
end function
@@ -0,0 +1,12 @@
<component name="ProfileContentNode" extends="ContentNode">
<interface>
<field id="type" type="string" value="invidious" />
<field id="isSelected" type="boolean" alwaysNotify="true" />
<field id="username" type="string" />
<field id="serverUrl" type="string" />
<field id="accessToken" type="string" />
<field id="color" type="color" />
</interface>
</component>
@@ -5,8 +5,11 @@
<field id="index" type="integer" value="-1" />
<!-- index in a feed -->
<field id="feedSourcesIndex" type="integer" value="-1" />
<!-- index in the queue -->
<field id="queueIndex" type="integer" value="-1" />
<field id="author" type="string" />
<!-- NOTE: "_author" not "author". See PlaylistContentNode.xml for explanation -->
<field id="_author" type="string" />
<field id="authorId" type="string" />
<field id="isUpcoming" type="boolean" />
<field id="lengthSeconds" type="integer" />
@@ -15,7 +18,7 @@
<field id="premiereTimestampText" type="string" />
<field id="publishedText" type="string" />
<field id="thumbnail" type="uri" />
<field id="timestamp" type="integer" />
<field id="timestamp" type="integer" value="-1" />
<field id="title" type="string" />
<field id="videoId" type="string" />
<field id="viewCountText" type="string" />
@@ -3,8 +3,8 @@ import "pkg:/source/utils/Logging.bs"
import "pkg:/source/utils/StringUtils.bs"
import "pkg:/source/utils/Types.bs"
' TODO:P0 Web app support
' TODO:P0 Web apis and open api spec updates
' TODO:P1 Web app support
' TODO:P1 Web apis and open api spec updates
'
' From the main screen:
' When a video is selected:
@@ -71,8 +71,6 @@ import "pkg:/source/utils/Types.bs"
' - "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
@@ -88,7 +86,7 @@ function Init()
m.showAnimation = m.top.findNode("showAnimation")
end function
function Show(unsued as dynamic)
function Show(_unused as dynamic)
m.optionsList.ObserveField("itemSelected", FuncName(OnItemSelected))
m.showAnimation.control = "start"
end function
@@ -163,9 +161,20 @@ function OnkeyEvent(key as string, press as boolean) as boolean
Close()
return true
end if
if key = "up"
m.optionsList.jumpToItem = m.optionsList.content.getChildCount() - 1
return true
end if
if key = "down"
m.optionsList.jumpToItem = 0
return true
end if
return false
end function
function Close()
m.top.appController@.PopScreen(invalid)
m.top.appController@.PopScreen()
end function
@@ -11,19 +11,19 @@ function OnItemHasFocus()
hasFocus = m.top.itemHasFocus
if hasFocus
m.top.font = "font:SmallestBoldSystemFont"
m.top.color = "0x262626ff"
m.top.color = "#262626ff"
else
m.top.font = "font:SmallestSystemFont"
m.top.color = "0xddddddff"
m.top.color = "#EBEBEBFF"
end if
end function
function OnFocusPercent()
if m.top.focusPercent > 0.5
m.top.font = "font:SmallestBoldSystemFont"
m.top.color = "0x262626ff"
m.top.color = "#262626FF"
else
m.top.font = "font:SmallestSystemFont"
m.top.color = "0xddddddff"
m.top.color = "#EBEBEBFF"
end if
end function
@@ -19,7 +19,7 @@ namespace ContextMenuUtils
ContextMenuUtils.SetItem(contextMenu, item)
contextMenu.options = options
contextMenu@.Show(invalid)
contextMenu@.Show()
return contextMenu
end function
@@ -31,7 +31,7 @@ namespace ContextMenuUtils
if item.type = "video"
LogInfo("Opening context menu for video:", item.videoId)
title = item.title
subtitle = item.author
subtitle = item._author
thumbnail = item.thumbnail
else if item.type = "playlist"
LogInfo("Opening context menu for playlist:", item.playlistId)
@@ -0,0 +1,12 @@
function SetPalette(dialog as object)
palette = createObject("roSGNode", "RSGPalette")
palette.colors = {
DialogBackgroundColor: "#242424FF"
DialogFocusColor: "#CECECEFF"
DialogFocusItemColor: "#202020FF"
DialogSecondaryTextColor: "#EBEBEBFF"
DialogSecondaryItemColor: "#FF1C30FF"
DialogTextColor: "#EBEBEBFF"
}
dialog.palette = palette
end function
@@ -1,6 +1,8 @@
import "pkg:/source/utils/Locale.bs"
namespace DialogUtils
function ShowDialog(message as dynamic, title as string, large = false as boolean) as object
return ShowDialogButtons(message, title, ["Ok"], large)
return ShowDialogButtons(message, title, [Tr(Locale.Buttons.OK)], large)
end function
function ShowDialogButtons(message as dynamic, title as string, buttons as object, large = false as boolean) as object
@@ -22,4 +24,33 @@ namespace DialogUtils
m.top.getScene().dialog = dialog
return dialog
end function
function ShowTimedDialogButtons(message as dynamic, title as string, buttons as object, defaultButton as integer, timeoutSeconds as integer, large = false as boolean) as object
dialog = CreateObject("roSGNode", "TimedDialog")
if GetInterface(message, "ifArray") = invalid
message = message.Tokenize(`\n`).ToArray()
end if
dialog.message = message
dialog.title = title
dialog.actualButtons = buttons
if large
if m._deviceDisplayWidth = invalid
deviceInfo = CreateObject("roDeviceInfo")
displaySize = deviceInfo.GetDisplaySize()
m._deviceDisplayWidth = displaySize.w
end if
dialog.width = m._deviceDisplayWidth - 100
end if
dialog.defaultButtonIndex = defaultButton
dialog.defaultActionTimeoutSeconds = timeoutSeconds
dialog.startCountdown = true
m.top.getScene().dialog = dialog
dialog.focusDefaultButton = true
return dialog
end function
end namespace
@@ -1,23 +1,27 @@
import "pkg:/components/Screens/WebAppScreen/GenerateQrCodeTask.bs"
import "pkg:/source/asyncTask/asyncTask.bs"
import "DialogPalette.bs"
import "pkg:/source/utils/Locale.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")
m.top.width = "920"
m.top.observeFieldScoped("buttonSelected", FuncName(Close))
scanLabel = m.top.findNode("scanLabel")
scanLabel.text = Tr(Locale.Dialogs.ScanTheQrCode)
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"
m.urlLabel.text = Tr(Locale.Dialogs.IpAddressNotAvailable)
end if
m.invidious.observeFieldScoped("authToken", FuncName(OnAuthTokenChange))
@@ -31,14 +35,10 @@ function OnUrlSet()
url = m.top.url
m.urlLabel.text = url
StartAsyncTask(GenerateQrCodeTask, {
poster: m.qrCode,
text: url,
size: m.qrCode.loadWidth,
padding: 10
})
m.qrCode.text = url
end function
function OnAuthTokenChange()
m.invidious.unobserveFieldScoped("authToken")
Close()
end function
@@ -7,8 +7,8 @@
<children>
<StdDlgTitleArea primaryTitle="Login to Invidious" />
<StdDlgContentArea>
<StdDlgTextItem
text="Login to Invidious in order to view Subscriptions, Playlists, and use the Watch history." />
<StdDlgTextItem text="Login to Invidious in order to view Subscriptions, Playlists, and use the Watch history." />
<StdDlgTextItem text="Please note that an Invidious account is different from a YouTube account." />
</StdDlgContentArea>
<StdDlgButtonArea id="buttonArea">
<StdDlgButton text="OK" />
@@ -18,26 +18,28 @@
horizAlign="right"
width="400"
extendToDialogEdge="false"
showDivider="true">
showDivider="false">
<Label
id="scanLabel"
text="Scan the QR Code"
horizAlign="center"
wrap="true" width="400">
<Font role="font" uri="font:SystemFontFile" size="24" />
</Label>
<Poster
<QrCodePoster
id="QrCodePoster"
width="300"
height="300"
loadWidth="300"
loadHeight="300"
padding="10"
translation="[50, 50]" />
<Label
id="urlLabel"
horizAlign="center"
width="400"
translation="[0, 380]">
<Font role="font" uri="font:BoldSystemFontFile" size="18" />
<Font role="font" uri="font:MediumSystemFontFile" size="18" />
</Label>
</StdDlgSideCardArea>
</children>
@@ -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
@@ -0,0 +1,117 @@
import "DialogPalette.bs"
import "pkg:/source/utils/FocusManagement.bs"
import "pkg:/source/utils/Logging.bs"
import "pkg:/source/utils/Types.bs"
function Init()
SetPalette(m.top)
m.top.observeField("buttonSelected", FuncName(OnButtonSelected))
m.top.observeField("wasClosed", FuncName(OnDialogClosed))
end function
function OnStartCountdown()
actualButtons = m.top.actualButtons
defaultButtonIndex = m.top.defaultButtonIndex
defaultActionTimeoutSeconds = m.top.defaultActionTimeoutSeconds
buttons = []
for i = 0 to actualButtons.Count() - 1
if i = defaultButtonIndex
buttons.push(`${actualButtons[i]} (${defaultActionTimeoutSeconds})`)
else
buttons.push(actualButtons[i])
end if
end for
m.top.buttons = buttons
CancelTimer()
m.timer = CreateObject("roSGNode", "Timer")
m.timer.repeat = true
m.timer.observeFieldScoped("fire", FuncName(TimerUpdateButtons))
m.currentCountDown = defaultActionTimeoutSeconds
m.timer.control = "start"
FindButtonComponent()
end function
function OnFocusDefaultButton() as void
FindButtonComponent()
if m.buttonComponents = invalid
return
end if
defaultButtonIndex = m.top.defaultButtonIndex
if m.buttonComponents.Count() <= defaultButtonIndex
return
end if
button = m.buttonComponents[defaultButtonIndex]
NodeSetFocus(button, true)
end function
function TimerUpdateButtons() as void
m.currentCountDown -= 1
if m.currentCountDown <= 0
m.top.actualButtonSelected = m.top.defaultButtonIndex
m.top.close = true
return
end if
SetDefaultButtonText(m.currentCountDown)
end function
function OnButtonSelected()
m.top.actualButtonSelected = m.top.buttonSelected
m.top.close = true
end function
function OnDialogClosed()
CancelTimer()
end function
function onKeyEvent(_key as string, _press as boolean) as boolean
if m.timer = invalid
return false
end if
CancelTimer()
FindButtonComponent()
SetDefaultButtonText(0)
return false
end function
function CancelTimer()
if m.timer <> invalid
m.timer.control = "stop"
m.timer.unobserveFieldScoped("fire")
m.timer = invalid
end if
end function
function SetDefaultButtonText(timeLeft as integer) as void
if m.buttonComponents = invalid
return
end if
defaultButtonIndex = m.top.defaultButtonIndex
if timeLeft > 0
m.buttonComponents[defaultButtonIndex].text = `${m.top.actualButtons[defaultButtonIndex]} (${timeLeft})`
else
m.buttonComponents[defaultButtonIndex].text = m.top.actualButtons[defaultButtonIndex]
end if
end function
function FindButtonComponent() as void
if m.buttonComponents <> invalid
return
end if
areas = m.top.getChildren(-1, 0)
for each area in areas
if area.subtype() = "StdDlgButtonArea"
m.buttonComponents = area.getChildren(-1, 0)
return
end if
end for
LogWarn("No buttons found in dialog")
end function
@@ -0,0 +1,11 @@
<component name="TimedDialog" extends="StandardMessageDialog">
<interface>
<field id="actualButtons" type="stringarray" />
<field id="defaultButtonIndex" type="integer" value="-1" />
<field id="defaultActionTimeoutSeconds" type="integer" value="10" />
<!-- Use actualButtonSelected because buttonSelected is read only and defaults to 0 -->
<field id="actualButtonSelected" type="integer" value="-1" />
<field id="startCountdown" type="boolean" alwaysNotify="true" onChange="OnStartCountdown" />
<field id="focusDefaultButton" type="boolean" alwaysNotify="true" onChange="OnFocusDefaultButton" />
</interface>
</component>
+4 -7
View File
@@ -1,10 +1,9 @@
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()
m.playQueue = m.top.findNode("PlayQueue")
m.videoQueue = m.top.findNode("VideoQueue")
LaunchArgumentsReceived()
m.scene.ObserveField("inputArgs", FuncName(InputArgumentsReceived))
@@ -30,10 +29,8 @@ function ProcessArguments(args as object) as void
return
end if
if not StringUtils.IsNullOrEmpty(args.contentId) and args.mediaType = "video"
if StringUtils.IsNullOrEmpty(args.videoId)
args.videoId = args.contentId
end if
if not StringUtils.IsNullOrEmpty(args.contentId) and StringUtils.IsNullOrEmpty(args.videoId)
args.videoId = args.contentId
end if
if args.timestamp <> invalid
@@ -46,6 +43,6 @@ function ProcessArguments(args as object) as void
if args.timestamp <> invalid
node.timestamp = args.timestamp
end if
m.playQueue@.Play(node, -1)
m.videoQueue.playVideo = node
end if
end function
+128 -11
View File
@@ -1,4 +1,5 @@
import "pkg:/source/utils/Logging.bs"
import "pkg:/source/utils/StringUtils.bs"
import "pkg:/source/utils/Types.bs"
function Init()
@@ -9,13 +10,15 @@ function Init()
m.top.ObserveField("logLine", port)
scene = m.top.getScene()
if scene.hasField("systemLogEvent")
scene.ObserveFieldScoped("systemLogEvent", port)
end if
scene.ObserveFieldScoped("systemLogEvent", port)
m.port = port
StartLogger(m.top)
#if DEBUG
StartLogger(m.top, LogLevel.Debug)
#else
StartLogger(m.top, LogLevel.Info)
#end if
end function
function StartLogger(logger as object, logLevel = LogLevel.Info as LogLevel) as void
@@ -32,29 +35,64 @@ function LoggerLoop()
port = m.port
buffer = CreateObject("roByteArray")
previousLogsFile = m.top.folder + "/" + m.top.filenamePrevious
logsFile = m.top.folder + "/" + m.top.filename
previousLogsFile = m.top.folder + "/" + m.top.filenamePrevious
filenameStartup = m.top.filenameStartup
dateTime = CreateObject("roDateTime")
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
lastExitInfo = GetLastExitInfo()
if not StringUtils.IsNullOrEmpty(lastExitInfo)
line = `************ Last Exit Info ************\n${lastExitInfo}\n********** End Last Exit Info **********\n`
' bs:disable-next-line LINT3012
print line
buffer.FromAsciiString(line)
buffer.AppendFile(logsFile)
end if
appMemoryMonitor = CreateObject("roAppMemoryMonitor")
if appMemoryMonitor <> invalid and FindMemberFunction(appMemoryMonitor, "EnableMemoryWarningEvent") <> invalid
appMemoryMonitor.SetMessagePort(port)
appMemoryMonitor.EnableMemoryWarningEvent(true)
end if
deviceInfo = CreateObject("roDeviceInfo")
deviceInfo.SetMessagePort(port)
deviceInfo.EnableLowGeneralMemoryEvent(true)
m.lastDeviceInfoMemoryLevel = ""
while true
msg = wait(0, port)
msgType = type(msg)
if msgType = "roSGNodeEvent"
field = msg.getField()
if field = "logLine"
OnLineLog(msg, logsFile, buffer)
OnLineLog(msg, dateTime, logsFile, buffer)
else if field = "systemLogEvent"
OnLineSysLog(msg, logsFile, buffer)
OnLineSysLog(msg, dateTime, logsFile, buffer)
end if
else if msgType = "roAppMemoryNotificationEvent"
OnLineLogMonitorMemoryWarning(msg, dateTime, logsFile, buffer)
else if msgType = "roDeviceInfoEvent"
OnLineLogDeviceInfoMemoryWarning(msg, dateTime, logsFile, buffer)
end if
end while
end function
function OnLineLog(event as object, logsFile as string, buffer as object)
line = event.getData()
function OnLineLog(event as object, dateTime as object, logsFile as string, buffer as object)
line = FormatTime(dateTime) + event.getData()
' bs:disable-next-line LINT3012
print line
@@ -62,15 +100,94 @@ function OnLineLog(event as object, logsFile as string, buffer as object)
buffer.AppendFile(logsFile)
end function
function OnLineSysLog(event as object, logsFile as string, buffer as object) as void
function OnLineSysLog(event as object, dateTime as object, logsFile as string, buffer as object) as void
info = event.getData()
if info.LogType <> "http.error"
return
end if
line = "[ERROR][SysLog] " + ToString(info)
line = FormatTime(dateTime) + "[ERROR][SysLog] " + ToString(info)
' bs:disable-next-line LINT3012
print line
buffer.FromAsciiString(line + `\n`)
buffer.AppendFile(logsFile)
end function
function OnLineLogMonitorMemoryWarning(event as object, dateTime as object, logsFile as string, buffer as object) as void
info = event.getInfo()
line = FormatTime(dateTime) + "[WARN][AppMonitorMemory] " + ToString(info)
' bs:disable-next-line LINT3012
print line
buffer.FromAsciiString(line + `\n`)
buffer.AppendFile(logsFile)
end function
function OnLineLogDeviceInfoMemoryWarning(event as object, dateTime as object, logsFile as string, buffer as object) as void
info = event.getInfo()
if not IsString(info.generalMemoryLevel)
return
end if
' roDeviceInfoEvent can be a bit spammy, so only log if the memory level has changed
if info.generalMemoryLevel = m.lastDeviceInfoMemoryLevel
return
end if
m.lastDeviceInfoMemoryLevel = info.generalMemoryLevel
line = FormatTime(dateTime) + "[WARN][DeviceInfoMemory] " + ToString(info)
' bs:disable-next-line LINT3012
print line
buffer.FromAsciiString(line + `\n`)
buffer.AppendFile(logsFile)
end function
' Note: although the timestamp should be captured in the caller, not the logger,
' it is done here to avoid adding overhead to the caller thread.
function FormatTime(dateTime as object) as string
dateTime.Mark()
dateTime.ToLocalTime()
hours = dateTime.GetHours().ToStr()
if hours.Len() = 1
hours = "0" + hours
end if
minutes = dateTime.GetMinutes().ToStr()
if minutes.Len() = 1
minutes = "0" + minutes
end if
seconds = dateTime.GetSeconds().ToStr()
if seconds.Len() = 1
seconds = "0" + seconds
end if
milliseconds = dateTime.GetMilliseconds().ToStr()
if milliseconds.Len() = 1
milliseconds = "00" + milliseconds
else if milliseconds.Len() = 2
milliseconds = "0" + milliseconds
end if
return "[" + hours + ":" + minutes + ":" + seconds + "." + milliseconds + "]"
end function
function GetLastExitInfo() as dynamic
' roAppManager.GetLastExitInfo() is only available on Roku OS 13 and above
appManager = CreateObject("roAppManager")
hasMethod = FindMemberFunction(appManager, "GetLastExitInfo") <> invalid
if not hasMethod
return invalid
end if
lastExitInfo = appManager.GetLastExitInfo()
if lastExitInfo = invalid
return invalid
end if
return ToString(lastExitInfo)
end function
Loaded 100 of 472 files, more files were not shown because too many files have changed in this diff. Show more