Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7401263f0d | ||
|
|
90fe768d2c | ||
|
|
5c1a62b7f3 | ||
|
|
44578bd6c5 | ||
|
|
75b8ad1c0c | ||
|
|
2b1d707f6d | ||
|
|
190dcdffe3 | ||
|
|
cf6d89f44f | ||
|
|
5c0bc3c82c | ||
|
|
d99151ff21 | ||
|
|
6e84809923 | ||
|
|
e993ac3b59 | ||
|
|
d301b3fff7 | ||
|
|
f452bf23de | ||
|
|
38a054a46a | ||
|
|
f60d8b6caf | ||
|
|
6c29993437 | ||
|
|
52fc935598 | ||
|
|
ae82ad4b28 | ||
|
|
b7fe0feb94 | ||
|
|
0cd9758538 | ||
|
|
a1f2e4de52 | ||
|
|
503370f4d7 | ||
|
|
8acb7c64de | ||
|
|
50858c150f |
No files matched your search
@@ -52,18 +52,18 @@ jobs:
|
||||
- name: Run Analysis on Playlet App
|
||||
run: ./sca-cmd/bin/sca-cmd ./release/playlet.zip --exit error
|
||||
|
||||
- name: Delete unstable release
|
||||
- name: Delete Canary release
|
||||
uses: dev-drprasad/delete-tag-and-release@v1.0
|
||||
with:
|
||||
tag_name: unstable
|
||||
tag_name: canary
|
||||
github_token: ${{ secrets.GH_TOKEN }}
|
||||
|
||||
- name: Extract changelog
|
||||
run: |
|
||||
latest_release=$(awk 'BEGIN { RS="## \\[" } NR==2 { print "## ["$0 }' CHANGELOG.md)
|
||||
echo -e "\n$latest_release" >> docs/unstable-changelog.md
|
||||
echo -e "\n$latest_release" >> docs/canary-changelog.md
|
||||
|
||||
- name: Create unstable release
|
||||
run: gh release create unstable ./release/playlet.zip ./release/playlet-lib.zip --notes-file docs/unstable-changelog.md --prerelease --title unstable
|
||||
- name: Create Canary release
|
||||
run: gh release create canary ./release/playlet.zip ./release/playlet-lib.zip --notes-file docs/canary-changelog.md --prerelease --title Canary
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GH_TOKEN }}
|
||||
@@ -5,6 +5,34 @@ All notable changes to this project will be documented in this file.
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [0.12.1] - 2023-09-19
|
||||
|
||||
### Added
|
||||
|
||||
- New logger: less features, and less rendezvous
|
||||
|
||||
### Fixed
|
||||
|
||||
- A bug where the app crashes if an error happens loading channel info
|
||||
|
||||
### Removed
|
||||
|
||||
- `roku-log` package
|
||||
- `ropm`
|
||||
|
||||
## [0.12.0] - 2023-09-17
|
||||
|
||||
### Added
|
||||
|
||||
- A field to indicate when a playlist was last updated
|
||||
- Voice search in search page
|
||||
- Basic support for channels (open channel, see latest videos)
|
||||
- Search filters (Upload date, type, duration, features, and sort by)
|
||||
|
||||
### Changed
|
||||
|
||||
- Renamed `Unstable` releases to `Canary`
|
||||
|
||||
## [0.11.0] - 2023-09-10
|
||||
|
||||
This version went through a major refactor, which resulted in a different arcitecture of the app to support new features, the rewrite of many pieces, as well as new features.
|
||||
|
||||
@@ -19,7 +19,7 @@ could be public instances hosted by volenteers. These instances are available
|
||||
While invidious does no data collection by default, and it is in fact built to
|
||||
be privacy driven, but in theory, from a playlet request it is possible to
|
||||
know the IP address of a user, the identifiers of watched video, and search
|
||||
keywords. In case the user is unreasonably paranoid, they can host their own
|
||||
keywords. In case the user has privacy concerns, they can host their own
|
||||
Invidious instance and use it from Playlet.
|
||||
|
||||
## SponsorBlock
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<img alt="Current Release" src="https://img.shields.io/github/release/iBicha/playlet.svg"/>
|
||||
<img alt="Total Downloads" src="https://img.shields.io/github/downloads/iBicha/playlet/latest/playlet-lib.zip.svg"/>
|
||||
</a>
|
||||
<a href="https://github.com/iBicha/playlet">
|
||||
<a href="/LICENSE">
|
||||
<img alt="AGPL-3.0 license" src="https://img.shields.io/github/license/iBicha/playlet.svg"/>
|
||||
</a>
|
||||
<a href="https://channelstore.roku.com/en-ca/details/840aec36f51bfe6d96cf6db9055a372a/playlet">
|
||||
@@ -56,7 +56,7 @@ More under [Screenshots](./docs/screenshots/README.md)
|
||||
### Picture-in-picture
|
||||
|
||||
- When viewing a video in full screen, press ⬇️ (down) button on your remote to shrink the video
|
||||
- You can browser or search for videos while you watch
|
||||
- You can browse or search for videos while you watch
|
||||
- To restore currently playing video to full screen, press the ✳️ (options) button
|
||||
|
||||
### Customize Invidious instance
|
||||
|
||||
@@ -39,7 +39,6 @@
|
||||
],
|
||||
"lintConfig": "./config/bslint.jsonc",
|
||||
"plugins": [
|
||||
"roku-log-bsc-plugin",
|
||||
"@rokucommunity/bslint",
|
||||
"../tools/bs-plugins/asynctask-plugin.ts",
|
||||
"../tools/bs-plugins/manifest-edit-plugin.ts",
|
||||
@@ -48,7 +47,8 @@
|
||||
"../tools/bs-plugins/oninit-plugin.ts",
|
||||
"../tools/bs-plugins/track-transpiled-plugin.ts",
|
||||
"../tools/bs-plugins/json-yaml-plugin.ts",
|
||||
"../tools/bs-plugins/validation-plugin.ts"
|
||||
"../tools/bs-plugins/validation-plugin.ts",
|
||||
"../tools/bs-plugins/logger-plugin.ts"
|
||||
],
|
||||
"retainStagingDir": true,
|
||||
"require": [
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
"!**/*.transpiled.*"
|
||||
],
|
||||
"plugins": [
|
||||
"roku-log-bsc-plugin",
|
||||
"@rokucommunity/bslint",
|
||||
"rooibos-roku",
|
||||
"../tools/bs-plugins/asynctask-plugin.ts",
|
||||
@@ -24,7 +23,8 @@
|
||||
"../tools/bs-plugins/oninit-plugin.ts",
|
||||
"../tools/bs-plugins/track-transpiled-plugin.ts",
|
||||
"../tools/bs-plugins/json-yaml-plugin.ts",
|
||||
"../tools/bs-plugins/validation-plugin.ts"
|
||||
"../tools/bs-plugins/validation-plugin.ts",
|
||||
"../tools/bs-plugins/logger-plugin.ts"
|
||||
],
|
||||
"rooibos": {
|
||||
"logLevel": 2,
|
||||
|
||||
@@ -19,12 +19,11 @@ This document contains various kinds of information related to Playlet developme
|
||||
- [Debug endpoints](#debug-endpoints)
|
||||
- [Releases from Github](#releases-from-github)
|
||||
- [Dev library hosted by VS Code Extension](#dev-library-hosted-by-vs-code-extension)
|
||||
- [AsyncAwait Task Generator](#asyncawait-task-generator)
|
||||
- [Feature flags](#feature-flags)
|
||||
- [User preferences](#user-preferences)
|
||||
- [Home page layout](#home-page-layout)
|
||||
- [Playlet Web App](#playlet-web-app)
|
||||
- [Testing](#testing)
|
||||
- [Playlet Web App](#playlet-web-app)
|
||||
- [Svelte development](#svelte-development)
|
||||
- [Tailwind/Daisy UI](#tailwinddaisy-ui)
|
||||
- [API calls (proxy authenticated)](#api-calls-proxy-authenticated)
|
||||
@@ -291,7 +290,7 @@ The developer settings are only visible through the web app. They are found at t
|
||||
|
||||
For now, it allows you to point to a different Github release other than the default `latest`.
|
||||
|
||||
This is mostly useful to QA the `unstable` release in a "production" setting before making it available to all users as the official "latest" version. Consider the `unstable` version a [Canary release](https://en.wikipedia.org/wiki/Feature_toggle#Canary_release)
|
||||
This is mostly useful to QA the `canary` release (see [Canary release](https://en.wikipedia.org/wiki/Feature_toggle#Canary_release)) in a "production" setting before making it available to all users as the official "latest" version.
|
||||
|
||||
#### In case of a softlock
|
||||
|
||||
@@ -307,8 +306,8 @@ This will remove the custom lib, and revert to using default (latest release fro
|
||||
|
||||
On pull requests, a Github action will run `lint:fix` and `format:fix` and push changes to the PR branch, to keep things tidy.
|
||||
|
||||
When merged to main branch, a Github action will build Playlet, run static analysis using Roku's [Static Channel Analysis tool](https://devtools.web.roku.com/#static-channel-analysis-tool), and release a new version tagged `unstable`, with the build artifacts attached, and changelog included.
|
||||
When merged to main branch, a Github action will build Playlet, run static analysis using Roku's [Static Channel Analysis tool](https://devtools.web.roku.com/#static-channel-analysis-tool), and release a new version tagged `canary`, with the build artifacts attached, and changelog included.
|
||||
|
||||
Existing `unstable` release will be removed before creating a new one.
|
||||
Existing `canary` release will be removed before creating a new one.
|
||||
|
||||
This makes [Releasing](./RELEASING.md) simpler.
|
||||
@@ -3,10 +3,10 @@
|
||||
# Releasing
|
||||
|
||||
The release process for Playlet is very simple, since most of the work is automated.
|
||||
The automation makes `unstable` releases.
|
||||
The automation makes `canary` releases.
|
||||
|
||||
```makefile
|
||||
unstable release + QA = stable version
|
||||
canary release + QA = stable version
|
||||
```
|
||||
|
||||
These are mostly the steps when releasing a new version:
|
||||
@@ -23,12 +23,12 @@ These are mostly the steps when releasing a new version:
|
||||
- Title: `Release v$VERSION`
|
||||
- Comment: `Release $VERSION \nIt should contain everything planned from #6`
|
||||
- Wait for CI and merge
|
||||
- Wait for CI on main branch to create the `unstable` release
|
||||
- Edit `unstable` release
|
||||
- Wait for CI on main branch to create the `canary` release
|
||||
- Edit `canary` release
|
||||
- Tag: `v$VERSION`
|
||||
- Title: `v$VERSION`
|
||||
- Body: the content from CHANGELOG.md for this version
|
||||
- This should be already included, just remove the notes about testing the unstable release
|
||||
- This should be already included, just remove the notes about testing the canary release
|
||||
- Uncheck `Set as a pre-release`
|
||||
- Check `Set as the latest release`
|
||||
- Click `update release`
|
||||
|
||||
@@ -6,6 +6,6 @@ To test this release:
|
||||
|
||||
- Open Playlet web app in a browser (`http://ROKU_IP_ADDRESS:8888/index.html`)
|
||||
- Go to settings, and scroll down to `Developer settings`
|
||||
- Set `Playlet Library version` to `unstable` and click `Apply`
|
||||
- Set `Playlet Library version` to `canary` and click `Apply`
|
||||
- Restart Playlet
|
||||
- You can verify that you're testing the `unstable` release in the `Info` tab in Playlet or the web app
|
||||
- You can verify that you're testing the `canary` release in the `Info` tab in Playlet or the web app
|
||||
@@ -2,7 +2,7 @@ openapi: 3.0.0
|
||||
|
||||
info:
|
||||
title: Playlet Web API
|
||||
version: 0.11.0
|
||||
version: 0.12.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
|
||||
|
||||
@@ -1,12 +1,21 @@
|
||||
# Playlet Brighterscript Plugins
|
||||
|
||||
<!-- markdownlint-disable MD024 -->
|
||||
- [Json5/Yaml support](#json5yaml-support)
|
||||
- [Manifest editing](#manifest-editing)
|
||||
- [Validation](#validation)
|
||||
- [Includes](#includes)
|
||||
- [@oninit](#oninit)
|
||||
- [Bindings](#bindings)
|
||||
- [Async Task Generator](#async-task-generator)
|
||||
- [Tracking transpilied files](#tracking-transpilied-files)
|
||||
|
||||
Playlet implements a few [Brighterscript Plugins](https://github.com/rokucommunity/brighterscript/blob/master/docs/plugins.md). The plugins inject themselves in the compilation process, allowing the modification of bs scripts, xml components, and even assets or the app manifest. Let's start with a simple one:
|
||||
|
||||
<!-- markdownlint-disable MD024 -->
|
||||
|
||||
## Json5/Yaml support
|
||||
|
||||
**[Source](tools/bs-plugins/json-yaml-plugin.ts)**
|
||||
**[Source](/tools/bs-plugins/json-yaml-plugin.ts)**
|
||||
|
||||
This plugin allows us to include `jsonc`, `json5` and `yaml` files into the app as static assets. They are an alternative to plain `json`, which for instance, does not support comments. Additionally, this plugin minifies the `json` files.
|
||||
|
||||
@@ -20,7 +29,7 @@ At the end of the build, the plugin scans for certain files (`jsonc`, `json`, `j
|
||||
|
||||
## Manifest editing
|
||||
|
||||
**[Source](tools/bs-plugins/manifest-edit-plugin.ts)**
|
||||
**[Source](/tools/bs-plugins/manifest-edit-plugin.ts)**
|
||||
|
||||
This plugin allows us to make modifications to the app manifest dynamically, mostly based on compiler flags.
|
||||
|
||||
@@ -38,7 +47,7 @@ We simply read the content of the original manifest, and modify it before the co
|
||||
|
||||
## Validation
|
||||
|
||||
**[Source](tools/bs-plugins/validation-plugin.ts)**
|
||||
**[Source](/tools/bs-plugins/validation-plugin.ts)**
|
||||
|
||||
This plugin allows us to add custom diagnostic errors messages to source code, to prevent using certain patterns of functions.
|
||||
|
||||
@@ -86,7 +95,7 @@ node.ObserveField("someField", "OnSomeFieldChanged")
|
||||
|
||||
## Includes
|
||||
|
||||
**[Source](tools/bs-plugins/component-includes-plugin.ts)**
|
||||
**[Source](/tools/bs-plugins/component-includes-plugin.ts)**
|
||||
|
||||
This plugin allows us "include" different pieces of a component, enabling [Composition over inheritance](https://en.wikipedia.org/wiki/Composition_over_inheritance)
|
||||
|
||||
@@ -98,7 +107,7 @@ Consider a "behaviour" that we want in multiple components. For example:
|
||||
<!-- Beep.xml -->
|
||||
<component name="Beep" extends="Node">
|
||||
<interface>
|
||||
<field id="beep" type="boolean" alwaysNotify="true" onChange="OnBeepSet" />
|
||||
<field id="beepNow" type="boolean" alwaysNotify="true" onChange="OnBeepSet" />
|
||||
</interface>
|
||||
<script type="text/brightscript" uri="pkg:/path/to/Beep.bs" />
|
||||
</component>
|
||||
@@ -161,7 +170,7 @@ A couple of more details:
|
||||
|
||||
## @oninit
|
||||
|
||||
**[Source](tools/bs-plugins/oninit-plugin.ts)**
|
||||
**[Source](/tools/bs-plugins/oninit-plugin.ts)**
|
||||
|
||||
`@oninit` is an annotation that can be added to functions, and then these functions will be called in the `Init()` function of the component it is in.
|
||||
|
||||
@@ -214,7 +223,7 @@ Important implementation details:
|
||||
|
||||
## Bindings
|
||||
|
||||
**[Source](tools/bs-plugins/bindings-plugin.ts)**
|
||||
**[Source](/tools/bs-plugins/bindings-plugin.ts)**
|
||||
|
||||
This plugin allows us to "bind" different node references together. It's a simple form of dependency injection to manage dependencies between nodes.
|
||||
|
||||
@@ -409,7 +418,7 @@ calling `BindNode` will trigger all the binding steps just for this node. But it
|
||||
|
||||
## Async Task Generator
|
||||
|
||||
**[Source](tools/bs-plugins/asynctask-plugin.ts)**
|
||||
**[Source](/tools/bs-plugins/asynctask-plugin.ts)**
|
||||
|
||||
This plugin generates `Task` components a scripts that makes it simpler to call a function in a background thread, and get the result in a callback function.
|
||||
|
||||
@@ -456,7 +465,7 @@ Although very useful, this pattern might not be the best for long running tasks
|
||||
|
||||
## Tracking transpilied files
|
||||
|
||||
**[Source](tools/bs-plugins/track-transpiled-plugin.ts)**
|
||||
**[Source](/tools/bs-plugins/track-transpiled-plugin.ts)**
|
||||
|
||||
By now, you realize we make a lot of transformations to the source code through many plugins. As a sanity check, this plugin allows us to keep track of the transpiled files, so we can be sure that the output is what we expect.
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "playlet",
|
||||
"version": "0.11.0",
|
||||
"version": "0.12.1",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "playlet",
|
||||
"version": "0.11.0",
|
||||
"version": "0.12.1",
|
||||
"hasInstallScript": true,
|
||||
"devDependencies": {
|
||||
"@rokucommunity/bslint": "^0.8.9",
|
||||
@@ -25,9 +25,7 @@
|
||||
"ip": "^1.1.8",
|
||||
"json5": "^2.2.3",
|
||||
"roku-deploy": "^3.10.3",
|
||||
"roku-log-bsc-plugin": "^0.8.1",
|
||||
"rooibos-roku": "^5.7.0",
|
||||
"ropm": "^0.10.16",
|
||||
"semver": "^7.5.4",
|
||||
"shelljs": "^0.8.5",
|
||||
"ts-node": "^10.9.1",
|
||||
@@ -373,26 +371,6 @@
|
||||
"@types/node": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@xml-tools/ast": {
|
||||
"version": "5.0.5",
|
||||
"resolved": "https://registry.npmjs.org/@xml-tools/ast/-/ast-5.0.5.tgz",
|
||||
"integrity": "sha512-avvzTOvGplCx9JSKdsTe3vK+ACvsHy2HxVfkcfIqPzu+kF5CT4rw5aUVzs0tJF4cnDyMRVkSyVxR07X0Px8gPA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@xml-tools/common": "^0.1.6",
|
||||
"@xml-tools/parser": "^1.0.11",
|
||||
"lodash": "4.17.21"
|
||||
}
|
||||
},
|
||||
"node_modules/@xml-tools/common": {
|
||||
"version": "0.1.6",
|
||||
"resolved": "https://registry.npmjs.org/@xml-tools/common/-/common-0.1.6.tgz",
|
||||
"integrity": "sha512-7aVZeEYccs1KI/Asd6KKnrB4dTAWXTkjRMjG40ApGEUp5NpfQIvWLEBvMv85Koj2lbSpagcAERwDy9qMsfWGdA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"lodash": "4.17.21"
|
||||
}
|
||||
},
|
||||
"node_modules/@xml-tools/parser": {
|
||||
"version": "1.0.11",
|
||||
"resolved": "https://registry.npmjs.org/@xml-tools/parser/-/parser-1.0.11.tgz",
|
||||
@@ -480,19 +458,6 @@
|
||||
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/aggregate-error": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz",
|
||||
"integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"clean-stack": "^2.0.0",
|
||||
"indent-string": "^4.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/ajv": {
|
||||
"version": "6.12.6",
|
||||
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz",
|
||||
@@ -570,15 +535,6 @@
|
||||
"integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/array-union": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz",
|
||||
"integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/asn1": {
|
||||
"version": "0.2.6",
|
||||
"resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.6.tgz",
|
||||
@@ -603,15 +559,6 @@
|
||||
"integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/at-least-node": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz",
|
||||
"integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">= 4.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/aws-sign2": {
|
||||
"version": "0.7.0",
|
||||
"resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz",
|
||||
@@ -1235,15 +1182,6 @@
|
||||
"integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/clean-stack": {
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz",
|
||||
"integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/clear": {
|
||||
"version": "0.1.0",
|
||||
"resolved": "https://registry.npmjs.org/clear/-/clear-0.1.0.tgz",
|
||||
@@ -1648,28 +1586,6 @@
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/del": {
|
||||
"version": "6.0.0",
|
||||
"resolved": "https://registry.npmjs.org/del/-/del-6.0.0.tgz",
|
||||
"integrity": "sha512-1shh9DQ23L16oXSZKB2JxpL7iMy2E0S9d517ptA1P8iw0alkPtQcrKH7ru31rYtKwF499HkTu+DRzq3TCKDFRQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"globby": "^11.0.1",
|
||||
"graceful-fs": "^4.2.4",
|
||||
"is-glob": "^4.0.1",
|
||||
"is-path-cwd": "^2.2.0",
|
||||
"is-path-inside": "^3.0.2",
|
||||
"p-map": "^4.0.0",
|
||||
"rimraf": "^3.0.2",
|
||||
"slash": "^3.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/delayed-stream": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
|
||||
@@ -1713,18 +1629,6 @@
|
||||
"node": ">=0.3.1"
|
||||
}
|
||||
},
|
||||
"node_modules/dir-glob": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz",
|
||||
"integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"path-type": "^4.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/dom-serializer": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz",
|
||||
@@ -2251,12 +2155,6 @@
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/get-own-enumerable-property-symbols": {
|
||||
"version": "3.0.2",
|
||||
"resolved": "https://registry.npmjs.org/get-own-enumerable-property-symbols/-/get-own-enumerable-property-symbols-3.0.2.tgz",
|
||||
"integrity": "sha512-I0UBV/XOz1XkIJHEUDMZAbzCThU/H8DxmSfmdGcKPnVhu2VfFqr34jr9777IyaTYvxjedWhqVIilEDsCdP5G6g==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/get-stdin": {
|
||||
"version": "8.0.0",
|
||||
"resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-8.0.0.tgz",
|
||||
@@ -2393,26 +2291,6 @@
|
||||
"node": ">=16 || 14 >=14.17"
|
||||
}
|
||||
},
|
||||
"node_modules/globby": {
|
||||
"version": "11.1.0",
|
||||
"resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz",
|
||||
"integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"array-union": "^2.1.0",
|
||||
"dir-glob": "^3.0.1",
|
||||
"fast-glob": "^3.2.9",
|
||||
"ignore": "^5.2.0",
|
||||
"merge2": "^1.4.1",
|
||||
"slash": "^3.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/graceful-fs": {
|
||||
"version": "4.2.11",
|
||||
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz",
|
||||
@@ -2604,39 +2482,12 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"node_modules/ignore": {
|
||||
"version": "5.2.4",
|
||||
"resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz",
|
||||
"integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">= 4"
|
||||
}
|
||||
},
|
||||
"node_modules/ignore-walk": {
|
||||
"version": "3.0.4",
|
||||
"resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.4.tgz",
|
||||
"integrity": "sha512-PY6Ii8o1jMRA1z4F2hRkH/xN59ox43DavKvD3oDpfurRlOJyAHpifIwpbdv1n4jt4ov0jSpw3kQ4GhJnpBL6WQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"minimatch": "^3.0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/immediate": {
|
||||
"version": "3.0.6",
|
||||
"resolved": "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz",
|
||||
"integrity": "sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/indent-string": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz",
|
||||
"integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/inflight": {
|
||||
"version": "1.0.6",
|
||||
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
|
||||
@@ -2740,42 +2591,6 @@
|
||||
"node": ">=0.12.0"
|
||||
}
|
||||
},
|
||||
"node_modules/is-obj": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz",
|
||||
"integrity": "sha512-l4RyHgRqGN4Y3+9JHVrNqO+tN0rV5My76uW5/nuO4K1b6vw5G8d/cmFjP9tRfEsdhZNt0IFdZuK/c2Vr4Nb+Qg==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/is-path-cwd": {
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-2.2.0.tgz",
|
||||
"integrity": "sha512-w942bTcih8fdJPJmQHFzkS76NEP8Kzzvmw92cXsazb8intwLqPibPPdXf4ANdKV3rYMuuQYGIWtvz9JilB3NFQ==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/is-path-inside": {
|
||||
"version": "3.0.3",
|
||||
"resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz",
|
||||
"integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/is-regexp": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/is-regexp/-/is-regexp-1.0.0.tgz",
|
||||
"integrity": "sha512-7zjFAPO4/gwyQAAgRRmqeEeyIICSdmCqa3tsVHMdBzaXXRiqopZL4Cyghg/XulGWrtABTpbnYYzzIRffLkP4oA==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/is-typedarray": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz",
|
||||
@@ -2911,12 +2726,6 @@
|
||||
"setimmediate": "^1.0.5"
|
||||
}
|
||||
},
|
||||
"node_modules/latinize": {
|
||||
"version": "0.5.0",
|
||||
"resolved": "https://registry.npmjs.org/latinize/-/latinize-0.5.0.tgz",
|
||||
"integrity": "sha512-SHzxgdcFP/64lUEfX3183QALY2KdSQxad3gmhCc/b03QN1mbx0AnJWvsQjqoJLbucY9pJuK+NMbnasUIocDmnQ==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/lcov-parse": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/lcov-parse/-/lcov-parse-1.0.0.tgz",
|
||||
@@ -2947,12 +2756,6 @@
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/lodash": {
|
||||
"version": "4.17.21",
|
||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
|
||||
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/lodash.omit": {
|
||||
"version": "4.5.0",
|
||||
"resolved": "https://registry.npmjs.org/lodash.omit/-/lodash.omit-4.5.0.tgz",
|
||||
@@ -3169,59 +2972,6 @@
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/npm-bundled": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.1.2.tgz",
|
||||
"integrity": "sha512-x5DHup0SuyQcmL3s7Rx/YQ8sbw/Hzg0rj48eN0dV7hf5cmQq5PXIeioroH3raV1QC1yh3uTYuMThvEQF3iKgGQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"npm-normalize-package-bin": "^1.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/npm-normalize-package-bin": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-1.0.1.tgz",
|
||||
"integrity": "sha512-EPfafl6JL5/rU+ot6P3gRSCpPDW5VmIzX959Ob1+ySFUuuYHWHekXpwdUZcKP5C+DS4GEtdJluwBjnsNDl+fSA==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/npm-packlist": {
|
||||
"version": "2.1.4",
|
||||
"resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-2.1.4.tgz",
|
||||
"integrity": "sha512-Qzg2pvXC9U4I4fLnUrBmcIT4x0woLtUgxUi9eC+Zrcv1Xx5eamytGAfbDWQ67j7xOcQ2VW1I3su9smVTIdu7Hw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"glob": "^7.1.6",
|
||||
"ignore-walk": "^3.0.3",
|
||||
"npm-bundled": "^1.1.1",
|
||||
"npm-normalize-package-bin": "^1.0.1"
|
||||
},
|
||||
"bin": {
|
||||
"npm-packlist": "bin/index.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
}
|
||||
},
|
||||
"node_modules/npm-packlist/node_modules/glob": {
|
||||
"version": "7.2.3",
|
||||
"resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz",
|
||||
"integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"fs.realpath": "^1.0.0",
|
||||
"inflight": "^1.0.4",
|
||||
"inherits": "2",
|
||||
"minimatch": "^3.1.1",
|
||||
"once": "^1.3.0",
|
||||
"path-is-absolute": "^1.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "*"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/isaacs"
|
||||
}
|
||||
},
|
||||
"node_modules/nth-check": {
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz",
|
||||
@@ -3321,21 +3071,6 @@
|
||||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/p-map": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz",
|
||||
"integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"aggregate-error": "^3.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/p-reflect": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/p-reflect/-/p-reflect-1.0.0.tgz",
|
||||
@@ -3489,15 +3224,6 @@
|
||||
"integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/path-type": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz",
|
||||
"integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/pend": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz",
|
||||
@@ -3999,62 +3725,6 @@
|
||||
"node": ">=4.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/roku-log-bsc-plugin": {
|
||||
"version": "0.8.1",
|
||||
"resolved": "https://registry.npmjs.org/roku-log-bsc-plugin/-/roku-log-bsc-plugin-0.8.1.tgz",
|
||||
"integrity": "sha512-GL/fM4vx1BCLHny9yC1RR81v8LY6FDAWx4jGkivGz36/wZfRDnM9MqSSIgJ4z7p0Jns4AL2o80MNd9Ytaulo/A==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@types/node": "^16.18.10",
|
||||
"source-map": "^0.7.3",
|
||||
"stringify-object": "^3.3.0",
|
||||
"vscode-languageserver": "~6.1.1",
|
||||
"vscode-languageserver-protocol": "~3.15.3"
|
||||
}
|
||||
},
|
||||
"node_modules/roku-log-bsc-plugin/node_modules/@types/node": {
|
||||
"version": "16.18.36",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.36.tgz",
|
||||
"integrity": "sha512-8egDX8dE50XyXWH6C6PRCNkTP106DuUrvdrednFouDSmCi7IOvrqr0frznfZaHifHH/3aq/7a7v9N4wdXMqhBQ==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/roku-log-bsc-plugin/node_modules/vscode-jsonrpc": {
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-5.0.1.tgz",
|
||||
"integrity": "sha512-JvONPptw3GAQGXlVV2utDcHx0BiY34FupW/kI6mZ5x06ER5DdPG/tXWMVHjTNULF5uKPOUUD0SaXg5QaubJL0A==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=8.0.0 || >=10.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/roku-log-bsc-plugin/node_modules/vscode-languageserver": {
|
||||
"version": "6.1.1",
|
||||
"resolved": "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-6.1.1.tgz",
|
||||
"integrity": "sha512-DueEpkUAkD5XTR4MLYNr6bQIp/UFR0/IPApgXU3YfCBCB08u2sm9hRCs6DxYZELkk++STPjpcjksR2H8qI3cDQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"vscode-languageserver-protocol": "^3.15.3"
|
||||
},
|
||||
"bin": {
|
||||
"installServerIntoExtension": "bin/installServerIntoExtension"
|
||||
}
|
||||
},
|
||||
"node_modules/roku-log-bsc-plugin/node_modules/vscode-languageserver-protocol": {
|
||||
"version": "3.15.3",
|
||||
"resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.15.3.tgz",
|
||||
"integrity": "sha512-zrMuwHOAQRhjDSnflWdJG+O2ztMWss8GqUUB8dXLR/FPenwkiBNkMIJJYfSN6sgskvsF0rHAoBowNQfbyZnnvw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"vscode-jsonrpc": "^5.0.1",
|
||||
"vscode-languageserver-types": "3.15.1"
|
||||
}
|
||||
},
|
||||
"node_modules/roku-log-bsc-plugin/node_modules/vscode-languageserver-types": {
|
||||
"version": "3.15.1",
|
||||
"resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.15.1.tgz",
|
||||
"integrity": "sha512-+a9MPUQrNGRrGU630OGbYVQ+11iOIovjCkqxajPa9w57Sd5ruK8WQNsslzpa0x/QJqC8kRc2DUxWjIFwoNm4ZQ==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/rooibos-roku": {
|
||||
"version": "5.7.0",
|
||||
"resolved": "https://registry.npmjs.org/rooibos-roku/-/rooibos-roku-5.7.0.tgz",
|
||||
@@ -4104,231 +3774,6 @@
|
||||
"integrity": "sha512-+a9MPUQrNGRrGU630OGbYVQ+11iOIovjCkqxajPa9w57Sd5ruK8WQNsslzpa0x/QJqC8kRc2DUxWjIFwoNm4ZQ==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/ropm": {
|
||||
"version": "0.10.16",
|
||||
"resolved": "https://registry.npmjs.org/ropm/-/ropm-0.10.16.tgz",
|
||||
"integrity": "sha512-YZ49ie+dSRkyOz7RbXpku+neujhk6WfrFKUpda844W2kB0Xk/p4XtwirIdorVNtefBqEeQMXswwrVaWLNaL+vQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@xml-tools/ast": "^5.0.5",
|
||||
"@xml-tools/parser": "1.0.10",
|
||||
"brighterscript": "^0.65.4",
|
||||
"del": "6.0.0",
|
||||
"fs-extra": "9.1.0",
|
||||
"glob-all": "3.2.1",
|
||||
"latinize": "0.5.0",
|
||||
"npm-packlist": "2.1.4",
|
||||
"roku-deploy": "^3.10.3",
|
||||
"semver": "7.3.4",
|
||||
"yargs": "16.2.0"
|
||||
},
|
||||
"bin": {
|
||||
"ropm": "dist/cli.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8.1.10"
|
||||
}
|
||||
},
|
||||
"node_modules/ropm/node_modules/@xml-tools/parser": {
|
||||
"version": "1.0.10",
|
||||
"resolved": "https://registry.npmjs.org/@xml-tools/parser/-/parser-1.0.10.tgz",
|
||||
"integrity": "sha512-9oRb68wEKT+MRB7e2GwTiKicRKVXKzquBDGgH6YcGafvnSYXorWi2oaTVtbv2109RlGiQSnoXaQFUXCnHwFS7Q==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"chevrotain": "7.1.1"
|
||||
}
|
||||
},
|
||||
"node_modules/ropm/node_modules/ansi-styles": {
|
||||
"version": "4.3.0",
|
||||
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
|
||||
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"color-convert": "^2.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/chalk/ansi-styles?sponsor=1"
|
||||
}
|
||||
},
|
||||
"node_modules/ropm/node_modules/chevrotain": {
|
||||
"version": "7.1.1",
|
||||
"resolved": "https://registry.npmjs.org/chevrotain/-/chevrotain-7.1.1.tgz",
|
||||
"integrity": "sha512-wy3mC1x4ye+O+QkEinVJkPf5u2vsrDIYW9G7ZuwFl6v/Yu0LwUuT2POsb+NUWApebyxfkQq6+yDfRExbnI5rcw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"regexp-to-ast": "0.5.0"
|
||||
}
|
||||
},
|
||||
"node_modules/ropm/node_modules/color-convert": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
|
||||
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"color-name": "~1.1.4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=7.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/ropm/node_modules/color-name": {
|
||||
"version": "1.1.4",
|
||||
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
|
||||
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/ropm/node_modules/fs-extra": {
|
||||
"version": "9.1.0",
|
||||
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz",
|
||||
"integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"at-least-node": "^1.0.0",
|
||||
"graceful-fs": "^4.2.0",
|
||||
"jsonfile": "^6.0.1",
|
||||
"universalify": "^2.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
}
|
||||
},
|
||||
"node_modules/ropm/node_modules/glob": {
|
||||
"version": "7.2.3",
|
||||
"resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz",
|
||||
"integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"fs.realpath": "^1.0.0",
|
||||
"inflight": "^1.0.4",
|
||||
"inherits": "2",
|
||||
"minimatch": "^3.1.1",
|
||||
"once": "^1.3.0",
|
||||
"path-is-absolute": "^1.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "*"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/isaacs"
|
||||
}
|
||||
},
|
||||
"node_modules/ropm/node_modules/glob-all": {
|
||||
"version": "3.2.1",
|
||||
"resolved": "https://registry.npmjs.org/glob-all/-/glob-all-3.2.1.tgz",
|
||||
"integrity": "sha512-x877rVkzB3ipid577QOp+eQCR6M5ZyiwrtaYgrX/z3EThaSPFtLDwBXFHc3sH1cG0R0vFYI5SRYeWMMSEyXkUw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"glob": "^7.1.2",
|
||||
"yargs": "^15.3.1"
|
||||
},
|
||||
"bin": {
|
||||
"glob-all": "bin/glob-all"
|
||||
}
|
||||
},
|
||||
"node_modules/ropm/node_modules/glob-all/node_modules/yargs": {
|
||||
"version": "15.4.1",
|
||||
"resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz",
|
||||
"integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"cliui": "^6.0.0",
|
||||
"decamelize": "^1.2.0",
|
||||
"find-up": "^4.1.0",
|
||||
"get-caller-file": "^2.0.1",
|
||||
"require-directory": "^2.1.1",
|
||||
"require-main-filename": "^2.0.0",
|
||||
"set-blocking": "^2.0.0",
|
||||
"string-width": "^4.2.0",
|
||||
"which-module": "^2.0.0",
|
||||
"y18n": "^4.0.0",
|
||||
"yargs-parser": "^18.1.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/ropm/node_modules/semver": {
|
||||
"version": "7.3.4",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz",
|
||||
"integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"lru-cache": "^6.0.0"
|
||||
},
|
||||
"bin": {
|
||||
"semver": "bin/semver.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
}
|
||||
},
|
||||
"node_modules/ropm/node_modules/wrap-ansi": {
|
||||
"version": "7.0.0",
|
||||
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
|
||||
"integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"ansi-styles": "^4.0.0",
|
||||
"string-width": "^4.1.0",
|
||||
"strip-ansi": "^6.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/chalk/wrap-ansi?sponsor=1"
|
||||
}
|
||||
},
|
||||
"node_modules/ropm/node_modules/yargs": {
|
||||
"version": "16.2.0",
|
||||
"resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz",
|
||||
"integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"cliui": "^7.0.2",
|
||||
"escalade": "^3.1.1",
|
||||
"get-caller-file": "^2.0.5",
|
||||
"require-directory": "^2.1.1",
|
||||
"string-width": "^4.2.0",
|
||||
"y18n": "^5.0.5",
|
||||
"yargs-parser": "^20.2.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
}
|
||||
},
|
||||
"node_modules/ropm/node_modules/yargs/node_modules/cliui": {
|
||||
"version": "7.0.4",
|
||||
"resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz",
|
||||
"integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"string-width": "^4.2.0",
|
||||
"strip-ansi": "^6.0.0",
|
||||
"wrap-ansi": "^7.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/ropm/node_modules/yargs/node_modules/y18n": {
|
||||
"version": "5.0.8",
|
||||
"resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz",
|
||||
"integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
}
|
||||
},
|
||||
"node_modules/ropm/node_modules/yargs/node_modules/yargs-parser": {
|
||||
"version": "20.2.9",
|
||||
"resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz",
|
||||
"integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
}
|
||||
},
|
||||
"node_modules/run-parallel": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz",
|
||||
@@ -4549,15 +3994,6 @@
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/slash": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz",
|
||||
"integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/source-map": {
|
||||
"version": "0.7.4",
|
||||
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.4.tgz",
|
||||
@@ -4654,20 +4090,6 @@
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/stringify-object": {
|
||||
"version": "3.3.0",
|
||||
"resolved": "https://registry.npmjs.org/stringify-object/-/stringify-object-3.3.0.tgz",
|
||||
"integrity": "sha512-rHqiFh1elqCQ9WPLIC8I0Q/g/wj5J1eMkyoiD6eoQApWHP0FtlK7rqnhmabL5VUY9JQCcqwwvlOaSuutekgyrw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"get-own-enumerable-property-symbols": "^3.0.0",
|
||||
"is-obj": "^1.0.1",
|
||||
"is-regexp": "^1.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/strip-ansi": {
|
||||
"version": "6.0.1",
|
||||
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "playlet",
|
||||
"version": "0.11.0",
|
||||
"version": "0.12.1",
|
||||
"description": "Unofficial Youtube client for Roku",
|
||||
"devDependencies": {
|
||||
"@rokucommunity/bslint": "^0.8.9",
|
||||
@@ -19,9 +19,7 @@
|
||||
"ip": "^1.1.8",
|
||||
"json5": "^2.2.3",
|
||||
"roku-deploy": "^3.10.3",
|
||||
"roku-log-bsc-plugin": "^0.8.1",
|
||||
"rooibos-roku": "^5.7.0",
|
||||
"ropm": "^0.10.16",
|
||||
"semver": "^7.5.4",
|
||||
"shelljs": "^0.8.5",
|
||||
"ts-node": "^10.9.1",
|
||||
|
||||
@@ -1,29 +1,12 @@
|
||||
{
|
||||
"name": "playlet-app",
|
||||
"version": "0.11.0",
|
||||
"version": "0.12.1",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "playlet-app",
|
||||
"version": "0.11.0",
|
||||
"hasInstallScript": true,
|
||||
"dependencies": {
|
||||
"bslib": "npm:@rokucommunity/bslib@^0.1.1"
|
||||
}
|
||||
},
|
||||
"node_modules/bslib": {
|
||||
"name": "@rokucommunity/bslib",
|
||||
"version": "0.1.1",
|
||||
"resolved": "https://registry.npmjs.org/@rokucommunity/bslib/-/bslib-0.1.1.tgz",
|
||||
"integrity": "sha512-2ox6EUL+UTtccTbD4dbVjZK3QHa0PHCqpoKMF8lZz9ayzzEP3iVPF8KZR6hOi6bxsIcbGXVjqmtCVkpC4P9SrA=="
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"bslib": {
|
||||
"version": "npm:@rokucommunity/bslib@0.1.1",
|
||||
"resolved": "https://registry.npmjs.org/@rokucommunity/bslib/-/bslib-0.1.1.tgz",
|
||||
"integrity": "sha512-2ox6EUL+UTtccTbD4dbVjZK3QHa0PHCqpoKMF8lZz9ayzzEP3iVPF8KZR6hOi6bxsIcbGXVjqmtCVkpC4P9SrA=="
|
||||
"version": "0.12.1"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,7 @@
|
||||
{
|
||||
"name": "playlet-app",
|
||||
"version": "0.11.0",
|
||||
"version": "0.12.1",
|
||||
"description": "Unofficial Youtube client for Roku",
|
||||
"dependencies": {
|
||||
"bslib": "npm:@rokucommunity/bslib@^0.1.1"
|
||||
},
|
||||
"ropm": {
|
||||
"rootDir": "./src"
|
||||
},
|
||||
"scripts": {
|
||||
"prebuild": "rm -rf build/playlet-app",
|
||||
"prebuild:dev": "npm run prebuild",
|
||||
@@ -22,7 +16,6 @@
|
||||
"format:fix": "npm run format:base -- --write",
|
||||
"test": "npm run test:build && npm run test:run",
|
||||
"test:build": "bsc --project bsconfig.tests.json --create-package --sourceMap=true --debug --test-mode --lintConfig ../config/bslint.jsonc",
|
||||
"test:run": "node ../tools/run-test-app.js --package ../build/playlet-app-tests.zip",
|
||||
"postinstall": "npx ropm copy"
|
||||
"test:run": "node ../tools/run-test-app.js --package ../build/playlet-app-tests.zip"
|
||||
}
|
||||
}
|
||||
@@ -6,12 +6,13 @@
|
||||
<field id="launchArgs" type="assocarray" />
|
||||
<field id="inputArgs" type="assocarray" alwaysNotify="true" />
|
||||
<field id="playletLibLoadedUrl" type="assocarray" />
|
||||
<field id="systemLogEvent" type="assocarray" />
|
||||
</interface>
|
||||
<script type="text/brightscript" uri="pkg:/source/Dialog.bs" />
|
||||
<script type="text/brightscript" uri="pkg:/source/Manifest.bs" />
|
||||
<script type="text/brightscript" uri="pkg:/source/Registry.bs" />
|
||||
<children>
|
||||
<Group id="MainSceneContainer"/>
|
||||
<Group id="MainSceneContainer" />
|
||||
<LoadingIndicator id="LoadingIndicator" />
|
||||
</children>
|
||||
</component>
|
||||
@@ -2,8 +2,8 @@ title=Playlet
|
||||
|
||||
# Do not update version manually, it is auto updated from package.json
|
||||
major_version=0
|
||||
minor_version=11
|
||||
build_version=00000
|
||||
minor_version=12
|
||||
build_version=00001
|
||||
|
||||
ui_resolutions=hd
|
||||
|
||||
@@ -23,6 +23,8 @@ splash_screen_sd=pkg:/images/splash-screen_sd.jpg
|
||||
splash_color=#242424
|
||||
splash_min_time=0
|
||||
|
||||
confirm_partner_button=1
|
||||
|
||||
supports_input_launch=1
|
||||
|
||||
playlet_lib_remote_url=https://github.com/iBicha/playlet/releases/latest/download/playlet-lib.zip
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
|
||||
function Main(args as object) as void
|
||||
screen = CreateObject("roSGScreen")
|
||||
m.port = CreateObject("roMessagePort")
|
||||
screen.setMessagePort(m.port)
|
||||
port = CreateObject("roMessagePort")
|
||||
screen.setMessagePort(port)
|
||||
m.global = screen.getGlobalNode()
|
||||
|
||||
ClearPlayletLibUrlsIfNeeded(args)
|
||||
@@ -25,7 +25,7 @@ function Main(args as object) as void
|
||||
scene = screen.CreateScene("BootstrapScene")
|
||||
screen.show()
|
||||
|
||||
scene.ObserveField("exitChannel", m.port)
|
||||
scene.ObserveField("exitChannel", port)
|
||||
scene.launchArgs = args
|
||||
|
||||
' These vars are needed to pass certification.
|
||||
@@ -42,7 +42,16 @@ function Main(args as object) as void
|
||||
end if
|
||||
|
||||
input = CreateObject("roInput")
|
||||
input.setMessagePort(m.port)
|
||||
input.setMessagePort(port)
|
||||
|
||||
' TODO:P1 follow up on bug where roSystemLog does not fire for a video player in ComponentLibrary
|
||||
' https://community.roku.com/t5/Roku-Developer-Program/BUG-roSystemLog-not-firing-with-ComponentLibrary/td-p/906075
|
||||
systemLog = CreateObject("roSystemLog")
|
||||
systemLog.SetMessagePort(port)
|
||||
systemLog.EnableType("http.connect")
|
||||
systemLog.EnableType("http.error")
|
||||
systemLog.EnableType("http.complete")
|
||||
systemLog.EnableType("bandwidth.minute")
|
||||
|
||||
#if DEBUG
|
||||
' The following comment is to enable the SceneGraph inspector
|
||||
@@ -54,9 +63,11 @@ function Main(args as object) as void
|
||||
#end if
|
||||
|
||||
while true
|
||||
msg = wait(0, m.port)
|
||||
msg = wait(0, port)
|
||||
msgType = type(msg)
|
||||
if msgType = "roSGScreenEvent"
|
||||
if msgType = "roSystemLogEvent"
|
||||
scene.systemLogEvent = msg.GetInfo()
|
||||
else if msgType = "roSGScreenEvent"
|
||||
if msg.isScreenClosed()
|
||||
return
|
||||
end if
|
||||
|
||||
@@ -1,47 +1,12 @@
|
||||
{
|
||||
"name": "playlet-lib",
|
||||
"version": "0.11.0",
|
||||
"version": "0.12.1",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "playlet-lib",
|
||||
"version": "0.11.0",
|
||||
"hasInstallScript": true,
|
||||
"dependencies": {
|
||||
"bslib": "npm:@rokucommunity/bslib@^0.1.1",
|
||||
"log": "npm:roku-log@^0.9.3"
|
||||
}
|
||||
},
|
||||
"node_modules/bslib": {
|
||||
"name": "@rokucommunity/bslib",
|
||||
"version": "0.1.1",
|
||||
"resolved": "https://registry.npmjs.org/@rokucommunity/bslib/-/bslib-0.1.1.tgz",
|
||||
"integrity": "sha512-2ox6EUL+UTtccTbD4dbVjZK3QHa0PHCqpoKMF8lZz9ayzzEP3iVPF8KZR6hOi6bxsIcbGXVjqmtCVkpC4P9SrA=="
|
||||
},
|
||||
"node_modules/log": {
|
||||
"name": "roku-log",
|
||||
"version": "0.9.3",
|
||||
"resolved": "https://registry.npmjs.org/roku-log/-/roku-log-0.9.3.tgz",
|
||||
"integrity": "sha512-YzvtSCdmZJeimyZZ/C5Y7tdw6vpNMrZV90pg8EPn3vLAtRjtxN3dOt73s48BVOx2W00M0BEGmeaECObS2RdIqg==",
|
||||
"dependencies": {
|
||||
"bslib": "npm:@rokucommunity/bslib@^0.1.1"
|
||||
}
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"bslib": {
|
||||
"version": "npm:@rokucommunity/bslib@0.1.1",
|
||||
"resolved": "https://registry.npmjs.org/@rokucommunity/bslib/-/bslib-0.1.1.tgz",
|
||||
"integrity": "sha512-2ox6EUL+UTtccTbD4dbVjZK3QHa0PHCqpoKMF8lZz9ayzzEP3iVPF8KZR6hOi6bxsIcbGXVjqmtCVkpC4P9SrA=="
|
||||
},
|
||||
"log": {
|
||||
"version": "npm:roku-log@0.9.3",
|
||||
"resolved": "https://registry.npmjs.org/roku-log/-/roku-log-0.9.3.tgz",
|
||||
"integrity": "sha512-YzvtSCdmZJeimyZZ/C5Y7tdw6vpNMrZV90pg8EPn3vLAtRjtxN3dOt73s48BVOx2W00M0BEGmeaECObS2RdIqg==",
|
||||
"requires": {
|
||||
"bslib": "npm:@rokucommunity/bslib@^0.1.1"
|
||||
}
|
||||
"version": "0.12.1"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,14 +1,7 @@
|
||||
{
|
||||
"name": "playlet-lib",
|
||||
"version": "0.11.0",
|
||||
"version": "0.12.1",
|
||||
"description": "Unofficial Youtube client for Roku",
|
||||
"dependencies": {
|
||||
"bslib": "npm:@rokucommunity/bslib@^0.1.1",
|
||||
"log": "npm:roku-log@^0.9.3"
|
||||
},
|
||||
"ropm": {
|
||||
"rootDir": "./src"
|
||||
},
|
||||
"scripts": {
|
||||
"prebuild": "rm -rf build/playlet-lib",
|
||||
"prebuild:dev": "npm run prebuild",
|
||||
@@ -25,7 +18,6 @@
|
||||
"format:fix": "npm run format:base -- --write",
|
||||
"test": "npm run test:build && npm run test:run",
|
||||
"test:build": "bsc --project bsconfig.tests.json --create-package --sourceMap=true --debug --test-mode --lintConfig ../config/bslint.jsonc",
|
||||
"test:run": "node ../tools/run-test-app.js --package ../build/playlet-lib-tests.zip",
|
||||
"postinstall": "npx ropm copy"
|
||||
"test:run": "node ../tools/run-test-app.js --package ../build/playlet-lib-tests.zip"
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@ import "pkg:/source/utils/Types.bs"
|
||||
import "pkg:/source/utils/StringUtils.bs"
|
||||
import "pkg:/source/utils/FocusManagement.bs"
|
||||
import "pkg:/components/Dialog/DialogUtils.bs"
|
||||
import "pkg:/source/roku_modules/log/LogMixin.brs"
|
||||
import "pkg:/source/utils/Logging.bs"
|
||||
import "pkg:/components/VideoPlayer/VideoUtils.bs"
|
||||
|
||||
function Init()
|
||||
@@ -10,8 +10,6 @@ function Init()
|
||||
end function
|
||||
|
||||
function OnNodeReady()
|
||||
m.log = new log.Logger("AppController")
|
||||
|
||||
NodeSetFocus(m.top.root, true)
|
||||
end function
|
||||
|
||||
@@ -97,7 +95,7 @@ end function
|
||||
function OnExitDialog(event as object)
|
||||
buttonIndex = event.GetData()
|
||||
if buttonIndex = 0 ' Exit
|
||||
m.log.info("Exiting app")
|
||||
LogInfo("Exiting app")
|
||||
m.top.getScene().exitChannel = true
|
||||
end if
|
||||
end function
|
||||
@@ -0,0 +1,8 @@
|
||||
namespace ChannelUtils
|
||||
function Open(contentNode as object)
|
||||
channelView = CreateObject("roSGNode", "ChannelView")
|
||||
m.appController@.PushScreen(channelView)
|
||||
channelView@.BindNode(invalid)
|
||||
channelView.content = contentNode
|
||||
end function
|
||||
end namespace
|
||||
@@ -0,0 +1,74 @@
|
||||
import "pkg:/source/utils/FocusManagement.bs"
|
||||
import "pkg:/source/utils/Types.bs"
|
||||
import "pkg:/source/utils/StringUtils.bs"
|
||||
|
||||
function Init()
|
||||
m.banner = m.top.findNode("banner")
|
||||
m.thumbnail = m.top.findNode("thumbnail")
|
||||
m.authorLabel = m.top.findNode("authorLabel")
|
||||
m.rowList = m.top.FindNode("rowList")
|
||||
|
||||
m.banner.ObserveField("loadStatus", FuncName(OnBannerLoadStatus))
|
||||
end function
|
||||
|
||||
function OnNodeready()
|
||||
m.rowList@.BindNode(invalid)
|
||||
end function
|
||||
|
||||
function OnFocusChange() as void
|
||||
if not m.top.focus
|
||||
return
|
||||
end if
|
||||
|
||||
NodeSetFocus(m.rowList, true)
|
||||
end function
|
||||
|
||||
function OnContentSet() as void
|
||||
content = m.top.content
|
||||
if content = invalid
|
||||
return
|
||||
end if
|
||||
|
||||
' NOTE: "_author" not "author". See PlaylistContentNode.xml for explanation.
|
||||
m.authorLabel.text = content._author
|
||||
' TODO:P1 handle case where there's no banner - a big portion of the screen is blank
|
||||
m.banner.uri = content.banner
|
||||
if StringUtils.IsNullOrEmpty(content.thumbnail)
|
||||
m.thumbnail.uri = ""
|
||||
else
|
||||
if m.thumbnail.uri <> content.thumbnail or m.thumbnail.loadStatus = "failed"
|
||||
m.thumbnail.loadingBitmapUri = m.thumbnail.uri
|
||||
m.thumbnail.uri = content.thumbnail
|
||||
end if
|
||||
end if
|
||||
|
||||
m.rowList.content = content
|
||||
|
||||
content@.LoadChannel(m.invidious)
|
||||
end function
|
||||
|
||||
function OnkeyEvent(key as string, press as boolean) as boolean
|
||||
if press = false
|
||||
return false
|
||||
end if
|
||||
|
||||
if key = "back"
|
||||
Close()
|
||||
return true
|
||||
end if
|
||||
return false
|
||||
end function
|
||||
|
||||
function Close()
|
||||
m.appController@.PopScreen(invalid)
|
||||
end function
|
||||
|
||||
function OnBannerLoadStatus() as void
|
||||
status = m.banner.loadStatus
|
||||
if status <> "ready"
|
||||
return
|
||||
end if
|
||||
|
||||
aspect = m.banner.bitmapWidth / m.banner.bitmapHeight
|
||||
m.banner.height = m.banner.width / aspect
|
||||
end function
|
||||
@@ -0,0 +1,54 @@
|
||||
<component name="ChannelView" extends="Group" includes="AutoBind,Focus">
|
||||
<interface>
|
||||
<field id="content" type="node" onChange="OnContentSet" />
|
||||
<field id="appController" type="node" bind="/AppController" />
|
||||
<field id="invidious" type="node" bind="/Invidious" />
|
||||
</interface>
|
||||
<children>
|
||||
<Rectangle
|
||||
width="1280"
|
||||
height="720"
|
||||
color="0x242424">
|
||||
</Rectangle>
|
||||
|
||||
<Poster
|
||||
id="banner"
|
||||
translation="[0,0]"
|
||||
width="1280" />
|
||||
|
||||
<Poster
|
||||
translation="[115,180]"
|
||||
width="104"
|
||||
height="104"
|
||||
uri="pkg:/images/circle-mask-500.png">
|
||||
|
||||
<CirclePoster
|
||||
id="thumbnail"
|
||||
width="100"
|
||||
height="100"
|
||||
translation="[2,2]" />
|
||||
</Poster>
|
||||
|
||||
<Label
|
||||
id="authorLabel"
|
||||
translation="[228,226]"
|
||||
font="font:MediumBoldSystemFont" />
|
||||
|
||||
<VideoRowList
|
||||
itemComponentName="RowCell"
|
||||
id="rowList"
|
||||
focusable="false"
|
||||
translation="[0,320]"
|
||||
numRows="1"
|
||||
rowitemSize="[[350,196]]"
|
||||
rowItemSpacing="[[25,0]]"
|
||||
itemSize="[1280,326]"
|
||||
itemSpacing="[0,65]"
|
||||
rowLabelOffset="[[115,20]]"
|
||||
focusXOffset="[115]"
|
||||
showRowLabel="[true]"
|
||||
rowFocusAnimationStyle="floatingfocus"
|
||||
variableWidthItems="true"
|
||||
focusBitmapUri="pkg:/images/focus_grid.9.png" />
|
||||
</children>
|
||||
</component>
|
||||
@@ -0,0 +1,24 @@
|
||||
function Init()
|
||||
m.top.poster = m.top.findNode("Poster")
|
||||
m.top.maskGroup = m.top.findNode("MaskGroup")
|
||||
end function
|
||||
|
||||
function UpdateMaskSize()
|
||||
width = m.top.poster.width
|
||||
height = m.top.poster.height
|
||||
|
||||
maskSize = [width * GetScaleFactor(), height * GetScaleFactor()]
|
||||
m.top.maskGroup.maskSize = maskSize
|
||||
end function
|
||||
|
||||
' MaskGroup component do not scale with with UI resolution
|
||||
function GetScaleFactor() as float
|
||||
if m.scaleFactor <> invalid
|
||||
return m.scaleFactor
|
||||
end if
|
||||
deviceInfo = CreateObject("roDeviceInfo")
|
||||
uiResolutionWidth = deviceInfo.GetUIResolution().width
|
||||
' divide by 1280 because we have ui_resolutions=hd in manifest
|
||||
m.scaleFactor = uiResolutionWidth / 1280
|
||||
return m.scaleFactor
|
||||
end function
|
||||
@@ -0,0 +1,23 @@
|
||||
<component name="CirclePoster" extends="Group">
|
||||
<interface>
|
||||
<field id="poster" type="node" />
|
||||
<field id="maskGroup" type="node" />
|
||||
|
||||
<field id="width" type="integer" alias="Poster.width" onChange="UpdateMaskSize" />
|
||||
<field id="height" type="integer" alias="Poster.height" onChange="UpdateMaskSize" />
|
||||
<field id="uri" type="uri" alias="Poster.uri" />
|
||||
<field id="loadingBitmapUri" type="uri" alias="Poster.loadingBitmapUri" />
|
||||
<field id="failedBitmapUri" type="uri" alias="Poster.failedBitmapUri" />
|
||||
<field id="loadStatus" type="string" alias="Poster.loadStatus" />
|
||||
|
||||
<field id="maskUri" type="uri" value="pkg:/images/circle-mask-500.png" alias="MaskGroup.maskuri" />
|
||||
</interface>
|
||||
<children>
|
||||
<MaskGroup
|
||||
id="MaskGroup"
|
||||
maskuri="pkg:/images/circle-mask-500.png">
|
||||
<Poster
|
||||
id="Poster" />
|
||||
</MaskGroup>
|
||||
</children>
|
||||
</component>
|
||||
@@ -0,0 +1,48 @@
|
||||
import "pkg:/source/asyncTask/asyncTask.bs"
|
||||
import "pkg:/components/ContentNode/ChannelContentTask.bs"
|
||||
import "pkg:/source/utils/ErrorUtils.bs"
|
||||
import "pkg:/components/Dialog/DialogUtils.bs"
|
||||
|
||||
function Init()
|
||||
m.top.latestVideos = m.top.findNode("latestVideos")
|
||||
end function
|
||||
|
||||
function LoadChannel(invidiousNode as object) as void
|
||||
if m.contentTask <> invalid
|
||||
m.contentTask.cancel = true
|
||||
end if
|
||||
|
||||
loadState = m.top.loadState
|
||||
if loadState = FeedLoadState.Loading or loadState = FeedLoadState.Loaded
|
||||
return
|
||||
end if
|
||||
|
||||
m.top.loadState = FeedLoadState.Loading
|
||||
m.contentTask = StartAsyncTask(ChannelContentTask, {
|
||||
content: m.top,
|
||||
invidious: invidiousNode
|
||||
}, OnChannelContentTaskResult)
|
||||
end function
|
||||
|
||||
function OnChannelContentTaskResult(output as object) as void
|
||||
m.contentTask = invalid
|
||||
|
||||
if output.cancelled
|
||||
return
|
||||
end if
|
||||
|
||||
if not output.success or not output.result.success
|
||||
' output.error for unhandled exception
|
||||
error = output.error
|
||||
if error = invalid
|
||||
' output.result.error for network errors
|
||||
error = output.result.error
|
||||
end if
|
||||
error = ErrorUtils.Format(error)
|
||||
LogError(error)
|
||||
playlistId = output.task.input.content.playlistId
|
||||
message = `Failed to load playlist ${playlistId}\n${error}`
|
||||
DialogUtils.ShowDialog(message, "Playlist load fail", true)
|
||||
return
|
||||
end if
|
||||
end function
|
||||
@@ -1,7 +1,28 @@
|
||||
<component name="ChannelContentNode" extends="ContentNode">
|
||||
<interface>
|
||||
<field id="type" type="string" value="channel" />
|
||||
<field id="loadState" type="string" />
|
||||
<function name="LoadChannel" />
|
||||
|
||||
<field id="HDItemWidth" type="float" value="200" />
|
||||
<!-- NOTE: "_author" not "author". See PlaylistContentNode.xml for explanation -->
|
||||
<field id="_author" type="string" />
|
||||
<field id="authorId" type="string" />
|
||||
<field id="description" type="string" />
|
||||
<field id="subCount" type="integer" />
|
||||
<field id="subCountText" type="string" />
|
||||
<field id="videoCount" type="integer" />
|
||||
<field id="videoCountText" type="string" />
|
||||
<field id="thumbnail" type="string" />
|
||||
<field id="banner" type="string" />
|
||||
|
||||
<field id="latestVideos" type="node" />
|
||||
|
||||
<field id="HDItemWidth" type="float" value="196" />
|
||||
</interface>
|
||||
|
||||
<children>
|
||||
<ContentNode id="latestVideos" title="Latest Videos">
|
||||
|
||||
</ContentNode>
|
||||
</children>
|
||||
</component>
|
||||
@@ -0,0 +1,40 @@
|
||||
import "pkg:/components/Services/Invidious/InvidiousService.bs"
|
||||
import "pkg:/components/Services/Invidious/InvidiousToContentNode.bs"
|
||||
|
||||
@asynctask
|
||||
function ChannelContentTask(input as object) as object
|
||||
contentNode = input.content
|
||||
invidiousNode = input.invidious
|
||||
|
||||
if m.top.cancel
|
||||
contentNode.loadState = FeedLoadState.None
|
||||
return invalid
|
||||
end if
|
||||
|
||||
service = new Invidious.InvidiousService(invidiousNode)
|
||||
response = service.GetChannel(contentNode.authorId, m.top.cancellation)
|
||||
|
||||
if m.top.cancel
|
||||
contentNode.loadState = FeedLoadState.None
|
||||
return invalid
|
||||
end if
|
||||
|
||||
metadata = response.Json()
|
||||
|
||||
if not response.IsSuccess() or metadata = invalid
|
||||
contentNode.loadState = FeedLoadState.Error
|
||||
return {
|
||||
success: false,
|
||||
error: response.ErrorMessage()
|
||||
}
|
||||
end if
|
||||
|
||||
instance = service.GetInstance()
|
||||
InvidiousContent.ToChannelContentNode(contentNode, metadata, instance)
|
||||
|
||||
contentNode.loadState = FeedLoadState.Loaded
|
||||
|
||||
return {
|
||||
success: true
|
||||
}
|
||||
end function
|
||||
@@ -29,5 +29,7 @@
|
||||
<field id="videoCountText" type="string" />
|
||||
<field id="viewCount" type="integer" />
|
||||
<field id="viewCountText" type="string" />
|
||||
<field id="updated" type="integer" />
|
||||
<field id="updatedText" type="string" />
|
||||
</interface>
|
||||
</component>
|
||||
@@ -14,13 +14,13 @@ end function
|
||||
|
||||
function LaunchArgumentsReceived() as void
|
||||
launchArgs = m.scene.launchArgs
|
||||
m.log.info("LaunchArgumentsReceived", launchArgs)
|
||||
LogInfo("LaunchArgumentsReceived", launchArgs)
|
||||
ProcessArguments(launchArgs)
|
||||
end function
|
||||
|
||||
function InputArgumentsReceived() as void
|
||||
inputArgs = m.scene.inputArgs
|
||||
m.log.info("InputArgumentsReceived", inputArgs)
|
||||
LogInfo("InputArgumentsReceived", inputArgs)
|
||||
ProcessArguments(inputArgs)
|
||||
end function
|
||||
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
import "pkg:/source/utils/Types.bs"
|
||||
|
||||
function Init()
|
||||
m.top.functionName = "LoggerLoop"
|
||||
|
||||
port = CreateObject("roMessagePort")
|
||||
|
||||
m.top.ObserveField("logLine", port)
|
||||
|
||||
scene = m.top.getScene()
|
||||
if scene.hasField("systemLogEvent")
|
||||
scene.ObserveFieldScoped("systemLogEvent", port)
|
||||
end if
|
||||
|
||||
m.port = port
|
||||
end function
|
||||
|
||||
function LoggerLoop()
|
||||
port = m.port
|
||||
|
||||
buffer = CreateObject("roByteArray")
|
||||
previousLogsFile = m.top.folder + "/" + m.top.filenamePrevious
|
||||
logsFile = m.top.folder + "/" + m.top.filename
|
||||
|
||||
CreateDirectory(m.top.folder)
|
||||
DeleteFile(previousLogsFile)
|
||||
MoveFile(logsFile, previousLogsFile)
|
||||
|
||||
while true
|
||||
msg = wait(0, port)
|
||||
msgType = type(msg)
|
||||
if msgType = "roSGNodeEvent"
|
||||
field = msg.getField()
|
||||
if field = "logLine"
|
||||
OnLineLog(msg, logsFile, buffer)
|
||||
else if field = "systemLogEvent"
|
||||
OnLineSysLog(msg, logsFile, buffer)
|
||||
end if
|
||||
end if
|
||||
end while
|
||||
end function
|
||||
|
||||
function OnLineLog(event as object, logsFile as string, buffer as object)
|
||||
line = event.getData()
|
||||
' bs:disable-next-line LINT3012
|
||||
print line
|
||||
|
||||
buffer.FromAsciiString(line + `\n`)
|
||||
buffer.AppendFile(logsFile)
|
||||
end function
|
||||
|
||||
function OnLineSysLog(event as object, logsFile as string, buffer as object) as void
|
||||
info = event.getData()
|
||||
if info.LogType <> "http.error"
|
||||
return
|
||||
end if
|
||||
line = `[SysLog] ${FormatJson(info)}`
|
||||
' bs:disable-next-line LINT3012
|
||||
print line
|
||||
|
||||
buffer.FromAsciiString(line + `\n`)
|
||||
buffer.AppendFile(logsFile)
|
||||
end function
|
||||
@@ -1,10 +1,10 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<component name='log_FileTransport' extends='Node'>
|
||||
<component name='Logger' extends='Task'>
|
||||
<interface>
|
||||
<field id='logLevel' type='int' value='2' />
|
||||
<field id='logLine' type='string' />
|
||||
<field id='folder' type='string' value='cachefs:/logs' />
|
||||
<field id='filename' type='string' value='app_logs.txt' />
|
||||
<field id='filenamePrevious' type='string' value='app_logs_previous.txt' />
|
||||
<function name='logItem' />
|
||||
</interface>
|
||||
<children />
|
||||
</component>
|
||||
@@ -1,19 +0,0 @@
|
||||
import "pkg:/source/asyncTask/asyncTask.bs"
|
||||
|
||||
function Init()
|
||||
m.buffer = CreateObject("roByteArray")
|
||||
|
||||
previousLogs = m.top.folder + "/" + m.top.filenamePrevious
|
||||
newLogs = m.top.folder + "/" + m.top.filename
|
||||
|
||||
CreateDirectory(m.top.folder)
|
||||
DeleteFile(previousLogs)
|
||||
MoveFile(newLogs, previousLogs)
|
||||
|
||||
m.logsPath = newLogs
|
||||
end function
|
||||
|
||||
function logItem(name as string, levelNum as integer, text as string) as void
|
||||
m.buffer.FromAsciiString(`[${name}] ${text}\n`)
|
||||
m.buffer.AppendFile(m.logsPath)
|
||||
end function
|
||||
@@ -4,8 +4,8 @@ import "pkg:/source/utils/Logging.bs"
|
||||
import "pkg:/components/EcpArgs.bs"
|
||||
|
||||
function Init()
|
||||
InitializeLogging()
|
||||
m.log = new log.Logger("MainScene")
|
||||
InitializeLogger()
|
||||
|
||||
m.scene = m.top.getScene()
|
||||
' At this point, the "MainScene" node is not yet added to the scene, and does not have a parent yet.
|
||||
' Let's wait until it has one.
|
||||
|
||||
@@ -5,9 +5,7 @@
|
||||
|
||||
function Init()
|
||||
InitializeBindings() ' auto-generated!
|
||||
InitializeLogging()
|
||||
m.log = log_Logger("MainScene")
|
||||
m.__le = m.log.enabled
|
||||
InitializeLogger()
|
||||
m.scene = m.top.getScene()
|
||||
' At this point, the "MainScene" node is not yet added to the scene, and does not have a parent yet.
|
||||
' Let's wait until it has one.
|
||||
|
||||
@@ -11,14 +11,13 @@
|
||||
<script type="text/brightscript" uri="pkg:/components/MainScene_bindings.brs" />
|
||||
<script type="text/brightscript" uri="pkg:/components/MainScene.brs" />
|
||||
<script type="text/brightscript" uri="pkg:/source/utils/Logging.brs" />
|
||||
<script type="text/brightscript" uri="pkg:/source/roku_modules/log/LogMixin.brs" />
|
||||
<script type="text/brightscript" uri="pkg:/source/utils/LoadingScreen.brs" />
|
||||
<script type="text/brightscript" uri="pkg:/components/EcpArgs.brs" />
|
||||
<script type="text/brightscript" uri="pkg:/source/utils/Types.brs" />
|
||||
<script type="text/brightscript" uri="pkg:/source/utils/StringUtils.brs" />
|
||||
<script type="text/brightscript" uri="pkg:/components/VideoPlayer/VideoUtils.brs" />
|
||||
<script type="text/brightscript" uri="pkg:/source/utils/FocusManagement.brs" />
|
||||
<script type="text/brightscript" uri="pkg:/source/roku_modules/bslib/bslib.brs" />
|
||||
<script type="text/brightscript" uri="pkg:/source/bslib.brs" />
|
||||
<children>
|
||||
<AppController id="AppController">
|
||||
<Group id="Stack">
|
||||
|
||||
@@ -61,9 +61,6 @@
|
||||
invidious="bind:../Invidious"
|
||||
preferences="bind:../Preferences"
|
||||
playQueue="bind:../PlayQueue" />
|
||||
|
||||
<!-- Inherits from WebServer
|
||||
<WebSocketServer id="WebSocketServer" webserver="ref:../WebServer" /> -->
|
||||
</AppController>
|
||||
</children>
|
||||
</component>
|
||||
@@ -3,13 +3,12 @@ import "pkg:/components/VideoPlayer/VideoUtils.bs"
|
||||
import "pkg:/source/asyncTask/asyncTask.bs"
|
||||
import "pkg:/components/VideoFeed/FeedLoadState.bs"
|
||||
import "pkg:/components/PlaylistView/PlaylistContentTask.bs"
|
||||
import "pkg:/source/roku_modules/log/LogMixin.brs"
|
||||
import "pkg:/source/utils/Logging.bs"
|
||||
import "pkg:/source/utils/ErrorUtils.bs"
|
||||
import "pkg:/components/Dialog/DialogUtils.bs"
|
||||
import "pkg:/source/utils/ArrayUtils.bs"
|
||||
|
||||
function Init()
|
||||
m.log = new log.Logger("PlayQueue")
|
||||
m.pendingLoadTasks = {}
|
||||
' TODO:P1 prevent adding duplicates of the same video/playlist
|
||||
m.queue = CreateObject("roArray", 0, true)
|
||||
@@ -163,7 +162,7 @@ function OnPlaylistContentTaskResult(output as object) as void
|
||||
error = output.result.error
|
||||
end if
|
||||
error = ErrorUtils.Format(error)
|
||||
m.log.error(error)
|
||||
LogError(error)
|
||||
playlistId = playlist.playlistId
|
||||
message = `Failed to load playlist ${playlistId}\n${error}`
|
||||
' TODO:P1 play next upon closing the dialog
|
||||
|
||||
@@ -2,21 +2,19 @@ import "pkg:/source/utils/FocusManagement.bs"
|
||||
import "pkg:/source/utils/Types.bs"
|
||||
import "pkg:/source/utils/StringUtils.bs"
|
||||
import "pkg:/components/VideoPlayer/VideoUtils.bs"
|
||||
import "pkg:/source/roku_modules/log/LogMixin.brs"
|
||||
import "pkg:/source/utils/Logging.bs"
|
||||
import "pkg:/source/asyncTask/asyncTask.bs"
|
||||
import "pkg:/components/PlaylistView/PlaylistContentTask.bs"
|
||||
import "pkg:/components/VideoFeed/FeedLoadState.bs"
|
||||
import "pkg:/source/utils/ErrorUtils.bs"
|
||||
import "pkg:/components/Dialog/DialogUtils.bs"
|
||||
|
||||
' TODO:P2 use already loaded thumbnail, and crossfade to highres version (using same Poster)
|
||||
function Init()
|
||||
m.log = new log.Logger("PlaylistView")
|
||||
|
||||
m.background = m.top.findNode("background")
|
||||
m.backgroundSmall = m.top.findNode("backgroundSmall")
|
||||
m.titleLabel = m.top.findNode("titleLabel")
|
||||
m.subtitleLabel = m.top.findNode("subtitleLabel")
|
||||
m.updatedLabel = m.top.findNode("updatedLabel")
|
||||
m.descriptionLabel = m.top.findNode("descriptionLabel")
|
||||
m.list = m.top.findNode("list")
|
||||
end function
|
||||
@@ -43,9 +41,11 @@ function OnContentSet() as void
|
||||
m.titleLabel.text = content.title
|
||||
' NOTE: "_author" not "author". See PlaylistContentNode.xml for explanation.
|
||||
m.subtitleLabel.text = `${content._author} • ${content.videoCountText} • ${content.viewCountText}`
|
||||
m.updatedLabel.text = content.updatedText
|
||||
m.descriptionLabel.text = content.description
|
||||
|
||||
' TODO:P2 cross fade
|
||||
' We use two Posters to cross fade from the low res thumbnail to the high res thumbnail.
|
||||
' We can't use a single Poster because we're using the blendColor. There's no loadingBitmapBlendColor.
|
||||
m.backgroundSmall.uri = content.thumbnail
|
||||
m.background.uri = content.thumbnailBackground
|
||||
|
||||
@@ -88,7 +88,7 @@ function OnItemSelected(event as object)
|
||||
video = playlist.getChild(index)
|
||||
videoId = video.videoId
|
||||
if not StringUtils.IsNullOrEmpty(videoId)
|
||||
m.log.info("Play playlist: " + playlistId + " video: " + videoId)
|
||||
LogInfo("Play playlist: " + playlistId + " video: " + videoId)
|
||||
m.playQueue@.Play(playlist, index)
|
||||
end if
|
||||
end function
|
||||
@@ -144,7 +144,7 @@ function OnPlaylistContentTaskResult(output as object) as void
|
||||
error = output.result.error
|
||||
end if
|
||||
error = ErrorUtils.Format(error)
|
||||
m.log.error(error)
|
||||
LogError(error)
|
||||
playlistId = output.task.input.content.playlistId
|
||||
message = `Failed to load playlist ${playlistId}\n${error}`
|
||||
DialogUtils.ShowDialog(message, "Playlist load fail", true)
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
height="720"
|
||||
blendColor="0x323232">
|
||||
<LayoutGroup
|
||||
itemSpacings="[5,20]"
|
||||
itemSpacings="[5,5,20]"
|
||||
translation="[65,90]">
|
||||
<Label
|
||||
id="titleLabel"
|
||||
@@ -35,6 +35,10 @@
|
||||
id="subtitleLabel"
|
||||
width="500"
|
||||
font="font:SmallestBoldSystemFont" />
|
||||
<Label
|
||||
id="updatedLabel"
|
||||
width="500"
|
||||
font="font:SmallestSystemFont" />
|
||||
<Label
|
||||
id="descriptionLabel"
|
||||
width="500"
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
focusXOffset="[115]"
|
||||
showRowLabel="[true]"
|
||||
rowFocusAnimationStyle="floatingfocus"
|
||||
variableWidthItems="true"
|
||||
focusBitmapUri="pkg:/images/focus_grid.9.png"
|
||||
/>
|
||||
</children>
|
||||
|
||||
@@ -0,0 +1,270 @@
|
||||
import "pkg:/components/Navigation/Navigation.bs"
|
||||
import "pkg:/source/utils/Types.bs"
|
||||
import "pkg:/source/utils/ArrayUtils.bs"
|
||||
|
||||
function Init()
|
||||
options = {
|
||||
date: [{
|
||||
title: "Any date",
|
||||
value: ""
|
||||
}, {
|
||||
title: "Last hour",
|
||||
value: "hour"
|
||||
}, {
|
||||
title: "Today",
|
||||
value: "today"
|
||||
}, {
|
||||
title: "This week",
|
||||
value: "week"
|
||||
}, {
|
||||
title: "This month",
|
||||
value: "month"
|
||||
}, {
|
||||
title: "This year",
|
||||
value: "year"
|
||||
}],
|
||||
type: [{
|
||||
title: "Any type",
|
||||
value: ""
|
||||
}, {
|
||||
title: "Video",
|
||||
value: "video"
|
||||
}, {
|
||||
title: "Playlist",
|
||||
value: "playlist"
|
||||
}, {
|
||||
title: "Channel",
|
||||
value: "channel"
|
||||
}, {
|
||||
title: "Movie",
|
||||
value: "movie"
|
||||
}, {
|
||||
title: "Show",
|
||||
value: "show"
|
||||
}],
|
||||
duration: [{
|
||||
title: "Any duration",
|
||||
value: ""
|
||||
}, {
|
||||
title: "Under 4 minutes",
|
||||
value: "short"
|
||||
}, {
|
||||
title: "4 - 20 minutes",
|
||||
value: "medium"
|
||||
}, {
|
||||
title: "Over 20 minutes",
|
||||
value: "long"
|
||||
}],
|
||||
features: [{
|
||||
title: "Live",
|
||||
value: "live"
|
||||
}, {
|
||||
title: "4K",
|
||||
value: "4k"
|
||||
}, {
|
||||
title: "HD",
|
||||
value: "hd"
|
||||
}, {
|
||||
title: "Subtitles/CC",
|
||||
value: "subtitles"
|
||||
}, {
|
||||
title: "Creative Commons",
|
||||
value: "creative_commons"
|
||||
}, {
|
||||
title: "360°",
|
||||
value: "360"
|
||||
}, {
|
||||
title: "VR180",
|
||||
value: "vr180"
|
||||
}, {
|
||||
title: "3D",
|
||||
value: "3d"
|
||||
}, {
|
||||
title: "HDR",
|
||||
value: "hdr"
|
||||
}, {
|
||||
title: "Purchased",
|
||||
value: "purchased"
|
||||
}, {
|
||||
title: "Location",
|
||||
value: "location"
|
||||
}],
|
||||
sort_by: [{
|
||||
title: "Relevance",
|
||||
value: ""
|
||||
}, {
|
||||
title: "Upload date",
|
||||
value: "upload_date"
|
||||
}, {
|
||||
title: "View count",
|
||||
value: "view_count"
|
||||
}, {
|
||||
title: "Rating",
|
||||
value: "rating"
|
||||
}]
|
||||
}
|
||||
|
||||
m.controls = {
|
||||
date: m.top.findNode("UploadDateList"),
|
||||
type: m.top.findNode("TypeList"),
|
||||
duration: m.top.findNode("DurationList"),
|
||||
features: m.top.findNode("FeaturesList"),
|
||||
sort_by: m.top.findNode("SortByList")
|
||||
}
|
||||
|
||||
for each filterKey in m.controls
|
||||
control = m.controls[filterKey]
|
||||
control.addFields({ filterKey: filterKey })
|
||||
end for
|
||||
|
||||
m.contentNodes = {
|
||||
date: m.controls.date.content,
|
||||
type: m.controls.type.content,
|
||||
duration: m.controls.duration.content,
|
||||
features: m.controls.features.content,
|
||||
sort_by: m.controls.sort_by.content
|
||||
}
|
||||
|
||||
PopulateLists(m.contentNodes, options)
|
||||
|
||||
navigationNodes = [m.controls.date, m.controls.type, m.controls.duration, m.controls.features, m.controls.sort_by]
|
||||
for i = 0 to navigationNodes.count() - 2
|
||||
SetNavigation(navigationNodes[i], "right", navigationNodes[i + 1])
|
||||
end for
|
||||
for i = 1 to navigationNodes.count() - 1
|
||||
SetNavigation(navigationNodes[i], "left", navigationNodes[i - 1])
|
||||
end for
|
||||
end function
|
||||
|
||||
function PopulateLists(contentNodes as object, options as object)
|
||||
for each key in options
|
||||
contentNode = contentNodes[key]
|
||||
list = options[key]
|
||||
for each item in list
|
||||
node = CreateObject("roSGNode", "ContentNode")
|
||||
node.title = item.title
|
||||
node.addFields({ value: item.value })
|
||||
contentNode.appendChild(node)
|
||||
end for
|
||||
end for
|
||||
end function
|
||||
|
||||
function OnNodeReady()
|
||||
RefreshUI()
|
||||
|
||||
m.controls.date.ObserveField("checkedItem", FuncName(OnListChecked))
|
||||
m.controls.type.ObserveField("checkedItem", FuncName(OnListChecked))
|
||||
m.controls.duration.ObserveField("checkedItem", FuncName(OnListChecked))
|
||||
m.controls.features.ObserveField("checkedState", FuncName(OnListChecked))
|
||||
m.controls.sort_by.ObserveField("checkedItem", FuncName(OnListChecked))
|
||||
end function
|
||||
|
||||
function RefreshUI()
|
||||
filters = m.searchScreen.filters
|
||||
for each key in filters
|
||||
control = m.controls[key]
|
||||
value = filters[key]
|
||||
if IsString(value)
|
||||
SetCheckedItem(control, value)
|
||||
else if IsArray(value)
|
||||
SetCheckedItemArray(control, value)
|
||||
end if
|
||||
end for
|
||||
end function
|
||||
|
||||
function SetCheckedItem(control as object, value as string) as void
|
||||
content = control.content
|
||||
childCount = content.getChildCount()
|
||||
for i = 0 to childCount - 1
|
||||
child = content.getChild(i)
|
||||
if child.value = value
|
||||
control.checkedItem = i
|
||||
return
|
||||
end if
|
||||
end for
|
||||
end function
|
||||
|
||||
function SetCheckedItemArray(control as object, values as object) as void
|
||||
content = control.content
|
||||
childCount = content.getChildCount()
|
||||
checkedState = []
|
||||
for i = 0 to childCount - 1
|
||||
child = content.getChild(i)
|
||||
value = child.value
|
||||
checkedState.push(ArrayUtils.IndexOfString(values, value) >= 0)
|
||||
end for
|
||||
control.checkedState = checkedState
|
||||
end function
|
||||
|
||||
function OnFocusChange() as void
|
||||
if not m.top.focus
|
||||
return
|
||||
end if
|
||||
|
||||
NodeSetFocus(m.controls.date, true)
|
||||
end function
|
||||
|
||||
function OnListChecked(event as object)
|
||||
control = event.getRoSGNode()
|
||||
filterKey = control.filterKey
|
||||
|
||||
state = m.searchScreen.filters
|
||||
if IsString(state[filterKey])
|
||||
SetFilterString(control)
|
||||
else if IsArray(state[filterKey])
|
||||
SetFilterArray(control)
|
||||
end if
|
||||
end function
|
||||
|
||||
function SetFilterString(control as object) as void
|
||||
content = control.content
|
||||
selectedNode = content.getChild(control.checkedItem)
|
||||
value = selectedNode.value
|
||||
|
||||
filterKey = control.filterKey
|
||||
state = m.searchScreen.filters
|
||||
state[filterKey] = value
|
||||
m.searchScreen.filters = state
|
||||
end function
|
||||
|
||||
function SetFilterArray(control as object) as void
|
||||
content = control.content
|
||||
checkedState = control.checkedState
|
||||
|
||||
values = []
|
||||
for i = 0 to checkedState.count() - 1
|
||||
if checkedState[i]
|
||||
node = content.getChild(i)
|
||||
values.push(node.value)
|
||||
end if
|
||||
end for
|
||||
|
||||
filterKey = control.filterKey
|
||||
state = m.searchScreen.filters
|
||||
state[filterKey] = values
|
||||
m.searchScreen.filters = state
|
||||
end function
|
||||
|
||||
function OnkeyEvent(key as string, press as boolean) as boolean
|
||||
navigation = NavigationKeyHandler(key, press)
|
||||
if navigation.handled
|
||||
m.currentNavigtionNode = navigation.node
|
||||
return true
|
||||
end if
|
||||
|
||||
if key = "options" and press
|
||||
' A pass-through to the app controller, so it can toggle picture-in-picture
|
||||
return false
|
||||
end if
|
||||
|
||||
if key = "back" and press
|
||||
Close()
|
||||
return true
|
||||
end if
|
||||
|
||||
return true
|
||||
end function
|
||||
|
||||
function Close()
|
||||
m.appController@.PopScreen(invalid)
|
||||
end function
|
||||
@@ -0,0 +1,124 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<component name="SearchFilters" extends="Group" includes="AutoBind,Focus">
|
||||
<interface>
|
||||
<field id="searchScreen" type="node" />
|
||||
<field id="appController" type="node" bind="/AppController" />
|
||||
</interface>
|
||||
<children>
|
||||
<Rectangle
|
||||
width="1280"
|
||||
height="720"
|
||||
color="#000000"
|
||||
opacity="0.5">
|
||||
</Rectangle>
|
||||
<Font id="HeaderFont" uri="font:BoldSystemFontFile" size="18" />
|
||||
<Font id="ItemFont" uri="font:SystemFontFile" size="18" />
|
||||
<Font id="ItemFocusedFont" uri="font:BoldSystemFontFile" size="18" />
|
||||
<Rectangle
|
||||
width="1116"
|
||||
height="543"
|
||||
translation="[82,84]"
|
||||
color="#242424">
|
||||
|
||||
<LayoutGroup
|
||||
layoutDirection="horiz"
|
||||
translation="[35,20]">
|
||||
<LayoutGroup horizAlignment="center" itemSpacings="[10,10]">
|
||||
<Label
|
||||
text="Upload date"
|
||||
font="dictionary:HeaderFont"
|
||||
horizAlign="center"
|
||||
width="188" />
|
||||
<Rectangle
|
||||
width="170"
|
||||
height="1" />
|
||||
<RadioButtonList
|
||||
id="UploadDateList"
|
||||
vertFocusAnimationStyle="floatingFocus"
|
||||
font="dictionary:ItemFont"
|
||||
focusedFont="dictionary:ItemFocusedFont"
|
||||
itemSize="[140,42]">
|
||||
<ContentNode role="content" />
|
||||
</RadioButtonList>
|
||||
</LayoutGroup>
|
||||
|
||||
<LayoutGroup horizAlignment="center" itemSpacings="[10,10]">
|
||||
<Label
|
||||
text="Type"
|
||||
font="dictionary:HeaderFont"
|
||||
horizAlign="center"
|
||||
width="168" />
|
||||
<Rectangle
|
||||
width="150"
|
||||
height="1" />
|
||||
<RadioButtonList
|
||||
id="TypeList"
|
||||
vertFocusAnimationStyle="floatingFocus"
|
||||
font="dictionary:ItemFont"
|
||||
focusedFont="dictionary:ItemFocusedFont"
|
||||
itemSize="[120,42]">
|
||||
<ContentNode role="content" />
|
||||
</RadioButtonList>
|
||||
</LayoutGroup>
|
||||
|
||||
<LayoutGroup horizAlignment="center" itemSpacings="[10,10]">
|
||||
<Label
|
||||
text="Duration"
|
||||
font="dictionary:HeaderFont"
|
||||
horizAlign="center"
|
||||
width="238" />
|
||||
<Rectangle
|
||||
width="220"
|
||||
height="1" />
|
||||
<RadioButtonList
|
||||
id="DurationList"
|
||||
vertFocusAnimationStyle="floatingFocus"
|
||||
font="dictionary:ItemFont"
|
||||
focusedFont="dictionary:ItemFocusedFont"
|
||||
itemSize="[190,42]">
|
||||
<ContentNode role="content" />
|
||||
</RadioButtonList>
|
||||
</LayoutGroup>
|
||||
|
||||
<LayoutGroup horizAlignment="center" itemSpacings="[10,10]">
|
||||
<Label
|
||||
text="Features"
|
||||
font="dictionary:HeaderFont"
|
||||
horizAlign="center"
|
||||
width="258" />
|
||||
<Rectangle
|
||||
width="240"
|
||||
height="1" />
|
||||
<CheckList
|
||||
id="FeaturesList"
|
||||
vertFocusAnimationStyle="floatingFocus"
|
||||
font="dictionary:ItemFont"
|
||||
focusedFont="dictionary:ItemFocusedFont"
|
||||
itemSize="[210,42]">
|
||||
<ContentNode role="content" />
|
||||
</CheckList>
|
||||
</LayoutGroup>
|
||||
|
||||
<LayoutGroup horizAlignment="center" itemSpacings="[10,10]">
|
||||
<Label
|
||||
text="Sort by"
|
||||
font="dictionary:HeaderFont"
|
||||
horizAlign="center"
|
||||
width="198" />
|
||||
<Rectangle
|
||||
width="180"
|
||||
height="1" />
|
||||
<RadioButtonList
|
||||
id="SortByList"
|
||||
vertFocusAnimationStyle="floatingFocus"
|
||||
font="dictionary:ItemFont"
|
||||
focusedFont="dictionary:ItemFocusedFont"
|
||||
itemSize="[150,42]">
|
||||
<ContentNode role="content" />
|
||||
</RadioButtonList>
|
||||
</LayoutGroup>
|
||||
</LayoutGroup>
|
||||
</Rectangle>
|
||||
</children>
|
||||
</component>
|
||||
@@ -4,7 +4,7 @@ import "pkg:/source/asyncTask/asyncTask.bs"
|
||||
import "pkg:/source/services/SearchHistory.bs"
|
||||
import "pkg:/source/utils/LoadingScreen.bs"
|
||||
import "pkg:/source/utils/FocusManagement.bs"
|
||||
import "pkg:/source/roku_modules/log/LogMixin.brs"
|
||||
import "pkg:/source/utils/Logging.bs"
|
||||
import "pkg:/source/utils/ErrorUtils.bs"
|
||||
|
||||
function Init()
|
||||
@@ -14,15 +14,30 @@ function Init()
|
||||
m.scrollAnimation = m.top.FindNode("scrollAnimation")
|
||||
m.scrollAnimationInterpolator = m.top.FindNode("scrollAnimationInterpolator")
|
||||
m.suggestions = m.top.FindNode("suggestions")
|
||||
m.filtersButton = m.top.FindNode("filtersButton")
|
||||
|
||||
textEditBox = m.keyboard.textEditBox
|
||||
textEditBox.voiceEntryType = "generic"
|
||||
textEditBox.voiceEnabled = true
|
||||
|
||||
m.top.filters = {
|
||||
date: "",
|
||||
type: "",
|
||||
duration: "",
|
||||
features: [],
|
||||
sort_by: ""
|
||||
}
|
||||
|
||||
m.top.ObserveField("filters", FuncName(OnFiltersChange))
|
||||
end function
|
||||
|
||||
function OnNodeReady()
|
||||
m.log = new log.Logger("SearchScreen")
|
||||
|
||||
m.rowlist@.BindNode(invalid)
|
||||
m.keyboard.ObserveField("text", FuncName(OnTextChange))
|
||||
m.suggestions.ObserveField("buttonFocused", FuncName(OnSearchButtonFocused))
|
||||
m.suggestions.ObserveField("buttonSelected", FuncName(OnSearchButtonSelected))
|
||||
m.filtersButton.ObserveField("buttonSelected", FuncName(OnFiltersButtonSelected))
|
||||
|
||||
m.top.ObserveField("visible", FuncName(OnVisibilityChange))
|
||||
m.rowlist.ObserveFieldScoped("onError", FuncName(OnSearchError))
|
||||
|
||||
@@ -30,12 +45,17 @@ function OnNodeReady()
|
||||
ScrollUp()
|
||||
end function)
|
||||
SetNavigation(m.suggestions, "right", m.keyboard)
|
||||
SetNavigation(m.filtersButton, "right", m.keyboard)
|
||||
SetNavigation(m.keyboard, "left", m.suggestions)
|
||||
SetNavigation(m.suggestions, "left", m.navBar)
|
||||
SetNavigation(m.filtersButton, "left", m.navBar)
|
||||
SetNavigation(m.keyboard, "left", m.navBar)
|
||||
SetNavigation(m.rowList, "left", m.navBar, function()
|
||||
ScrollUp()
|
||||
end function)
|
||||
SetNavigation(m.filtersButton, "down", m.suggestions)
|
||||
SetNavigation(m.filtersButton, "down", m.keyboard)
|
||||
|
||||
SetNavigation(invalid, "down", m.rowList, function()
|
||||
ScrollDown()
|
||||
end function)
|
||||
@@ -43,6 +63,9 @@ function OnNodeReady()
|
||||
ScrollUp()
|
||||
end function)
|
||||
|
||||
SetNavigation(m.suggestions, "up", m.filtersButton)
|
||||
SetNavigation(m.keyboard, "up", m.filtersButton)
|
||||
|
||||
m.currentNavigtionNode = m.suggestions
|
||||
' Trigger suggestions
|
||||
OnTextChange()
|
||||
@@ -87,7 +110,7 @@ function OnSearchSuggestionsTaskResults(output as object) as void
|
||||
end if
|
||||
|
||||
if not output.success
|
||||
m.log.error(ErrorUtils.Format(output.error))
|
||||
LogError(ErrorUtils.Format(output.error))
|
||||
return
|
||||
end if
|
||||
' In case this is an old request, discard suggestions
|
||||
@@ -119,6 +142,13 @@ function OnSearchSuggestionsTaskResults(output as object) as void
|
||||
m.suggestions.focusable = m.suggestions.buttons.Count() > 0
|
||||
end function
|
||||
|
||||
function OnFiltersButtonSelected()
|
||||
searchFilters = CreateObject("roSGNode", "SearchFilters")
|
||||
m.appController@.PushScreen(searchFilters)
|
||||
searchFilters.searchScreen = m.top
|
||||
searchFilters@.BindNode(invalid)
|
||||
end function
|
||||
|
||||
function OnSearchButtonSelected()
|
||||
selected = m.suggestions.buttonSelected
|
||||
text = m.suggestions.buttons[selected]
|
||||
@@ -145,19 +175,56 @@ function OnSearchButtonFocused() as void
|
||||
m.keyboard.text = text
|
||||
end function
|
||||
|
||||
function OnFiltersChange()
|
||||
filterCount = 0
|
||||
filters = m.top.filters
|
||||
for each filter in filters
|
||||
value = filters[filter]
|
||||
if IsString(value) and value.len() > 0
|
||||
filterCount++
|
||||
else if IsArray(value) and value.Count() > 0
|
||||
filterCount += value.Count()
|
||||
end if
|
||||
end for
|
||||
if filterCount > 0
|
||||
m.filtersButton.text = `Filters (${filterCount})`
|
||||
else
|
||||
m.filtersButton.text = "Filters"
|
||||
end if
|
||||
end function
|
||||
|
||||
function Search(text as string)
|
||||
m.rowlist.UnobserveFieldScoped("someContentReady")
|
||||
' TODO:P1 someContentReady only fires if there are search results.
|
||||
' The case where search results are empty is not handled.
|
||||
m.rowlist.ObserveFieldScoped("someContentReady", FuncName(OnSearchContentReady))
|
||||
ShowLoadingScreen()
|
||||
|
||||
m.rowList.contentData = [{
|
||||
requestData = {
|
||||
title: `Search - ${text}`,
|
||||
apiType: "Invidious",
|
||||
endpoint: "search",
|
||||
queryParams: {
|
||||
q: text
|
||||
}
|
||||
}]
|
||||
}
|
||||
|
||||
filters = m.top.filters
|
||||
for each filter in filters
|
||||
value = filters[filter]
|
||||
if IsString(value) and value.len() > 0
|
||||
requestData.queryParams[filter] = value
|
||||
else if IsArray(value) and value.Count() > 0
|
||||
' TODO:P1 this is http client implementation details leaking
|
||||
' We need a declarative way to set array types
|
||||
requestData.queryParams[filter] = {
|
||||
value: value,
|
||||
__arrayType: HttpClient.QueryParamArrayType.CommaSeparated
|
||||
}
|
||||
end if
|
||||
end for
|
||||
|
||||
m.rowList.contentData = [requestData]
|
||||
end function
|
||||
|
||||
function OnSearchContentReady() as void
|
||||
|
||||
@@ -4,10 +4,23 @@
|
||||
<interface>
|
||||
<field id="navBar" type="node" bind="/NavBar" />
|
||||
<field id="invidious" type="node" bind="/Invidious" />
|
||||
<field id="appController" type="node" bind="/AppController" />
|
||||
<field id="filters" type="assocarray" />
|
||||
</interface>
|
||||
<children>
|
||||
<Group id="container">
|
||||
<MiniKeyboard
|
||||
<Button
|
||||
id="filtersButton"
|
||||
translation="[160,40]"
|
||||
minWidth="0"
|
||||
height="48"
|
||||
showFocusFootprint="true"
|
||||
iconUri="pkg:/images/icons/filters-white.png"
|
||||
focusedIconUri="pkg:/images/icons/filters-black.png"
|
||||
text="Filters">
|
||||
</Button>
|
||||
|
||||
<DynamicMiniKeyboard
|
||||
id="keyboard"
|
||||
translation="[730,110]"
|
||||
/>
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
import "pkg:/source/asyncTask/asyncTask.bs"
|
||||
import "pkg:/components/Screens/SettingsScreen/InvidiousInstance/InvidiousPublicInstances/InvidiousPublicInstancesTask.bs"
|
||||
import "pkg:/source/utils/FocusManagement.bs"
|
||||
import "pkg:/source/roku_modules/log/LogMixin.brs"
|
||||
import "pkg:/source/utils/Logging.bs"
|
||||
import "pkg:/source/utils/ErrorUtils.bs"
|
||||
import "pkg:/components/Dialog/DialogUtils.bs"
|
||||
|
||||
function Init()
|
||||
m.log = new log.Logger("InvidiousPublicInstances")
|
||||
|
||||
m.failedLabel = m.top.findNode("failedLabel")
|
||||
m.refreshButton = m.top.findNode("refreshButton")
|
||||
m.instances = m.top.findNode("instances")
|
||||
@@ -71,7 +69,7 @@ function OnInvidiousPublicInstancesTaskResults(output as object) as void
|
||||
error = output.result.error
|
||||
end if
|
||||
error = ErrorUtils.Format(error)
|
||||
m.log.error(output.error)
|
||||
LogError(output.error)
|
||||
|
||||
message = `Failed to load Invidious public instances\n${error}`
|
||||
DialogUtils.ShowDialog(message, "Invidious public instances load error", true)
|
||||
|
||||
@@ -3,7 +3,7 @@ import "pkg:/source/utils/StringUtils.bs"
|
||||
import "pkg:/source/utils/TimeUtils.bs"
|
||||
import "pkg:/source/utils/CryptoUtils.bs"
|
||||
import "pkg:/source/services/HttpClient.bs"
|
||||
import "pkg:/source/roku_modules/log/LogMixin.brs"
|
||||
import "pkg:/source/utils/Logging.bs"
|
||||
|
||||
namespace Invidious
|
||||
const INSTANCES_API = "https://api.invidious.io/instances.json?sort_by=type,users"
|
||||
@@ -16,6 +16,7 @@ namespace Invidious
|
||||
|
||||
const VIDEOS_ENDPOINT = "/api/v1/videos"
|
||||
const PLAYLISTS_ENDPOINT = "/api/v1/playlists"
|
||||
const CHANNELS_ENDPOINT = "/api/v1/channels"
|
||||
const HISTORY_ENDPOINT = "/api/v1/auth/history"
|
||||
|
||||
const SEARCH_SUGGEST_ENDPOINT = "/api/v1/search/suggestions"
|
||||
@@ -33,8 +34,6 @@ namespace Invidious
|
||||
public node as object
|
||||
|
||||
function new(node as object)
|
||||
m.log = new log.Logger("InvidiousService")
|
||||
|
||||
m.node = node
|
||||
' TODO:P2 api definitions are not needed everytime, move them to a separate function and lazy load
|
||||
apiDefinitions = node.apiDefinitions
|
||||
@@ -136,6 +135,17 @@ namespace Invidious
|
||||
return request.Await()
|
||||
end function
|
||||
|
||||
function GetChannel(authorId as string, cancellation = invalid as object) as object
|
||||
instance = m.GetInstance()
|
||||
url = `${instance}${Invidious.CHANNELS_ENDPOINT}/${authorId}`
|
||||
|
||||
request = HttpClient.Get(url)
|
||||
request.QueryParams(m.DefaultQueryParams())
|
||||
request.Cancellation(cancellation)
|
||||
|
||||
return request.Await()
|
||||
end function
|
||||
|
||||
function GetVideoStreamUrl(videoId as string) as string
|
||||
instance = m.GetInstance()
|
||||
return `${instance}/latest_version?id=${videoId}`
|
||||
@@ -278,8 +288,8 @@ namespace Invidious
|
||||
|
||||
function DeleteExpiredToken(response as object)
|
||||
if response.StatusCode() = 403
|
||||
m.log.warn(`Invidious instance responded with 403: ${response.Text()}`)
|
||||
m.log.warn("Deleting Invidious token...")
|
||||
LogWarn(`Invidious instance responded with 403: ${response.Text()}`)
|
||||
LogWarn("Deleting Invidious token...")
|
||||
m.DeleteAuthToken()
|
||||
end if
|
||||
end function
|
||||
|
||||
@@ -21,8 +21,7 @@ namespace InvidiousContent
|
||||
else if item.type = "playlist"
|
||||
return ToPlaylistContentNode(invalid, item, instance)
|
||||
else if item.type = "channel"
|
||||
return invalid
|
||||
' return ToChannelContentNode(item, instance)
|
||||
return ToChannelContentNode(invalid, item, instance)
|
||||
else
|
||||
return invalid
|
||||
end if
|
||||
@@ -67,9 +66,11 @@ namespace InvidiousContent
|
||||
SetIfExists(node, "playlistId", item, "playlistId")
|
||||
SetIfExists(node, "title", item, "title")
|
||||
SetIfExists(node, "videoCount", item, "videoCount")
|
||||
node.videoCountText = PlaylistGetVideoCountText(item)
|
||||
node.videoCountText = GetVideoCountText(item)
|
||||
SetIfExists(node, "viewCount", item, "viewCount")
|
||||
node.viewCountText = PlaylistGetViewCountText(item)
|
||||
SetIfExists(node, "updated", item, "updated")
|
||||
node.updatedText = PlaylistGetUpdatedText(item)
|
||||
|
||||
if item.videos <> invalid
|
||||
childCount = node.getChildCount()
|
||||
@@ -97,10 +98,40 @@ namespace InvidiousContent
|
||||
return node
|
||||
end function
|
||||
|
||||
function ToChannelContentNode(item as object, instance as dynamic) as object
|
||||
node = CreateObject("roSGNode", "ChannelContentNode")
|
||||
function ToChannelContentNode(node as object, item as object, instance as dynamic) as object
|
||||
if node = invalid
|
||||
node = CreateObject("roSGNode", "ChannelContentNode")
|
||||
node.loadState = FeedLoadState.None
|
||||
end if
|
||||
node.type = "channel"
|
||||
|
||||
' NOTE: "_author" not "author". See PlaylistContentNode.xml for explanation.
|
||||
SetIfExists(node, "_author", item, "author")
|
||||
SetIfExists(node, "authorId", item, "authorId")
|
||||
SetIfExists(node, "description", item, "description")
|
||||
SetIfExists(node, "subCount", item, "subCount")
|
||||
node.subCountText = GetChannelSubCountText(item)
|
||||
SetIfExists(node, "videoCount", item, "videoCount")
|
||||
node.videoCountText = GetVideoCountText(item)
|
||||
node.thumbnail = GetChannelThumbnail(item.authorThumbnails)
|
||||
node.banner = GetChannelBanner(item.authorBanners)
|
||||
|
||||
if item.latestVideos <> invalid
|
||||
newNodes = []
|
||||
|
||||
for each video in item.latestVideos
|
||||
video.type = "video"
|
||||
videoNode = ToVideoContentNode(invalid, video, instance)
|
||||
if videoNode <> invalid
|
||||
newNodes.push(videoNode)
|
||||
end if
|
||||
end for
|
||||
|
||||
if newNodes.Count() > 0
|
||||
node.latestVideos.appendChildren(newNodes)
|
||||
end if
|
||||
end if
|
||||
|
||||
return node
|
||||
end function
|
||||
|
||||
@@ -199,13 +230,74 @@ namespace InvidiousContent
|
||||
node[nodeField] = thumbnail
|
||||
end function
|
||||
|
||||
function PlaylistGetVideoCountText(playlistItem as object) as string
|
||||
videoCount = ValidInt(playlistItem.videoCount)
|
||||
function GetChannelThumbnail(authorThumbnails as object) as string
|
||||
if authorThumbnails = invalid or authorThumbnails.Count() = 0
|
||||
return ""
|
||||
end if
|
||||
url = authorThumbnails[authorThumbnails.Count() - 1].url
|
||||
if url.startsWith("//")
|
||||
url = "https:" + url
|
||||
end if
|
||||
return url
|
||||
end function
|
||||
|
||||
function GetChannelBanner(authorBanners as object) as string
|
||||
if authorBanners = invalid or authorBanners.Count() = 0
|
||||
return ""
|
||||
end if
|
||||
return authorBanners[authorBanners.Count() - 1].url
|
||||
end function
|
||||
|
||||
function GetVideoCountText(item as object) as string
|
||||
videoCount = ValidInt(item.videoCount)
|
||||
return videoCount = 1 ? "1 video" : `${videoCount} videos`
|
||||
end function
|
||||
|
||||
function GetChannelSubCountText(channel as object) as string
|
||||
subCount = ValidInt(channel.subCount)
|
||||
return subCount = 1 ? "1 subscriber" : `${subCount} subscribers`
|
||||
end function
|
||||
|
||||
function PlaylistGetViewCountText(playlistItem as object) as string
|
||||
return VideoGetViewCountText(playlistItem)
|
||||
end function
|
||||
|
||||
function PlaylistGetUpdatedText(playlistItem as object) as string
|
||||
updated = playlistItem.updated
|
||||
if not IsInt(updated)
|
||||
return ""
|
||||
end if
|
||||
span = TimeUtils.Now().AsSeconds() - updated
|
||||
if span < 1
|
||||
return ""
|
||||
end if
|
||||
|
||||
count = ""
|
||||
total_days = span \ 86400
|
||||
if total_days > 365
|
||||
years = total_days \ 365
|
||||
count = years > 1 ? `${years} years` : "1 year"
|
||||
else if total_days > 30
|
||||
months = total_days \ 30
|
||||
count = months > 1 ? `${months} months` : "1 month"
|
||||
else if total_days > 7
|
||||
weeks = total_days \ 7
|
||||
count = weeks > 1 ? `${weeks} weeks` : "1 week"
|
||||
else if total_days > 1
|
||||
count = `${total_days} days`
|
||||
else if span > 3600
|
||||
hours = span \ 3600
|
||||
count = hours > 1 ? `${hours} hours` : "1 hour"
|
||||
else if span > 60
|
||||
minutes = span \ 60
|
||||
count = minutes > 1 ? `${minutes} minutes` : "1 minute"
|
||||
else
|
||||
count = span > 1 ? `${span} seconds` : "1 second"
|
||||
end if
|
||||
|
||||
if StringUtils.IsNullOrEmpty(count)
|
||||
return ""
|
||||
end if
|
||||
return `Updated ${count} ago`
|
||||
end function
|
||||
end namespace
|
||||
@@ -13,44 +13,9 @@ function OnContentSet() as void
|
||||
return
|
||||
end if
|
||||
|
||||
m.authorLabel.text = content.author
|
||||
SetSubCount(content.subCount)
|
||||
|
||||
m.thumbnail.uri = GetThumbnailUrl(content.authorThumbnails)
|
||||
|
||||
SetVideoCount(content.videoCount)
|
||||
end function
|
||||
|
||||
function SetSubCount(subCount as integer)
|
||||
subCountText = ""
|
||||
if subCount = 1
|
||||
subCountText = "1 subscriber"
|
||||
else
|
||||
subCountText = `${subCount} subscribers`
|
||||
end if
|
||||
|
||||
m.subCountLabel.text = subCountText
|
||||
end function
|
||||
|
||||
|
||||
function SetVideoCount(videoCount as integer)
|
||||
videoCountText = ""
|
||||
if videoCount = 1
|
||||
videoCountText = "1 video"
|
||||
else
|
||||
videoCountText = `${videoCount} videos`
|
||||
end if
|
||||
|
||||
m.videoCountLabel.text = videoCountText
|
||||
end function
|
||||
|
||||
function GetThumbnailUrl(videoThumbnails as object) as string
|
||||
if videoThumbnails = invalid or videoThumbnails.Count() = 0
|
||||
return ""
|
||||
end if
|
||||
url = videoThumbnails[videoThumbnails.Count() - 1].url
|
||||
if url.startsWith("//")
|
||||
url = "https:" + url
|
||||
end if
|
||||
return url
|
||||
' NOTE: "_author" not "author". See PlaylistContentNode.xml for explanation.
|
||||
m.authorLabel.text = content._author
|
||||
m.subCountLabel.text = content.subCountText
|
||||
m.videoCountLabel.text = content.videoCountText
|
||||
m.thumbnail.uri = content.thumbnail
|
||||
end function
|
||||
@@ -8,27 +8,26 @@
|
||||
<children>
|
||||
<LayoutGroup
|
||||
itemSpacings="[24,5,5]">
|
||||
<Poster
|
||||
|
||||
<CirclePoster
|
||||
id="thumbnail"
|
||||
loadDisplayMode="scaleToZoom"
|
||||
width="200"
|
||||
height="196">
|
||||
</Poster>
|
||||
width="196"
|
||||
height="196" />
|
||||
|
||||
<Label
|
||||
id="authorLabel"
|
||||
width="200"
|
||||
width="196"
|
||||
font="font:SmallestBoldSystemFont"
|
||||
maxLines="2"
|
||||
wrap="true" />
|
||||
<Label
|
||||
id="subCountLabel"
|
||||
width="200"
|
||||
width="196"
|
||||
height="25"
|
||||
font="font:SmallestSystemFont" />
|
||||
<Label
|
||||
id="videoCountLabel"
|
||||
width="200"
|
||||
width="196"
|
||||
height="25"
|
||||
font="font:SmallestSystemFont" />
|
||||
</LayoutGroup>
|
||||
|
||||
@@ -3,6 +3,7 @@ import "pkg:/source/utils/Types.bs"
|
||||
function Init()
|
||||
m.titleLabel = m.top.FindNode("titleLabel")
|
||||
m.authorLabel = m.top.FindNode("authorLabel")
|
||||
m.updatedLabel = m.top.FindNode("updatedLabel")
|
||||
m.videoCountRect = m.top.FindNode("videoCountRect")
|
||||
m.videoCountLabel = m.top.FindNode("videoCountLabel")
|
||||
m.thumbnail = m.top.FindNode("thumbnail")
|
||||
@@ -19,6 +20,7 @@ function OnContentSet() as void
|
||||
m.titleLabel.text = content.title
|
||||
' NOTE: "_author" not "author". See PlaylistContentNode.xml for explanation.
|
||||
m.authorLabel.text = content._author
|
||||
m.updatedLabel.text = content.updatedText
|
||||
|
||||
m.thumbnail.uri = content.thumbnail
|
||||
|
||||
|
||||
@@ -7,30 +7,26 @@
|
||||
</interface>
|
||||
<children>
|
||||
<LayoutGroup
|
||||
itemSpacings="[24,5]"
|
||||
>
|
||||
itemSpacings="[24,5,5]">
|
||||
<Poster
|
||||
id="thumbnail"
|
||||
loadDisplayMode="scaleToZoom"
|
||||
width="350"
|
||||
height="196"
|
||||
>
|
||||
height="196">
|
||||
<Rectangle
|
||||
id="videoCountRect"
|
||||
width="60"
|
||||
height="26"
|
||||
color="0x000000"
|
||||
opacity="0.8"
|
||||
translation="[290, 162]"
|
||||
>
|
||||
translation="[290, 162]">
|
||||
<Label
|
||||
height="26"
|
||||
id="videoCountLabel"
|
||||
horizAlign="center"
|
||||
vertAlign="center"
|
||||
font="font:SmallestSystemFont"
|
||||
translation="[8, 0]"
|
||||
/>
|
||||
translation="[8, 0]" />
|
||||
</Rectangle>
|
||||
</Poster>
|
||||
|
||||
@@ -39,14 +35,17 @@
|
||||
width="350"
|
||||
font="font:SmallestBoldSystemFont"
|
||||
maxLines="2"
|
||||
wrap="true"
|
||||
/>
|
||||
wrap="true" />
|
||||
<Label
|
||||
id="authorLabel"
|
||||
width="350"
|
||||
height="25"
|
||||
font="font:SmallestSystemFont"
|
||||
/>
|
||||
font="font:SmallestSystemFont" />
|
||||
<Label
|
||||
id="updatedLabel"
|
||||
width="350"
|
||||
height="25"
|
||||
font="font:SmallestSystemFont" />
|
||||
</LayoutGroup>
|
||||
</children>
|
||||
</component>
|
||||
@@ -1,5 +1,5 @@
|
||||
import "pkg:/source/utils/Types.bs"
|
||||
import "pkg:/source/roku_modules/log/LogMixin.brs"
|
||||
import "pkg:/source/utils/Logging.bs"
|
||||
import "pkg:/source/asyncTask/asyncTask.bs"
|
||||
import "pkg:/components/VideoFeed/VideoRowListContentTask.bs"
|
||||
import "pkg:/components/VideoFeed/VideoRowListRowContentTask.bs"
|
||||
@@ -7,14 +7,13 @@ import "pkg:/source/utils/ErrorUtils.bs"
|
||||
import "pkg:/components/Dialog/DialogUtils.bs"
|
||||
import "pkg:/components/VideoPlayer/VideoUtils.bs"
|
||||
import "pkg:/components/PlaylistView/PlaylistUtils.bs"
|
||||
import "pkg:/components/ChannelView/ChannelUtils.bs"
|
||||
|
||||
function Init()
|
||||
m.pendingLoadTasks = {}
|
||||
end function
|
||||
|
||||
function OnNodeReady()
|
||||
m.log = new log.Logger("VideoRowList")
|
||||
|
||||
m.top.ObserveField("itemFocused", FuncName(OnItemFocused))
|
||||
m.top.ObserveField("rowItemFocused", FuncName(OnRowItemFocused))
|
||||
m.top.ObserveField("rowItemSelected", FuncName(OnRowItemSelected))
|
||||
@@ -69,15 +68,16 @@ function OnRowItemSelected(event as object)
|
||||
|
||||
if rowItem.type = "video"
|
||||
videoId = rowItem.videoId
|
||||
m.log.info("Play video: " + videoId)
|
||||
LogInfo("Play video: " + videoId)
|
||||
m.playQueue@.Play(rowItem, -1)
|
||||
else if rowItem.type = "playlist"
|
||||
playlistId = rowItem.playlistId
|
||||
m.log.info("Open playlist: " + playlistId)
|
||||
LogInfo("Open playlist: " + playlistId)
|
||||
PlaylistUtils.Open(rowItem)
|
||||
else if rowItem.type = "channel"
|
||||
authorId = rowItem.authorId
|
||||
m.log.info("Open channel: " + authorId)
|
||||
LogInfo("Open channel: " + authorId)
|
||||
ChannelUtils.Open(rowItem)
|
||||
else if rowItem.type = "action"
|
||||
if rowItem.action = "LoginDialog"
|
||||
dialog = CreateObject("roSGNode", "LoginDialog")
|
||||
@@ -88,7 +88,7 @@ function OnRowItemSelected(event as object)
|
||||
end function
|
||||
|
||||
function OnAuthTokenChange()
|
||||
' TODO:P1: Reload only content that is authenticated
|
||||
' TODO:P2: Reload only content that is authenticated
|
||||
' Should not reload if the page is not visible. Instead, capture state and reload when the page becomes visible
|
||||
InitContent()
|
||||
end function
|
||||
@@ -195,7 +195,7 @@ function OnVideoRowListRowContentTaskResult(output as object) as void
|
||||
error = output.result.error
|
||||
end if
|
||||
error = ErrorUtils.Format(error)
|
||||
m.log.error(error)
|
||||
LogError(error)
|
||||
m.top.onError = error
|
||||
message = `Failed to load feed\n${error}`
|
||||
DialogUtils.ShowDialog(message, "Feed load fail", true)
|
||||
|
||||
@@ -95,7 +95,7 @@ namespace SponsorBlock
|
||||
|
||||
if not output.success
|
||||
error = ErrorUtils.Format(output.error)
|
||||
m.log.error(error)
|
||||
LogError(error)
|
||||
return
|
||||
end if
|
||||
|
||||
@@ -136,7 +136,7 @@ namespace SponsorBlock
|
||||
|
||||
if action = "AutoSkip"
|
||||
m.top.seek = segmentEnd
|
||||
m.log.info("Skipping section:", segment["category"])
|
||||
LogInfo("Skipping section:", segment["category"])
|
||||
SendSkippedSectionEvent(segment.UUID)
|
||||
return
|
||||
end if
|
||||
|
||||
@@ -10,7 +10,6 @@ import "pkg:/components/VideoPlayer/SponsorBlock.bs"
|
||||
import "pkg:/components/Services/Invidious/InvidiousToContentNode.bs"
|
||||
|
||||
function Init()
|
||||
m.log = new log.Logger("VideoPlayer")
|
||||
SetPlayerStyle()
|
||||
SetupAnimation()
|
||||
|
||||
@@ -90,7 +89,7 @@ function OnVideoContentTaskResults(output as object) as void
|
||||
error = output.result.error
|
||||
end if
|
||||
error = ErrorUtils.Format(error)
|
||||
m.log.error(error)
|
||||
LogError(error)
|
||||
videoId = output.task.input.content.videoId
|
||||
message = `Failed to load video information for ${videoId}\n${error}`
|
||||
DialogUtils.ShowDialog(message, "Video load fail", true)
|
||||
@@ -145,13 +144,13 @@ function OnVideoPlayerStateChange() as void
|
||||
' If we successfully played the video, then any error that comes later is not due to a 403 (FORBIDDEN).
|
||||
' This is to reduce false positives, as we do not want retry another link if the first link is working fine.
|
||||
if state = "playing" and not m.videoPlayingSuccess
|
||||
m.log.info(`Now playing video ${m.top.content.url}`)
|
||||
LogInfo(`Now playing video ${m.top.content.url}`)
|
||||
m.videoPlayingSuccess = true
|
||||
end if
|
||||
|
||||
if state = "error"
|
||||
errorInfo = m.top.errorInfo
|
||||
m.log.error(`Error playing video ${m.top.content.videoId}`, errorInfo)
|
||||
LogError(`Error playing video ${m.top.content.videoId}`, errorInfo)
|
||||
if m.videoPlayingSuccess <> true
|
||||
' http for stream format, mediaerror for DASH
|
||||
if errorInfo.category = "http" or errorInfo.category = "mediaerror"
|
||||
@@ -162,7 +161,7 @@ function OnVideoPlayerStateChange() as void
|
||||
m.top.content.playletStreamUrlIndex = playletStreamUrlIndex
|
||||
if playletStreamUrlIndex < playletStreamUrls.Count()
|
||||
nextUrl = playletStreamUrls[playletStreamUrlIndex]
|
||||
m.log.error(`Stream ${currentUrl} failed to play. Trying next stream ${nextUrl}`)
|
||||
LogError(`Stream ${currentUrl} failed to play. Trying next stream ${nextUrl}`)
|
||||
|
||||
m.top.content.url = nextUrl
|
||||
' This video errored, and is about to finish, so don't close the video yet
|
||||
@@ -231,7 +230,7 @@ function PlayNextRecommendedVideo(recommendedVideos as object) as boolean
|
||||
continue for
|
||||
end if
|
||||
if not m.container@.watchedVideosContain(videoId)
|
||||
m.log.info(`Playing next recommended video (${videoId})`)
|
||||
LogInfo(`Playing next recommended video (${videoId})`)
|
||||
node = InvidiousContent.ToVideoContentNode(invalid, metadata, invalid)
|
||||
VideoUtils.PlayVideo(node)
|
||||
return true
|
||||
|
||||
@@ -3,14 +3,12 @@ import "HttpRequest.bs"
|
||||
import "HttpResponse.bs"
|
||||
import "pkg:/source/utils/Types.bs"
|
||||
import "pkg:/source/utils/StringUtils.bs"
|
||||
import "pkg:/source/roku_modules/log/LogMixin.brs"
|
||||
import "pkg:/source/utils/Logging.bs"
|
||||
|
||||
namespace Http
|
||||
const BUFSIZE = 65536
|
||||
|
||||
class HttpConnection
|
||||
private log as log.Logger
|
||||
|
||||
private total_received = 0
|
||||
private total_sent = 0
|
||||
private id = "<uninit>"
|
||||
@@ -22,7 +20,6 @@ namespace Http
|
||||
private settings as HttpSettings
|
||||
|
||||
function new(server as HttpServer, settings as HttpSettings)
|
||||
m.log = new log.Logger("HttpConnection")
|
||||
m.server = server
|
||||
m.settings = settings
|
||||
m.Reset()
|
||||
@@ -42,14 +39,13 @@ namespace Http
|
||||
m.header = invalid
|
||||
m.response = invalid
|
||||
m.header_only = false
|
||||
m.http_code = 0
|
||||
m.close = true
|
||||
m.ws_upgrade = false
|
||||
m.SetState(Http.HttpConnectionState.INIT)
|
||||
end function
|
||||
|
||||
function Recycle()
|
||||
m.log.info("recycle")
|
||||
LogInfo("recycle")
|
||||
m.Restart()
|
||||
m.SetState(Http.HttpConnectionState.RECV_REQUEST) ' ready for another
|
||||
end function
|
||||
@@ -60,7 +56,7 @@ namespace Http
|
||||
m.SetState(Http.HttpConnectionState.RECV_REQUEST)
|
||||
m.client = m.socket.getReceivedFromAddress().getAddress()
|
||||
|
||||
m.log.info("accepted connection @" + m.client)
|
||||
LogInfo("accepted connection @" + m.client)
|
||||
|
||||
' try to read right away rather than going through another iteration
|
||||
' of the poll loop.
|
||||
@@ -69,7 +65,7 @@ namespace Http
|
||||
|
||||
function PollRequest(server as HttpServer)
|
||||
if m.state <> Http.HttpConnectionState.RECV_REQUEST
|
||||
m.log.error("illegal request state @" + m.client)
|
||||
LogError("illegal request state @" + m.client)
|
||||
end if
|
||||
|
||||
rcvStrByteLen = m.socket.GetCountRcvBuf()
|
||||
@@ -96,7 +92,7 @@ namespace Http
|
||||
else
|
||||
m.setState(Http.HttpConnectionState.DONE)
|
||||
m.close = true
|
||||
m.log.error("couldn't process request or response, closing @" + m.client)
|
||||
LogError("couldn't process request or response, closing @" + m.client)
|
||||
end if
|
||||
else if m.request.buffer.len() > m.settings.MaxRequestLength ' die if it's too long
|
||||
m.response = new HttpResponse(m.request, m.server, m.settings)
|
||||
@@ -114,7 +110,7 @@ namespace Http
|
||||
|
||||
function PollHeader(server as HttpServer) as void
|
||||
if m.state <> Http.HttpConnectionState.SEND_HEADER
|
||||
m.log.error("illegal header state @" + m.client)
|
||||
LogError("illegal header state @" + m.client)
|
||||
end if
|
||||
|
||||
sent = m.response.SendHeader(m.socket, Http.BUFSIZE)
|
||||
@@ -136,7 +132,7 @@ namespace Http
|
||||
|
||||
function PollResponse(server as HttpServer)
|
||||
if m.state <> Http.HttpConnectionState.SEND_RESPONSE or m.response.header_only
|
||||
m.log.error("illegal response state @" + m.client)
|
||||
LogError("illegal response state @" + m.client)
|
||||
end if
|
||||
|
||||
sent = m.response.Send(m.socket, Http.BUFSIZE)
|
||||
@@ -166,9 +162,9 @@ namespace Http
|
||||
'info(m,op + " would have blocked @"+m.client)
|
||||
else
|
||||
if m.socket.eSuccess()
|
||||
m.log.info(op + " peer closed @" + m.client)
|
||||
LogInfo(op + " peer closed @" + m.client)
|
||||
else
|
||||
m.log.error(op + " transfer error @" + m.client, m.socket.status())
|
||||
LogError(op + " transfer error @" + m.client, m.socket.status())
|
||||
end if
|
||||
m.close = true
|
||||
m.SetState(Http.HttpConnectionState.DONE)
|
||||
@@ -178,17 +174,11 @@ namespace Http
|
||||
|
||||
function SetState(newState as Http.HttpConnectionState)
|
||||
if m.state <> newState
|
||||
' m.log.debug(m, "state change" + Stri(m.state) + " ->" + Stri(newState))
|
||||
LogDebug(m, "state change" + Stri(m.state) + " ->" + Stri(newState))
|
||||
m.state = newState
|
||||
end if
|
||||
end function
|
||||
|
||||
function LogInfo()
|
||||
if m.http_code <> 0 and not StringUtils.IsNullOrEmpty(m.method)
|
||||
m.log.info(m.last_active.totalSeconds(), " client:", m.client, " meth:", m.method, " uri:", m.uri, " code:", m.code, " sent:", m.total_sent, " referer:", m.referer, " user agent:", m.user_agent)
|
||||
end if
|
||||
end function
|
||||
|
||||
end class
|
||||
|
||||
end namespace
|
||||
@@ -10,8 +10,6 @@ namespace Http
|
||||
end function
|
||||
|
||||
class HttpRequest
|
||||
private log as log.Logger
|
||||
|
||||
' members
|
||||
private method = invalid
|
||||
private uri = invalid
|
||||
@@ -33,7 +31,6 @@ namespace Http
|
||||
private ready_for_response = false
|
||||
|
||||
function new()
|
||||
m.log = new log.Logger("HttpRequest")
|
||||
m.id = Http.GetHttpRequestId()
|
||||
m.headers = CreateObject("roAssociativeArray")
|
||||
end function
|
||||
@@ -81,7 +78,7 @@ namespace Http
|
||||
|
||||
function ParseOperation() as boolean
|
||||
if m.buffer_index <> 0
|
||||
m.log.error(`invalid state: reading operation, but request is at index ${m.buffer_index}`)
|
||||
LogError(`invalid state: reading operation, but request is at index ${m.buffer_index}`)
|
||||
m.ready_for_response = true
|
||||
return false
|
||||
end if
|
||||
@@ -93,7 +90,7 @@ namespace Http
|
||||
operation = m.ReadHeaderLine()
|
||||
|
||||
if operation = invalid or operation = ""
|
||||
m.log.error("empty request")
|
||||
LogError("empty request")
|
||||
m.ready_for_response = true
|
||||
return false
|
||||
end if
|
||||
@@ -103,9 +100,9 @@ namespace Http
|
||||
m.method = Ucase(parts[0])
|
||||
m.uri = parts[1]
|
||||
m.protocol = Ucase(parts[2])
|
||||
m.log.info(`${m.method} '${m.uri}'`)
|
||||
LogInfo(`${m.method} '${m.uri}'`)
|
||||
else
|
||||
m.log.error("invalid request: " + operation)
|
||||
LogError("invalid request: " + operation)
|
||||
m.ready_for_response = true
|
||||
end if
|
||||
|
||||
@@ -148,7 +145,7 @@ namespace Http
|
||||
if m.headers["Content-Length"] = invalid
|
||||
m.ready_for_response = true
|
||||
if m.body.len() > 0
|
||||
m.log.error("invalid request: request body found, but no Content-Length header")
|
||||
LogError("invalid request: request body found, but no Content-Length header")
|
||||
return false
|
||||
else
|
||||
return true
|
||||
@@ -160,7 +157,7 @@ namespace Http
|
||||
end if
|
||||
|
||||
if m.body.len() > contentLength
|
||||
m.log.error("invalid request: request body is larger than Content-Length")
|
||||
LogError("invalid request: request body is larger than Content-Length")
|
||||
m.ready_for_response = true
|
||||
return false
|
||||
end if
|
||||
@@ -233,7 +230,7 @@ namespace Http
|
||||
m.range_end_given = true
|
||||
end if
|
||||
end if
|
||||
m.log.info("range request begin" + Stri(m.range_begin) + " end" + Stri(m.range_end))
|
||||
LogInfo("range request begin" + Stri(m.range_begin) + " end" + Stri(m.range_end))
|
||||
end if
|
||||
end function
|
||||
|
||||
|
||||
@@ -9,8 +9,6 @@ namespace Http
|
||||
end function
|
||||
|
||||
class HttpResponse
|
||||
private log as log.Logger
|
||||
|
||||
private source = Http.HttpResponseSource.NONE
|
||||
|
||||
' members
|
||||
@@ -32,7 +30,6 @@ namespace Http
|
||||
private settings
|
||||
|
||||
function new(request as HttpRequest, server as HttpServer, settings as HttpSettings)
|
||||
m.log = new log.Logger("HttpResponse")
|
||||
m.id = Http.GetHttpResponseId()
|
||||
m.request = request
|
||||
m.server = server
|
||||
@@ -111,20 +108,20 @@ namespace Http
|
||||
if m.start + m.sent >= m.buf_start + m.body_buffer.count()
|
||||
m.buf_start = m.start + m.sent
|
||||
m.body_buffer.ReadFile(m.path, m.buf_start, bufsize)
|
||||
m.log.info(`Read ${m.body_buffer.count()} bytes from source file @${m.buf_start}`)
|
||||
LogDebug(`Read ${m.body_buffer.count()} bytes from source file @${m.buf_start}`)
|
||||
end if
|
||||
end if
|
||||
buf_pos = m.start + m.sent - m.buf_start
|
||||
buf_remaining = m.body_buffer.count() - buf_pos
|
||||
if buf_remaining = 0
|
||||
m.log.info("source buffer is empty")
|
||||
LogInfo("source buffer is empty")
|
||||
end if
|
||||
req_remaining = m.body_buffer_length - m.sent
|
||||
if buf_remaining > req_remaining
|
||||
buf_remaining = req_remaining
|
||||
end if
|
||||
sent = sock.send(m.body_buffer, buf_pos, buf_remaining)
|
||||
m.LogInfo(sent, m.buf_start + buf_pos, m.body_buffer_length)
|
||||
m.LogSentRange(sent, m.buf_start + buf_pos, m.body_buffer_length)
|
||||
if sent > 0
|
||||
m.sent = m.sent + sent
|
||||
end if
|
||||
@@ -141,7 +138,7 @@ namespace Http
|
||||
else
|
||||
sent = sock.sendStr(m.header.mid(m.header_sent))
|
||||
end if
|
||||
m.LogInfo(sent, m.header_sent, m.header_length)
|
||||
m.LogSentRange(sent, m.header_sent, m.header_length)
|
||||
if sent > 0
|
||||
m.header_sent = m.header_sent + sent
|
||||
end if
|
||||
@@ -176,8 +173,8 @@ namespace Http
|
||||
return m.header_sent = m.header_length
|
||||
end function
|
||||
|
||||
function LogInfo(recent as integer, from as integer, total as integer)
|
||||
m.log.info(`Sent ${recent} [${m.MakeRange(from, recent, total)}]`)
|
||||
function LogSentRange(recent as integer, from as integer, total as integer)
|
||||
LogDebug(`Sent ${recent} [${m.MakeRange(from, recent, total)}]`)
|
||||
end function
|
||||
|
||||
function KeepAlive(keepAlive as boolean)
|
||||
|
||||
@@ -7,8 +7,6 @@ import "HttpConnection.bs"
|
||||
namespace Http
|
||||
|
||||
class HttpServer
|
||||
private log as log.Logger
|
||||
|
||||
' members
|
||||
private connections = invalid
|
||||
private sockin = invalid
|
||||
@@ -26,7 +24,6 @@ namespace Http
|
||||
public task as object
|
||||
|
||||
function new(settings as HttpSettings, task as object)
|
||||
m.log = new log.Logger("HttpServer")
|
||||
m.settings = settings
|
||||
m.task = task
|
||||
m.routers = []
|
||||
@@ -44,13 +41,13 @@ namespace Http
|
||||
sockin = CreateObject("roStreamSocket")
|
||||
if sockin = invalid
|
||||
success = false
|
||||
m.log.error("socket()")
|
||||
LogError("socket()")
|
||||
end if
|
||||
|
||||
' reuse address
|
||||
if not sockin.setReuseAddr(true)
|
||||
success = false
|
||||
m.log.error("setsockopt(SO_REUSEADDR)", sockin.status())
|
||||
LogError("setsockopt(SO_REUSEADDR)", sockin.status())
|
||||
end if
|
||||
|
||||
' bind socket
|
||||
@@ -58,12 +55,12 @@ namespace Http
|
||||
addrin.setPort(m.settings.Port)
|
||||
if not sockin.setAddress(addrin)
|
||||
success = false
|
||||
m.log.error("bind(port" + Stri(m.settings.Port) + ")", sockin.status())
|
||||
LogError("bind(port" + Stri(m.settings.Port) + ")", sockin.status())
|
||||
end if
|
||||
' listen on socket
|
||||
if not sockin.listen(m.settings.MaxConnections)
|
||||
success = false
|
||||
m.log.error("listen()", sockin.status())
|
||||
LogError("listen()", sockin.status())
|
||||
end if
|
||||
' monitor socket
|
||||
sockin.setMessagePort(m.settings.MessagePort)
|
||||
@@ -71,7 +68,7 @@ namespace Http
|
||||
|
||||
m.sockin = sockin
|
||||
|
||||
m.log.info("listening on " + addrin.getAddress())
|
||||
LogInfo("listening on " + addrin.getAddress())
|
||||
return success
|
||||
end function
|
||||
|
||||
@@ -95,7 +92,7 @@ namespace Http
|
||||
conn.socket.notifyWritable(true)
|
||||
conn.socket.notifyReadable(false)
|
||||
else
|
||||
m.log.error("invalid state")
|
||||
LogError("invalid state")
|
||||
end if
|
||||
end for
|
||||
end function
|
||||
@@ -126,7 +123,7 @@ namespace Http
|
||||
else if cs = Http.HttpConnectionState.DONE
|
||||
' handle with other connections that might transition to done
|
||||
else
|
||||
m.log.error("invalid state")
|
||||
LogError("invalid state")
|
||||
end if
|
||||
cs = conn.state
|
||||
if cs = Http.HttpConnectionState.DONE
|
||||
@@ -134,7 +131,7 @@ namespace Http
|
||||
conn.socket.close()
|
||||
connections.delete(id)
|
||||
else if conn.ws_upgrade and m.websocket <> invalid
|
||||
m.log.info("upgrading connection to web socket")
|
||||
LogInfo("upgrading connection to web socket")
|
||||
m.websocket.AddConnection(conn.socket)
|
||||
connections.delete(id)
|
||||
else
|
||||
@@ -149,7 +146,7 @@ namespace Http
|
||||
sockin = m.sockin
|
||||
socket = sockin.accept()
|
||||
if not sockin.eOK()
|
||||
m.log.error("accept()", sockin.status())
|
||||
LogError("accept()", sockin.status())
|
||||
end if
|
||||
if socket = invalid
|
||||
return invalid
|
||||
@@ -171,7 +168,7 @@ namespace Http
|
||||
m.websocket.Close()
|
||||
end if
|
||||
' final stats
|
||||
m.log.info(`\n` + m.stats())
|
||||
LogInfo(`\n` + m.stats())
|
||||
end function
|
||||
|
||||
function Stats() as string
|
||||
|
||||
@@ -3,8 +3,6 @@ import "pkg:/source/utils/StringUtils.bs"
|
||||
namespace Http
|
||||
|
||||
class HttpStaticFilesRouter extends HttpRouter
|
||||
private log as log.Logger
|
||||
|
||||
private root
|
||||
private route
|
||||
private showDirectories
|
||||
@@ -13,7 +11,6 @@ namespace Http
|
||||
|
||||
function new(route as string, root as string, showDirectories = false as boolean, showHidden = false as boolean, fsCheck = true as boolean)
|
||||
super()
|
||||
m.log = new log.Logger("HttpStaticFilesRouter")
|
||||
|
||||
m.root = root
|
||||
m.route = route
|
||||
@@ -78,7 +75,7 @@ namespace Http
|
||||
mimetype = server.utils.MimeType(decoded_path)
|
||||
response.ContentType(mimetype)
|
||||
response.fileLength = stat.size
|
||||
router.log.info(`uri=${request.uri}, target=${path}, content-type=${mimetype}, content-length=${response.fileLength}`)
|
||||
LogInfo("uri:", request.uri, "target:", path, "content-type:", mimetype, "content-length", response.fileLength)
|
||||
router.GenerateFile(path, router, request, response)
|
||||
return true
|
||||
else
|
||||
@@ -117,7 +114,7 @@ namespace Http
|
||||
start = 0
|
||||
end if
|
||||
else
|
||||
router.log.error(1, "internal error - range start/finish logic inconsistency")
|
||||
LogError(1, "internal error - range start/finish logic inconsistency")
|
||||
end if
|
||||
|
||||
response.start = start
|
||||
@@ -126,7 +123,7 @@ namespace Http
|
||||
response.headers["Content-Range"] = "bytes " + response.MakeRange(response.start, response.body_buffer_length, response.filelength)
|
||||
response.http_code = 206
|
||||
|
||||
router.log.info("sending range " + response.MakeRange(start, response.body_buffer_length, response.fileLength))
|
||||
LogInfo("sending range " + response.MakeRange(start, response.body_buffer_length, response.fileLength))
|
||||
else ' no range stuff
|
||||
response.body_buffer_length = response.fileLength
|
||||
response.ContentLength(response.body_buffer_length)
|
||||
@@ -198,7 +195,7 @@ namespace Http
|
||||
safe_url = uri ' UrlEncode(uri) ' too much encoding
|
||||
listing += `<a href="${safe_url}">${item}${indicator}</a>\n`
|
||||
else
|
||||
router.log.warn("insufficient stat info to include '" + dir + item + "'")
|
||||
LogWarn("insufficient stat info to include '" + dir + item + "'")
|
||||
end if
|
||||
end if
|
||||
end for
|
||||
|
||||
@@ -3,9 +3,6 @@ import "pkg:/components/Web/WebServer/Middleware/HttpDefaultRouter.bs"
|
||||
import "pkg:/source/utils/Logging.bs"
|
||||
|
||||
function Init()
|
||||
InitializeLogging()
|
||||
m.log = new log.Logger("WebServer")
|
||||
|
||||
m.top.functionName = "WebServerLoop"
|
||||
end function
|
||||
|
||||
@@ -40,7 +37,7 @@ function WebServerLoop() as void
|
||||
server = new Http.HttpServer(settings, m.top)
|
||||
if not server.success
|
||||
m.top.isRunning = false
|
||||
m.log.error("Failed to start server")
|
||||
LogError("Failed to start server")
|
||||
return
|
||||
end if
|
||||
|
||||
@@ -73,12 +70,12 @@ function WebServerLoop() as void
|
||||
end if
|
||||
end while
|
||||
|
||||
m.log.info("closing server")
|
||||
LogInfo("closing server")
|
||||
server.Close()
|
||||
m.top.isRunning = false
|
||||
m.top.unobserveField("shouldQuit")
|
||||
end function
|
||||
|
||||
function SetupRoutes(server as object)
|
||||
m.log.warn("No routes configured")
|
||||
LogWarn("No routes configured")
|
||||
end function
|
||||
@@ -12,7 +12,7 @@
|
||||
<script type="text/brightscript" uri="pkg:/components/parts/AutoBind/AutoBind.part.brs" />
|
||||
<script type="text/brightscript" uri="pkg:/components/parts/AutoBind/tests/AutoBindNode1_bindings.brs" />
|
||||
<script type="text/brightscript" uri="pkg:/components/parts/AutoBind/tests/AutoBindNode1.brs" />
|
||||
<script type="text/brightscript" uri="pkg:/source/roku_modules/bslib/bslib.brs" />
|
||||
<script type="text/brightscript" uri="pkg:/source/bslib.brs" />
|
||||
<children>
|
||||
<AutoBindNode2 id="AutoBindNode2" />
|
||||
</children>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<script type="text/brightscript" uri="pkg:/components/parts/AutoBind/AutoBind.part.brs" />
|
||||
<script type="text/brightscript" uri="pkg:/components/parts/AutoBind/tests/AutoBindNode1Container_bindings.brs" />
|
||||
<script type="text/brightscript" uri="pkg:/components/parts/AutoBind/tests/AutoBindNode1Container.brs" />
|
||||
<script type="text/brightscript" uri="pkg:/source/roku_modules/bslib/bslib.brs" />
|
||||
<script type="text/brightscript" uri="pkg:/source/bslib.brs" />
|
||||
<children>
|
||||
<AutoBindNode1 id="AutoBindNode1" reference2=".." />
|
||||
</children>
|
||||
|
||||
@@ -12,6 +12,6 @@
|
||||
<script type="text/brightscript" uri="pkg:/components/parts/AutoBind/AutoBind.part.brs" />
|
||||
<script type="text/brightscript" uri="pkg:/components/parts/AutoBind/tests/AutoBindNode2_bindings.brs" />
|
||||
<script type="text/brightscript" uri="pkg:/components/parts/AutoBind/tests/AutoBindNode2.brs" />
|
||||
<script type="text/brightscript" uri="pkg:/source/roku_modules/bslib/bslib.brs" />
|
||||
<script type="text/brightscript" uri="pkg:/source/bslib.brs" />
|
||||
</component>
|
||||
<!--//# sourceMappingURL=./AutoBindNode2.xml.map -->
|
||||
@@ -84,7 +84,7 @@
|
||||
required: false,
|
||||
type: ["video", "playlist", "channel", "all"],
|
||||
arrayType: "comma-separated",
|
||||
default: ["video", "playlist"],
|
||||
default: ["video", "playlist", "channel"],
|
||||
},
|
||||
features: {
|
||||
required: false,
|
||||
|
||||
|
After Width: | Height: | Size: 9.6 KiB |
|
After Width: | Height: | Size: 316 B |
|
After Width: | Height: | Size: 321 B |
@@ -0,0 +1,3 @@
|
||||
<svg enable-background="new 0 0 24 24" height="24" viewBox="0 0 24 24" width="24" focusable="false" style="pointer-events: none; display: block; width: 100%; height: 100%;">
|
||||
<path fill="#000000" d="M15 17h6v1h-6v-1zm-4 0H3v1h8v2h1v-5h-1v2zm3-9h1V3h-1v2H3v1h11v2zm4-3v1h3V5h-3zM6 14h1V9H6v2H3v1h3v2zm4-2h11v-1H10v1z"></path>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 334 B |
@@ -0,0 +1,3 @@
|
||||
<svg enable-background="new 0 0 24 24" height="24" viewBox="0 0 24 24" width="24" focusable="false" style="pointer-events: none; display: block; width: 100%; height: 100%;">
|
||||
<path fill="#FFFFFF" d="M15 17h6v1h-6v-1zm-4 0H3v1h8v2h1v-5h-1v2zm3-9h1V3h-1v2H3v1h11v2zm4-3v1h3V5h-3zM6 14h1V9H6v2H3v1h3v2zm4-2h11v-1H10v1z"></path>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 334 B |
|
Before Width: | Height: | Size: 330 B After Width: | Height: | Size: 330 B |
|
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 4.9 KiB |
|
Before Width: | Height: | Size: 1021 B After Width: | Height: | Size: 1021 B |
|
Before Width: | Height: | Size: 542 B After Width: | Height: | Size: 542 B |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
@@ -2,8 +2,8 @@ title=PlayletLib
|
||||
|
||||
# Do not update version manually, it is auto updated from package.json
|
||||
major_version=0
|
||||
minor_version=11
|
||||
build_version=00000
|
||||
minor_version=12
|
||||
build_version=00001
|
||||
|
||||
ui_resolutions=hd
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#const DISABLE_CACHE = false
|
||||
|
||||
import "pkg:/source/roku_modules/log/LogMixin.brs"
|
||||
import "pkg:/source/utils/Logging.bs"
|
||||
import "pkg:/source/utils/CryptoUtils.bs"
|
||||
import "pkg:/source/utils/StringUtils.bs"
|
||||
import "pkg:/source/utils/Types.bs"
|
||||
@@ -45,7 +45,6 @@ namespace HttpClient
|
||||
public urlTransfer as object
|
||||
|
||||
function new()
|
||||
m.log = new log.Logger("HttpRequest")
|
||||
m._timeoutSeconds = 30
|
||||
end function
|
||||
|
||||
@@ -198,7 +197,7 @@ namespace HttpClient
|
||||
if m._noCache <> true
|
||||
cache = HttpClientCache.Get(m)
|
||||
if cache <> invalid
|
||||
m.log.info("Cache hit", m._method, m.BuildUrl())
|
||||
LogInfo("Cache hit", m._method, m.BuildUrl())
|
||||
m._cache = cache
|
||||
return m
|
||||
end if
|
||||
@@ -206,7 +205,7 @@ namespace HttpClient
|
||||
|
||||
m.urlTransfer = m.CreateRoUrlTransfer()
|
||||
if m.urlTransfer = invalid
|
||||
m.log.error("Failed to create roUrlTransfer. We're probably not in a background thread.")
|
||||
LogError("Failed to create roUrlTransfer. We're probably not in a background thread.")
|
||||
return m
|
||||
end if
|
||||
|
||||
@@ -219,7 +218,7 @@ namespace HttpClient
|
||||
m.urlTransfer.SetMessagePort(CreateObject("roMessagePort"))
|
||||
end if
|
||||
|
||||
m.log.info("Sending", m._method, m.urlTransfer.GetURL(), "ID:", m.urlTransfer.GetIdentity())
|
||||
LogInfo("Sending", m._method, m.urlTransfer.GetURL(), "ID:", m.urlTransfer.GetIdentity())
|
||||
|
||||
#if DEBUG
|
||||
? `════════ curl command ════════\n${m.ToCurlCommand()}\n══════════════════════════════`
|
||||
@@ -237,7 +236,7 @@ namespace HttpClient
|
||||
end if
|
||||
|
||||
if m._sent <> true
|
||||
m.log.error("Failed to send request")
|
||||
LogError("Failed to send request")
|
||||
end if
|
||||
|
||||
return m
|
||||
@@ -295,19 +294,19 @@ namespace HttpClient
|
||||
|
||||
if msg = invalid
|
||||
' timeout
|
||||
m.log.info("Timeout", "ID:", m.urlTransfer.GetIdentity())
|
||||
LogInfo("Timeout", "ID:", m.urlTransfer.GetIdentity())
|
||||
m.urlTransfer.AsyncCancel()
|
||||
else
|
||||
eventType = type(msg)
|
||||
if eventType = "roUrlEvent"
|
||||
m.log.info("Finished", "ID:", m.urlTransfer.GetIdentity())
|
||||
LogInfo("Finished", "ID:", m.urlTransfer.GetIdentity())
|
||||
else if eventType = "roSGNodeEvent"
|
||||
node = msg.getRoSGNode()
|
||||
field = msg.getField()
|
||||
value = msg.getData()
|
||||
' cancellation
|
||||
if node.isSameNode(m._cancellation.node) and field = m._cancellation.field and value = m._cancellation.value
|
||||
m.log.info("Cancelled", "ID:", m.urlTransfer.GetIdentity())
|
||||
LogInfo("Cancelled", "ID:", m.urlTransfer.GetIdentity())
|
||||
m._cancelled = true
|
||||
m.urlTransfer.AsyncCancel()
|
||||
end if
|
||||
@@ -544,9 +543,6 @@ namespace HttpClient
|
||||
|
||||
end namespace
|
||||
|
||||
' TODO:P2 introduce the concept of "loose" cache
|
||||
' For playlists that show in a feed or in a search, we don't want to make a request to get the playlist details
|
||||
' But if we have that information in the cache already, it can be used
|
||||
namespace HttpClientCache
|
||||
function GetLocation(request as HttpClient.HttpRequest) as dynamic
|
||||
if request._cacheLocation <> invalid
|
||||
|
||||
@@ -1,17 +1,66 @@
|
||||
import "pkg:/source/roku_modules/log/LogMixin.brs"
|
||||
|
||||
enum LogLevel
|
||||
ERROR = 0
|
||||
WARN = 1
|
||||
INFO = 2
|
||||
VERBOSE = 3
|
||||
DEBUG = 3
|
||||
end enum
|
||||
|
||||
function InitializeLogging() as void
|
||||
instance = log.getLogInstance()
|
||||
if instance <> invalid
|
||||
return
|
||||
function InitializeLogger(logLevel = LogLevel.Info as LogLevel) as void
|
||||
logger = CreateObject("roSGNode", "Logger")
|
||||
logger.logLevel = logLevel
|
||||
m.global.addFields({ logger: logger })
|
||||
logger.control = "run"
|
||||
end function
|
||||
|
||||
function LogError(arg1 = invalid as dynamic, arg2 = invalid as dynamic, arg3 = invalid as dynamic, arg4 = invalid as dynamic, arg5 = invalid as dynamic, arg6 = invalid as dynamic, arg7 = invalid as dynamic, arg8 = invalid as dynamic, arg9 = invalid as dynamic, arg10 = invalid as dynamic, arg11 = invalid as dynamic, arg12 = invalid as dynamic, arg13 = invalid as dynamic, arg14 = invalid as dynamic, arg15 = invalid as dynamic, arg16 = invalid as dynamic) as void
|
||||
throw "FATAL: Calling LogError() which is a stub function"
|
||||
end function
|
||||
|
||||
function LogWarn(arg1 = invalid as dynamic, arg2 = invalid as dynamic, arg3 = invalid as dynamic, arg4 = invalid as dynamic, arg5 = invalid as dynamic, arg6 = invalid as dynamic, arg7 = invalid as dynamic, arg8 = invalid as dynamic, arg9 = invalid as dynamic, arg10 = invalid as dynamic, arg11 = invalid as dynamic, arg12 = invalid as dynamic, arg13 = invalid as dynamic, arg14 = invalid as dynamic, arg15 = invalid as dynamic, arg16 = invalid as dynamic) as void
|
||||
throw "FATAL: Calling LogWarn() which is a stub function"
|
||||
end function
|
||||
|
||||
function LogInfo(arg1 = invalid as dynamic, arg2 = invalid as dynamic, arg3 = invalid as dynamic, arg4 = invalid as dynamic, arg5 = invalid as dynamic, arg6 = invalid as dynamic, arg7 = invalid as dynamic, arg8 = invalid as dynamic, arg9 = invalid as dynamic, arg10 = invalid as dynamic, arg11 = invalid as dynamic, arg12 = invalid as dynamic, arg13 = invalid as dynamic, arg14 = invalid as dynamic, arg15 = invalid as dynamic, arg16 = invalid as dynamic) as void
|
||||
throw "FATAL: Calling LogInfo() which is a stub function"
|
||||
end function
|
||||
|
||||
function LogDebug(arg1 = invalid as dynamic, arg2 = invalid as dynamic, arg3 = invalid as dynamic, arg4 = invalid as dynamic, arg5 = invalid as dynamic, arg6 = invalid as dynamic, arg7 = invalid as dynamic, arg8 = invalid as dynamic, arg9 = invalid as dynamic, arg10 = invalid as dynamic, arg11 = invalid as dynamic, arg12 = invalid as dynamic, arg13 = invalid as dynamic, arg14 = invalid as dynamic, arg15 = invalid as dynamic, arg16 = invalid as dynamic) as void
|
||||
throw "FATAL: Calling LogDebug() which is a stub function"
|
||||
end function
|
||||
|
||||
function ToString(value as dynamic) as string
|
||||
if getInterface(value, "ifString") <> invalid
|
||||
return value
|
||||
end if
|
||||
log.initializeLogManager(["log_PrintTransport", "log_FileTransport"], LogLevel.INFO)
|
||||
|
||||
valueType = type(value)
|
||||
|
||||
if valueType = "<uninitialized>"
|
||||
return valueType
|
||||
else if value = invalid
|
||||
return "<invalid>"
|
||||
else if GetInterface(value, "ifToStr") <> invalid
|
||||
return value.toStr()
|
||||
else if valueType = "roSGNode"
|
||||
return "Node(" + value.subType() + ":" + value.id + ")"
|
||||
else if valueType = "roAssociativeArray"
|
||||
return AssocArrayToString(value)
|
||||
end if
|
||||
|
||||
return "<" + valueType + ">"
|
||||
end function
|
||||
|
||||
function AssocArrayToString(dict as object) as string
|
||||
result = "{"
|
||||
count = dict.count()
|
||||
i = 0
|
||||
for each key in dict
|
||||
result += key + ": " + ToString(dict[key])
|
||||
if i < count - 1
|
||||
result += ", "
|
||||
end if
|
||||
i++
|
||||
end for
|
||||
result += "}"
|
||||
return result
|
||||
end function
|
||||
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "playlet-web",
|
||||
"version": "0.11.0",
|
||||
"version": "0.12.1",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "playlet-web",
|
||||
"version": "0.11.0",
|
||||
"version": "0.12.1",
|
||||
"devDependencies": {
|
||||
"@sveltejs/vite-plugin-svelte": "^2.4.5",
|
||||
"@tailwindcss/typography": "^0.5.10",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "playlet-web",
|
||||
"version": "0.11.0",
|
||||
"version": "0.12.1",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
|
||||
@@ -21,9 +21,9 @@
|
||||
if (
|
||||
value?.app?.lib_url_type === "custom" &&
|
||||
value?.app?.lib_url ===
|
||||
"https://github.com/iBicha/playlet/releases/download/unstable/playlet-lib.zip"
|
||||
"https://github.com/iBicha/playlet/releases/download/canary/playlet-lib.zip"
|
||||
) {
|
||||
version += "-unstable";
|
||||
version += "-canary";
|
||||
}
|
||||
loggedIn = value?.invidious?.logged_in;
|
||||
auth_url = value?.invidious?.auth_url;
|
||||
|
||||
@@ -0,0 +1,177 @@
|
||||
// This plugin generates logging functions based on the usage of the LogError, LogWarn, LogInfo, and LogDebug functions.
|
||||
|
||||
import {
|
||||
AstEditor,
|
||||
BeforeFileTranspileEvent,
|
||||
BscFile,
|
||||
CompilerPlugin,
|
||||
Program,
|
||||
SourceLiteralExpression,
|
||||
TokenKind,
|
||||
TranspileObj,
|
||||
WalkMode,
|
||||
createToken,
|
||||
createVisitor,
|
||||
isBrsFile,
|
||||
} from 'brighterscript';
|
||||
import path from 'path';
|
||||
|
||||
const loggingFilePath = 'source/utils/Logging.bs';
|
||||
const logFunctions = {
|
||||
LogError: {
|
||||
stringLevel: 'ERROR',
|
||||
level: 0,
|
||||
},
|
||||
LogWarn: {
|
||||
stringLevel: 'WARN',
|
||||
level: 1,
|
||||
},
|
||||
LogInfo: {
|
||||
stringLevel: 'INFO',
|
||||
level: 2,
|
||||
},
|
||||
LogDebug: {
|
||||
stringLevel: 'DEBUG',
|
||||
level: 3,
|
||||
}
|
||||
}
|
||||
|
||||
const logFunctionKeys = Object.keys(logFunctions);
|
||||
|
||||
type LogFunction = {
|
||||
name: string;
|
||||
argCount: number;
|
||||
}
|
||||
|
||||
export class LoggerPlugin implements CompilerPlugin {
|
||||
public name = 'LoggerPlugin';
|
||||
|
||||
private hasLogger = false;
|
||||
|
||||
beforeProgramTranspile(program: Program, entries: TranspileObj[], editor: AstEditor) {
|
||||
this.hasLogger = program.hasFile(loggingFilePath);
|
||||
if (!this.hasLogger) {
|
||||
return;
|
||||
}
|
||||
|
||||
const usedLogFunctions = new Map<string, LogFunction>();
|
||||
|
||||
for (const entry of entries) {
|
||||
if (!isBrsFile(entry.file)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const visitor = createVisitor({
|
||||
ExpressionStatement: (statement) => {
|
||||
// @ts-ignore
|
||||
const funcName = statement.expression.callee?.name?.text;
|
||||
if (funcName && logFunctionKeys.includes(funcName)) {
|
||||
// @ts-ignore
|
||||
const argCount = statement.expression.args.length + 1; // +1 for the file path
|
||||
const newFuncName = `${funcName}${argCount}`;
|
||||
usedLogFunctions.set(newFuncName, {
|
||||
name: funcName,
|
||||
argCount: argCount,
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
for (const func of entry.file.parser.references.functionExpressions) {
|
||||
func.body.walk(visitor, {
|
||||
walkMode: WalkMode.visitStatements
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
this.generateLoggingFile(program, usedLogFunctions);
|
||||
}
|
||||
|
||||
beforeFileTranspile(event: BeforeFileTranspileEvent<BscFile>) {
|
||||
if (!this.hasLogger) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!isBrsFile(event.file)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// @ts-ignore
|
||||
const isDebug = !!event.program.options.debug;
|
||||
|
||||
const visitor = createVisitor({
|
||||
ExpressionStatement: (statement) => {
|
||||
// @ts-ignore
|
||||
const funcName = statement.expression.callee?.name?.text;
|
||||
if (funcName && logFunctionKeys.includes(funcName)) {
|
||||
// @ts-ignore
|
||||
const args = statement.expression.args;
|
||||
if (isDebug) {
|
||||
const t = createToken(TokenKind.SourceLocationLiteral, '', statement.expression.range);
|
||||
let sourceExpression = new SourceLiteralExpression(t);
|
||||
event.editor.addToArray(args, 0, sourceExpression);
|
||||
} else {
|
||||
const fileName = path.basename(event.file.pkgPath);
|
||||
const line = statement.range.start.line;
|
||||
const t = createToken(TokenKind.StringLiteral, `\"[${fileName}:${line}]\"`, statement.expression.range);
|
||||
let sourceExpression = new SourceLiteralExpression(t);
|
||||
event.editor.addToArray(args, 0, sourceExpression);
|
||||
}
|
||||
|
||||
const newFuncName = `${funcName}${args.length}`;
|
||||
event.program.logger.info(this.name, `Replacing ${funcName} with ${newFuncName}`);
|
||||
// @ts-ignore
|
||||
event.editor.setProperty(statement.expression.callee?.name, 'text', `${newFuncName}`)
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
for (const func of event.file.parser.references.functionExpressions) {
|
||||
func.body.walk(visitor, {
|
||||
walkMode: WalkMode.visitStatements
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
generateLoggingFile(program: Program, usedLogFunctions: Map<string, LogFunction>) {
|
||||
const file = program.getFile(loggingFilePath);
|
||||
let content = file.fileContents;
|
||||
|
||||
content += '\n\' Start of auto-generated functions\n'
|
||||
usedLogFunctions.forEach((logFunction, newFunctionName) => {
|
||||
content += this.generateLoggingFunction(newFunctionName, logFunction.name, logFunction.argCount);
|
||||
});
|
||||
content += '\n\' End of auto-generated functions\n'
|
||||
|
||||
program.setFile(loggingFilePath, content)
|
||||
}
|
||||
|
||||
generateLoggingFunction(newFunctionName: string, level: string, argCount: number) {
|
||||
const args: string[] = [];
|
||||
const argsParams: string[] = [];
|
||||
for (let i = 0; i < argCount; i++) {
|
||||
args.push(`arg${i}`);
|
||||
argsParams.push(`arg${i} as object`);
|
||||
}
|
||||
|
||||
const msg = args.map((arg) => {
|
||||
return `ToString(${arg})`;
|
||||
}).join(` + " " + `);
|
||||
|
||||
const func = logFunctions[level as 'LogError' | 'LogWarn' | 'LogInfo' | 'LogDebug'];
|
||||
|
||||
return `
|
||||
function ${newFunctionName}(${args.join(', ')}) as void
|
||||
logger = m.global.logger
|
||||
if logger.logLevel < ${func.level}
|
||||
return
|
||||
end if
|
||||
m.global.logger.logLine = "[${func.stringLevel}]" + ${msg}
|
||||
end function
|
||||
`;
|
||||
}
|
||||
}
|
||||
|
||||
export default () => {
|
||||
return new LoggerPlugin();
|
||||
};
|
||||
@@ -48,7 +48,7 @@ const logoOutput = {
|
||||
},
|
||||
};
|
||||
|
||||
const iconsInput = './playlet-app/src/images/vector/icons';
|
||||
const iconsInput = './playlet-lib/src/images/vector/icons';
|
||||
const iconsOutput = './playlet-lib/src/images/icons';
|
||||
|
||||
(async () => {
|
||||
|
||||
@@ -16,6 +16,7 @@ function getArgumentParser() {
|
||||
|
||||
parser.add_argument('--browser', { help: 'Use cookies from browser' });
|
||||
parser.add_argument('--invidious', { help: 'Invidious instance to sync to' });
|
||||
parser.add_argument('--invidious-token-file', { help: 'Invidious auth token. If provided, manual authorization will be skipped' });
|
||||
parser.add_argument('--output-file', { help: 'Write profile to Invidious JSON compatible file' });
|
||||
parser.add_argument('--playlist-limit', { help: 'Maximum playlist video count', type: 'int', default: 500 });
|
||||
|
||||
@@ -272,11 +273,13 @@ async function deleteAccessToken(invidiousInstance, token) {
|
||||
(async () => {
|
||||
let invidiousInstance = undefined
|
||||
let token = undefined;
|
||||
let unregisterToken = false;
|
||||
try {
|
||||
const parser = getArgumentParser()
|
||||
const args = parser.parse_args()
|
||||
|
||||
invidiousInstance = args.invidious
|
||||
invidiousTokenFile = args.invidious_token_file
|
||||
browser = args.browser
|
||||
outputFile = args.output_file
|
||||
playlistLimit = args.playlist_limit
|
||||
@@ -317,18 +320,22 @@ async function deleteAccessToken(invidiousInstance, token) {
|
||||
}
|
||||
}
|
||||
|
||||
token = await getAccessToken(invidiousInstance)
|
||||
if (!invidiousTokenFile) {
|
||||
token = await getAccessToken(invidiousInstance)
|
||||
unregisterToken = true;
|
||||
} else {
|
||||
token = fs.readFileSync(invidiousTokenFile, 'utf8');
|
||||
}
|
||||
|
||||
await deletePlaylists(invidiousInstance, token, playlistsToDelete)
|
||||
await importInvidiousProfile(invidiousInstance, token, profile);
|
||||
}
|
||||
|
||||
}
|
||||
catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
finally {
|
||||
if (token) {
|
||||
if (token && unregisterToken) {
|
||||
console.log("Deleting token")
|
||||
await deleteAccessToken(invidiousInstance, token)
|
||||
}
|
||||
|
||||