Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
93ea822f27 | ||
|
|
d73a03d3bf | ||
|
|
45736dd8ec | ||
|
|
90565ccb07 | ||
|
|
b72173f588 | ||
|
|
2d759c1c39 | ||
|
|
11fb644fc6 | ||
|
|
b076517c1b | ||
|
|
74082f406a | ||
|
|
f3aeb58b38 | ||
|
|
44ee6681c5 | ||
|
|
85e30c8b22 | ||
|
|
80d3d24e39 | ||
|
|
a7bdab30bc | ||
|
|
3858681b80 | ||
|
|
e0cf59d90f | ||
|
|
d9b8aaa222 | ||
|
|
b1a373f98d | ||
|
|
1078459eb7 | ||
|
|
14cc537032 | ||
|
|
db755c4158 | ||
|
|
ed068f6599 | ||
|
|
45011a54f0 | ||
|
|
8c71a5be88 | ||
|
|
d059fced58 | ||
|
|
ea2be153b0 | ||
|
|
7e5b2246fa | ||
|
|
a710a23444 | ||
|
|
a3b3a143a5 |
No files matched your search
+12
-3
@@ -5,6 +5,15 @@ All notable changes to this project will be documented in this file.
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [0.19.2] - 2024-02-11
|
||||
|
||||
### Fixed
|
||||
|
||||
- [Attempt #2] to fix a crash caused by execution timeout when stopping a video takes too long
|
||||
- Wrong hint on the "added to queue" notification when in fullscreen
|
||||
- A rare crash when listing Invidious public instances
|
||||
- Restoring video to full screen not working when on certain screens
|
||||
|
||||
## [0.19.1] - 2024-01-13
|
||||
|
||||
### Added
|
||||
@@ -348,7 +357,7 @@ This version went through a major refactor, which resulted in a different arcite
|
||||
- Dark mode
|
||||
- Also includes a dev menu
|
||||
- Hidden by default, use `dev=1` in the browser to show it
|
||||
- Improved drag and drop functionality (drag and drop a link from Youtube into the web app)
|
||||
- Improved drag and drop functionality (drag and drop a link from YouTube into the web app)
|
||||
- New settings page, available on TV and web app
|
||||
- New preferences system
|
||||
- Unified settings between TV and web app
|
||||
@@ -405,7 +414,7 @@ This version went through a major refactor, which resulted in a different arcite
|
||||
|
||||
### Added
|
||||
|
||||
- A script to sync between Youtube profile and and Invidious profile
|
||||
- A script to sync between YouTube profile and and Invidious profile
|
||||
- Moved most of Playlet logic to Playlet Lib
|
||||
- Support for multiple caption languages
|
||||
|
||||
@@ -453,7 +462,7 @@ This version went through a major refactor, which resulted in a different arcite
|
||||
- Loading spinner
|
||||
- Picture in picture support
|
||||
- [Deep linking support](https://developer.roku.com/en-ca/docs/developer-program/discovery/implementing-deep-linking.md)
|
||||
- Both Launch arguments and Input arguments are supported, using the "contentId" key as the Youtube video id
|
||||
- Both Launch arguments and Input arguments are supported, using the "contentId" key as the YouTube video id
|
||||
- Error and Exit dialogs
|
||||
|
||||
### Fixed
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
# Playlet
|
||||
|
||||
Playlet is an unofficial Youtube client for Roku 📺
|
||||
Playlet is an unofficial YouTube client for Roku 📺
|
||||
|
||||
## Screenshots
|
||||
|
||||
@@ -44,7 +44,7 @@ More under [Screenshots](./docs/screenshots/README.md)
|
||||
- ⚔️ SponsorBlock integration (skips undesirable sections in videos)
|
||||
- 📱 Browse, search, and cast from phone using the web app
|
||||
- 🔮 Picture-in-picture mode
|
||||
- ⚡ Fast! [Check out how we compare with the official Youtube app](https://youtu.be/qmSvA-QQW20)
|
||||
- ⚡ Fast! [Check out how we compare with the official YouTube app](https://youtu.be/qmSvA-QQW20)
|
||||
|
||||
### Cast from phone
|
||||
|
||||
@@ -76,7 +76,7 @@ For everything related to Playlet app development, please see the [documentation
|
||||
## Analytics and reporting
|
||||
|
||||
We do not collect any usage data, anonymous or not. But Roku does, and you can find the data made available to Playlet in the [Wiki](https://github.com/iBicha/playlet/wiki).
|
||||
Most software in the wild collect some data to make sure things work, and to prioritize features.
|
||||
Most software in the wild collect some data to make sure things work, and to prioritize features.
|
||||
Because we don't do that, we wouldn't know if people using Playlet are facing issues, unless these issues get reported.
|
||||
Playlet could run on variaty of devices, with different capabilities and screen sizes, and different Invidious instances.
|
||||
That's why it's important to report any issues you encouter using Playlet, otherwise it's unlikely that they get addressed.
|
||||
@@ -89,10 +89,10 @@ play•let /ˈplālət/
|
||||
: a short play
|
||||
```
|
||||
|
||||
**Playlet** is about keeping the time you spend on Youtube short and useful. It values your time, so it does not show you ads, and allows you to skip sponsored sections and other irrelevant information that's designed to monitize you and/or waste your time.
|
||||
**Playlet** is about keeping the time you spend on YouTube short and useful. It values your time, so it does not show you ads, and allows you to skip sponsored sections and other irrelevant information that's designed to monitize you and/or waste your time.
|
||||
|
||||
There's a cliché about how a lot of open source software is **`"Made with ♡"`**. This project in particular is **not**.<br/>
|
||||
**Playlet** was created out of **spite**, because I believe I have watched enough back-to-back, unskippable Youtube ads for a lifetime.
|
||||
**Playlet** was created out of **spite**, because I believe I have watched enough back-to-back, unskippable YouTube ads for a lifetime.
|
||||
|
||||
By removing all the bloat, the ads, the tracking, we could end up with an even faster app than the official one.
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"createPackage": false,
|
||||
"diagnosticFilters": [
|
||||
{
|
||||
"src": "**/*.part.xml",
|
||||
"src": "components/**/*.part.xml",
|
||||
"codes": [
|
||||
// 1067 - Cannot find function with name '${name}' in component scope
|
||||
// This is to prevent errors where the onChange function is not found in the component scope
|
||||
@@ -45,10 +45,11 @@
|
||||
"files": [
|
||||
"source/**",
|
||||
"components/**",
|
||||
"!components/**/*.part.xml",
|
||||
"images/**",
|
||||
"!**/*.psd",
|
||||
"!**/*.svg",
|
||||
"!**/*.svg.meta.json5",
|
||||
"fonts/**",
|
||||
"config/**",
|
||||
"lib/**",
|
||||
"www/**",
|
||||
@@ -71,7 +72,8 @@
|
||||
"../tools/bs-plugins/validation-plugin.ts",
|
||||
"../tools/bs-plugins/logger-plugin.ts",
|
||||
"../tools/bs-plugins/image-gen-plugin.ts",
|
||||
"../tools/bs-plugins/type-gen-plugin.ts"
|
||||
"../tools/bs-plugins/type-gen-plugin.ts",
|
||||
"../tools/bs-plugins/web-server-plugin.ts"
|
||||
],
|
||||
"retainStagingDir": true,
|
||||
"require": [
|
||||
|
||||
@@ -3,10 +3,11 @@
|
||||
"files": [
|
||||
"source/**",
|
||||
"components/**",
|
||||
"!components/**/*.part.xml",
|
||||
"images/**",
|
||||
"!**/*.psd",
|
||||
"!**/*.svg",
|
||||
"!**/*.svg.meta.json5",
|
||||
"fonts/**",
|
||||
"config/**",
|
||||
"lib/**",
|
||||
"www/**",
|
||||
@@ -27,7 +28,8 @@
|
||||
"../tools/bs-plugins/validation-plugin.ts",
|
||||
"../tools/bs-plugins/logger-plugin.ts",
|
||||
"../tools/bs-plugins/image-gen-plugin.ts",
|
||||
"../tools/bs-plugins/type-gen-plugin.ts"
|
||||
"../tools/bs-plugins/type-gen-plugin.ts",
|
||||
"../tools/bs-plugins/web-server-plugin.ts"
|
||||
],
|
||||
"rooibos": {
|
||||
"logLevel": 2,
|
||||
|
||||
+1
-1
@@ -142,7 +142,7 @@ That's pretty much it.
|
||||
|
||||
There are a few reasons we made this separation:
|
||||
|
||||
- Playlet relies on [Invidious](https://github.com/iv-org/invidious). Invidious tries to keep up with Youtube making changes to their platform, but sometimes, a breaking change happens that requires Playlet to react quickly. Releasing through the Roku Channel store can take days, or a week. During this time, Playlet would be not functional, and that's not acceptable.
|
||||
- Playlet relies on [Invidious](https://github.com/iv-org/invidious). Invidious tries to keep up with YouTube making changes to their platform, but sometimes, a breaking change happens that requires Playlet to react quickly. Releasing through the Roku Channel store can take days, or a week. During this time, Playlet would be not functional, and that's not acceptable.
|
||||
- The ability to roll back: Sometimes an app breaking bug gets released. Allowing users to choose a seperate version is a flexible way to keep things working. For example, it's possible to choose a different verrsion from the developer settings in the web app.
|
||||
- It is simply easier to release: Releasing Playlet Lib on Github, and everyone receives the latest version immediately, is very conveninct and less of a hassle, than going through the Roku Channel store.
|
||||
- I've had instances where I was trying to pass the certfication for Playlet to publish it. One of the criterias is to pass a some automated tests. But the tests were failing because their system could not connect to their Roku test devices (connection keeps timing out). My only option was to keep trying over and over until it worked.
|
||||
|
||||
@@ -2,7 +2,7 @@ openapi: 3.0.0
|
||||
|
||||
info:
|
||||
title: Playlet Web API
|
||||
version: 0.19.1
|
||||
version: 0.19.2
|
||||
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
|
||||
@@ -106,7 +106,7 @@ paths:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
put:
|
||||
post:
|
||||
summary: Add to search history
|
||||
description: |
|
||||
Add a query to the search history.
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
- [Tracking transpilied files](#tracking-transpilied-files)
|
||||
- [Logger](#logger)
|
||||
- [Type Gen](#type-gen)
|
||||
- [Web Server](#web-server)
|
||||
|
||||
Playlet implements a few [Brighterscript Plugins](https://github.com/rokucommunity/brighterscript/blob/master/docs/plugins.md). The plugins inject themselves in the compilation process, allowing the modification of bs scripts, xml components, and even assets or the app manifest. Let's start with a simple one:
|
||||
|
||||
@@ -571,3 +572,33 @@ function ValidBool(obj as dynamic) as boolean
|
||||
end if
|
||||
end function
|
||||
```
|
||||
|
||||
## Web Server
|
||||
|
||||
**[Source](/tools/bs-plugins/web-server-plugin.ts)**
|
||||
|
||||
### Why
|
||||
|
||||
Handles routing annotations (e.g. `@get("/api/something")) so that they are handled by the routers/middlewares. It's nicer than having to register things by hand.
|
||||
|
||||
### How
|
||||
|
||||
Routers need to inherit from `Http.HttpRouter`. Then, once a request handled is annotated, e.g.
|
||||
|
||||
```bs
|
||||
@get("/")
|
||||
function GoHome(context as object) as boolean
|
||||
response = context.response
|
||||
response.Redirect("/index.html")
|
||||
return true
|
||||
end function
|
||||
```
|
||||
|
||||
The route and the handler are added to the router. In this example, the `/` route redirects to `index/html`.
|
||||
|
||||
There one special annotation, and one special route:
|
||||
|
||||
- `@all` matches all methods
|
||||
- `*` matches all paths
|
||||
|
||||
So `@all(*)` would be a middleware that will be matched with any request.
|
||||
Generated
+43
-116
@@ -1,36 +1,36 @@
|
||||
{
|
||||
"name": "playlet",
|
||||
"version": "0.19.1",
|
||||
"version": "0.19.2",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "playlet",
|
||||
"version": "0.19.1",
|
||||
"version": "0.19.2",
|
||||
"hasInstallScript": true,
|
||||
"devDependencies": {
|
||||
"@rokucommunity/bslint": "^0.8.14",
|
||||
"@types/crypto-js": "^4.2.1",
|
||||
"@rokucommunity/bslint": "^0.8.17",
|
||||
"@types/crypto-js": "^4.2.2",
|
||||
"@types/fs-extra": "^11.0.4",
|
||||
"@types/node": "^20.11.0",
|
||||
"@types/node": "^20.11.17",
|
||||
"@types/xml2js": "^0.4.14",
|
||||
"argparse": "^2.0.1",
|
||||
"brighterscript": "0.65.16",
|
||||
"brighterscript-formatter": "^1.6.37",
|
||||
"brighterscript": "0.65.22",
|
||||
"brighterscript-formatter": "^1.6.40",
|
||||
"convert-svg-to-png": "^0.6.4",
|
||||
"cross-fetch": "^4.0.0",
|
||||
"crypto-js": "^4.2.0",
|
||||
"dotenv": "^16.3.1",
|
||||
"dotenv": "^16.4.1",
|
||||
"express": "^4.18.2",
|
||||
"fs-extra": "^11.2.0",
|
||||
"glob": "^10.3.10",
|
||||
"imap": "^0.8.19",
|
||||
"ip": "^1.1.8",
|
||||
"json5": "^2.2.3",
|
||||
"mailparser": "^3.6.6",
|
||||
"mailparser": "^3.6.7",
|
||||
"roku-deploy": "^3.11.2",
|
||||
"rooibos-roku": "^5.10.0",
|
||||
"semver": "^7.5.4",
|
||||
"rooibos-roku": "^5.11.0",
|
||||
"semver": "^7.6.0",
|
||||
"shelljs": "^0.8.5",
|
||||
"ts-node": "^10.9.2",
|
||||
"typescript": "^5.3.3",
|
||||
@@ -276,9 +276,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@rokucommunity/bslint": {
|
||||
"version": "0.8.14",
|
||||
"resolved": "https://registry.npmjs.org/@rokucommunity/bslint/-/bslint-0.8.14.tgz",
|
||||
"integrity": "sha512-vKD2weW5I8jOXe+2xHN9FZ9GUCkbE/FOTbWcziLXrObraXJZcNRqk+fWDvi7go79ourQ/9DmYfmFH0bocjOMqg==",
|
||||
"version": "0.8.17",
|
||||
"resolved": "https://registry.npmjs.org/@rokucommunity/bslint/-/bslint-0.8.17.tgz",
|
||||
"integrity": "sha512-e0ksPVYnN+QkhzuV97yPTf1NxSkBQZNMJRhlCFnMJf6gfps+VdY1HwYn3IlqDz3XJxfYcRSDa3v3fQ5dQynVEA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"fs-extra": "^10.0.0",
|
||||
@@ -345,9 +345,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@types/crypto-js": {
|
||||
"version": "4.2.1",
|
||||
"resolved": "https://registry.npmjs.org/@types/crypto-js/-/crypto-js-4.2.1.tgz",
|
||||
"integrity": "sha512-FSPGd9+OcSok3RsM0UZ/9fcvMOXJ1ENE/ZbLfOPlBWj7BgXtEAM8VYfTtT760GiLbQIMoVozwVuisjvsVwqYWw==",
|
||||
"version": "4.2.2",
|
||||
"resolved": "https://registry.npmjs.org/@types/crypto-js/-/crypto-js-4.2.2.tgz",
|
||||
"integrity": "sha512-sDOLlVbHhXpAUAL0YHDUUwDZf3iN4Bwi4W6a0W0b+QcAezUbRtH4FVb+9J4h+XFPW7l/gQ9F8qC7P+Ec4k8QVQ==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@types/fs-extra": {
|
||||
@@ -370,9 +370,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@types/node": {
|
||||
"version": "20.11.0",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.0.tgz",
|
||||
"integrity": "sha512-o9bjXmDNcF7GbM4CNQpmi+TutCgap/K3w1JyKgxAjqx41zp9qlIAVFi0IhCNsJcXolEqLWhbFbEeL0PvYm4pcQ==",
|
||||
"version": "20.11.17",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.17.tgz",
|
||||
"integrity": "sha512-QmgQZGWu1Yw9TDyAP9ZzpFJKynYNeOvwMJmaxABfieQoVoiVOS6MN1WSpqpRcbeA5+RW82kraAVxCCJg+780Qw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"undici-types": "~5.26.4"
|
||||
@@ -728,9 +728,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/brighterscript": {
|
||||
"version": "0.65.16",
|
||||
"resolved": "https://registry.npmjs.org/brighterscript/-/brighterscript-0.65.16.tgz",
|
||||
"integrity": "sha512-2RJMF8itkrPXtZ92JkJf3emvzcCl5ETXGVyPsdO/hMKbUGinEGMRFG07FR0bzjRotbALzsozGE/Hjzw412Sjww==",
|
||||
"version": "0.65.22",
|
||||
"resolved": "https://registry.npmjs.org/brighterscript/-/brighterscript-0.65.22.tgz",
|
||||
"integrity": "sha512-rDSdO33xRnFGB9nr54awTUucpd4oZpZmDMvVUSAb6jmFU1jz+SYhwV9ezc8U5m3Kswap7uV+BmS1O69QZ9MuSw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@rokucommunity/bslib": "^0.1.1",
|
||||
@@ -740,7 +740,6 @@
|
||||
"chevrotain": "^7.0.1",
|
||||
"chokidar": "^3.5.1",
|
||||
"clear": "^0.1.0",
|
||||
"coveralls-next": "^4.2.0",
|
||||
"cross-platform-clear-console": "^2.3.0",
|
||||
"debounce-promise": "^3.1.0",
|
||||
"eventemitter3": "^4.0.0",
|
||||
@@ -771,12 +770,12 @@
|
||||
}
|
||||
},
|
||||
"node_modules/brighterscript-formatter": {
|
||||
"version": "1.6.37",
|
||||
"resolved": "https://registry.npmjs.org/brighterscript-formatter/-/brighterscript-formatter-1.6.37.tgz",
|
||||
"integrity": "sha512-jIlqRjPVIp2WwB9Pe0YwK4KU4G3WqhRsqRluuOFY1sTDVW0R/AKXMvCfTsu99L2W7CbpeWA4UjOPzl9JOqN5hw==",
|
||||
"version": "1.6.40",
|
||||
"resolved": "https://registry.npmjs.org/brighterscript-formatter/-/brighterscript-formatter-1.6.40.tgz",
|
||||
"integrity": "sha512-cxvGGluNfxy6p3khtcMt/3AschwqEnERjLRIEt3XVU0R0l2QgwXelDp8ViqgnQ2hQYa8LnfnOiV1u7OCqbiZPA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"brighterscript": "^0.65.16",
|
||||
"brighterscript": "^0.65.19",
|
||||
"glob-all": "^3.3.0",
|
||||
"jsonc-parser": "^3.0.0",
|
||||
"source-map": "^0.7.3",
|
||||
@@ -1479,25 +1478,6 @@
|
||||
"integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/coveralls-next": {
|
||||
"version": "4.2.0",
|
||||
"resolved": "https://registry.npmjs.org/coveralls-next/-/coveralls-next-4.2.0.tgz",
|
||||
"integrity": "sha512-zg41a/4QDSASPtlV6gp+6owoU43U5CguxuPZR3nPZ26M5ZYdEK3MdUe7HwE+AnCZPkucudfhqqJZehCNkz2rYg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"form-data": "4.0.0",
|
||||
"js-yaml": "4.1.0",
|
||||
"lcov-parse": "1.0.0",
|
||||
"log-driver": "1.2.7",
|
||||
"minimist": "1.2.7"
|
||||
},
|
||||
"bin": {
|
||||
"coveralls": "bin/coveralls.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14"
|
||||
}
|
||||
},
|
||||
"node_modules/create-require": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz",
|
||||
@@ -1726,9 +1706,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/dotenv": {
|
||||
"version": "16.3.1",
|
||||
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.3.1.tgz",
|
||||
"integrity": "sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ==",
|
||||
"version": "16.4.1",
|
||||
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.1.tgz",
|
||||
"integrity": "sha512-CjA3y+Dr3FyFDOAMnxZEGtnW9KBR2M0JvvUtXNW+dYJL5ROWxP9DUHCwgFqpMk0OXCc0ljhaNTr2w/kutYIcHQ==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
@@ -2103,20 +2083,6 @@
|
||||
"node": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/form-data": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz",
|
||||
"integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"asynckit": "^0.4.0",
|
||||
"combined-stream": "^1.0.8",
|
||||
"mime-types": "^2.1.12"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 6"
|
||||
}
|
||||
},
|
||||
"node_modules/forwarded": {
|
||||
"version": "0.2.0",
|
||||
"resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz",
|
||||
@@ -2745,18 +2711,6 @@
|
||||
"@pkgjs/parseargs": "^0.11.0"
|
||||
}
|
||||
},
|
||||
"node_modules/js-yaml": {
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz",
|
||||
"integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"argparse": "^2.0.1"
|
||||
},
|
||||
"bin": {
|
||||
"js-yaml": "bin/js-yaml.js"
|
||||
}
|
||||
},
|
||||
"node_modules/jsbn": {
|
||||
"version": "0.1.1",
|
||||
"resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz",
|
||||
@@ -2838,15 +2792,6 @@
|
||||
"setimmediate": "^1.0.5"
|
||||
}
|
||||
},
|
||||
"node_modules/lcov-parse": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/lcov-parse/-/lcov-parse-1.0.0.tgz",
|
||||
"integrity": "sha512-aprLII/vPzuQvYZnDRU78Fns9I2Ag3gi4Ipga/hxnVMCZC8DnR2nI7XBqrPoywGfxqIx/DgarGvDJZAD3YBTgQ==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"lcov-parse": "bin/cli.js"
|
||||
}
|
||||
},
|
||||
"node_modules/leac": {
|
||||
"version": "0.6.0",
|
||||
"resolved": "https://registry.npmjs.org/leac/-/leac-0.6.0.tgz",
|
||||
@@ -2940,15 +2885,6 @@
|
||||
"integrity": "sha512-hXt6Ul/5yWjfklSGvLQl8vM//l3FtyHZeuelpzK6mm99pNvN9yTDruNZPEJZD1oWrqo+izBmB7oUfWgcCX7s4Q==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/log-driver": {
|
||||
"version": "1.2.7",
|
||||
"resolved": "https://registry.npmjs.org/log-driver/-/log-driver-1.2.7.tgz",
|
||||
"integrity": "sha512-U7KCmLdqsGHBLeWqYlFA0V0Sl6P08EE1ZrmA9cxjUE0WVqT9qnyVDPz1kzpFEP0jdJuFnasWIfSd7fsaNXkpbg==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=0.8.6"
|
||||
}
|
||||
},
|
||||
"node_modules/long": {
|
||||
"version": "3.2.0",
|
||||
"resolved": "https://registry.npmjs.org/long/-/long-3.2.0.tgz",
|
||||
@@ -2980,9 +2916,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/mailparser": {
|
||||
"version": "3.6.6",
|
||||
"resolved": "https://registry.npmjs.org/mailparser/-/mailparser-3.6.6.tgz",
|
||||
"integrity": "sha512-noCjBl3FToxmqTP2fp7z17hQsiCroWNntfTd8O+UejOAF59xeN5WGZK27ilexXV2e2X/cbUhG3L8sfEKaz0/sw==",
|
||||
"version": "3.6.7",
|
||||
"resolved": "https://registry.npmjs.org/mailparser/-/mailparser-3.6.7.tgz",
|
||||
"integrity": "sha512-/3x8HW70DNehw+3vdOPKdlLuxOHoWcGB5jfx5vJ5XUbY9/2jUJbrrhda5Si8Dj/3w08U0y5uGAkqs5+SPTPKoA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"encoding-japanese": "2.0.0",
|
||||
@@ -2992,7 +2928,7 @@
|
||||
"libmime": "5.2.1",
|
||||
"linkify-it": "5.0.0",
|
||||
"mailsplit": "5.4.0",
|
||||
"nodemailer": "6.9.8",
|
||||
"nodemailer": "6.9.9",
|
||||
"tlds": "1.248.0"
|
||||
}
|
||||
},
|
||||
@@ -3140,15 +3076,6 @@
|
||||
"node": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/minimist": {
|
||||
"version": "1.2.7",
|
||||
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.7.tgz",
|
||||
"integrity": "sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==",
|
||||
"dev": true,
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/mkdirp-classic": {
|
||||
"version": "0.5.3",
|
||||
"resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz",
|
||||
@@ -3200,9 +3127,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/nodemailer": {
|
||||
"version": "6.9.8",
|
||||
"resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-6.9.8.tgz",
|
||||
"integrity": "sha512-cfrYUk16e67Ks051i4CntM9kshRYei1/o/Gi8K1d+R34OIs21xdFnW7Pt7EucmVKA0LKtqUGNcjMZ7ehjl49mQ==",
|
||||
"version": "6.9.9",
|
||||
"resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-6.9.9.tgz",
|
||||
"integrity": "sha512-dexTll8zqQoVJEZPwQAKzxxtFn0qTnjdQTchoU6Re9BUUGBJiOy3YMn/0ShTW6J5M0dfQ1NeDeRTTl4oIWgQMA==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=6.0.0"
|
||||
@@ -3994,9 +3921,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/rooibos-roku": {
|
||||
"version": "5.10.0",
|
||||
"resolved": "https://registry.npmjs.org/rooibos-roku/-/rooibos-roku-5.10.0.tgz",
|
||||
"integrity": "sha512-Idiv3nWQOEr5V8z8oHcIovjcoBffgqRtTQ5B6K+x/cGAouKxyVJp0fsZ80xQvUul9IwHQ0XIPUYbNWCR3RQ3sA==",
|
||||
"version": "5.11.0",
|
||||
"resolved": "https://registry.npmjs.org/rooibos-roku/-/rooibos-roku-5.11.0.tgz",
|
||||
"integrity": "sha512-qxTYwsyp6Ihb6B8tmFm+24DE/s2gMCxagvdABElGWgqL834M+kZtmwrQXvSrMkM+0gkmQfIDuw1M4v484gycYQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"source-map": "^0.7.3",
|
||||
@@ -4110,9 +4037,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/semver": {
|
||||
"version": "7.5.4",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz",
|
||||
"integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==",
|
||||
"version": "7.6.0",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz",
|
||||
"integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"lru-cache": "^6.0.0"
|
||||
|
||||
+15
-12
@@ -1,30 +1,30 @@
|
||||
{
|
||||
"name": "playlet",
|
||||
"version": "0.19.1",
|
||||
"description": "Unofficial Youtube client for Roku",
|
||||
"version": "0.19.2",
|
||||
"description": "Unofficial YouTube client for Roku",
|
||||
"devDependencies": {
|
||||
"@rokucommunity/bslint": "^0.8.14",
|
||||
"@types/crypto-js": "^4.2.1",
|
||||
"@rokucommunity/bslint": "^0.8.17",
|
||||
"@types/crypto-js": "^4.2.2",
|
||||
"@types/fs-extra": "^11.0.4",
|
||||
"@types/node": "^20.11.0",
|
||||
"@types/node": "^20.11.17",
|
||||
"@types/xml2js": "^0.4.14",
|
||||
"argparse": "^2.0.1",
|
||||
"brighterscript": "0.65.16",
|
||||
"brighterscript-formatter": "^1.6.37",
|
||||
"brighterscript": "0.65.22",
|
||||
"brighterscript-formatter": "^1.6.40",
|
||||
"convert-svg-to-png": "^0.6.4",
|
||||
"cross-fetch": "^4.0.0",
|
||||
"crypto-js": "^4.2.0",
|
||||
"dotenv": "^16.3.1",
|
||||
"dotenv": "^16.4.1",
|
||||
"express": "^4.18.2",
|
||||
"fs-extra": "^11.2.0",
|
||||
"glob": "^10.3.10",
|
||||
"imap": "^0.8.19",
|
||||
"ip": "^1.1.8",
|
||||
"json5": "^2.2.3",
|
||||
"mailparser": "^3.6.6",
|
||||
"mailparser": "^3.6.7",
|
||||
"roku-deploy": "^3.11.2",
|
||||
"rooibos-roku": "^5.10.0",
|
||||
"semver": "^7.5.4",
|
||||
"rooibos-roku": "^5.11.0",
|
||||
"semver": "^7.6.0",
|
||||
"shelljs": "^0.8.5",
|
||||
"ts-node": "^10.9.2",
|
||||
"typescript": "^5.3.3",
|
||||
@@ -65,6 +65,9 @@
|
||||
"generate-sponsorblock-config": "node tools/generate-sponsorblock-config.js",
|
||||
"update-rale-component": "cd tools/RALE && rm TrackerTask.xml && curl -o TrackerTask.zip https://devtools.web.roku.com/roku-advanced-layout-editor/app/TrackerTask.zip && unzip TrackerTask.zip && rm TrackerTask.zip",
|
||||
"postinstall": "cd playlet-lib && npm install && cd ../playlet-app && npm install && cd ../playlet-web && npm install",
|
||||
"update-deps": "npx npm-check-updates -u && cd playlet-app && npx npm-check-updates -u && cd ../playlet-lib && npx npm-check-updates -u && cd ../playlet-web && npx npm-check-updates -u"
|
||||
"update-deps": "npx npm-check-updates -u && cd playlet-app && npx npm-check-updates -u && cd ../playlet-lib && npx npm-check-updates -u && cd ../playlet-web && npx npm-check-updates -u",
|
||||
"registry:write": "node tools/registry.js --input registry.json",
|
||||
"registry:read": "node tools/registry.js --output registry.json",
|
||||
"registry:clear": "node tools/registry.js --clear"
|
||||
}
|
||||
}
|
||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "playlet-app",
|
||||
"version": "0.19.1",
|
||||
"version": "0.19.2",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "playlet-app",
|
||||
"version": "0.19.1"
|
||||
"version": "0.19.2"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "playlet-app",
|
||||
"version": "0.19.1",
|
||||
"description": "Unofficial Youtube client for Roku",
|
||||
"version": "0.19.2",
|
||||
"description": "Unofficial YouTube client for Roku",
|
||||
"scripts": {
|
||||
"prebuild": "rm -rf build/playlet-app",
|
||||
"prebuild:dev": "npm run prebuild",
|
||||
|
||||
@@ -109,5 +109,5 @@ function ShowPlayletLibLoadErrorDialog()
|
||||
"If the problem persist, contact Playlet authors."
|
||||
]
|
||||
|
||||
Dialog.ShowError(message, bulletText, bottomText)
|
||||
DialogShowError(message, bulletText, bottomText)
|
||||
end function
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 76 KiB |
Binary file not shown.
@@ -3,7 +3,7 @@ title=Playlet
|
||||
# Do not update version manually, it is auto updated from package.json
|
||||
major_version=0
|
||||
minor_version=19
|
||||
build_version=00001
|
||||
build_version=00002
|
||||
|
||||
ui_resolutions=hd
|
||||
|
||||
|
||||
@@ -1,45 +1,38 @@
|
||||
namespace Dialog
|
||||
function DialogShowError(message as object, bulletText as object, bottomMessage as object)
|
||||
' Note: dialog can be null since StandardMessageDialog is only available on 10.0 and later
|
||||
msgDialog = CreateObject("roSGNode", "StandardMessageDialog")
|
||||
DialogSetPalette(msgDialog)
|
||||
msgDialog.message = message
|
||||
msgDialog.bulletText = bulletText
|
||||
msgDialog.bottomMessage = bottomMessage
|
||||
msgDialog.title = "Error loading Playlet"
|
||||
msgDialog.buttons = ["Exit"]
|
||||
|
||||
function ShowError(message as object, bulletText as object, bottomMessage as object)
|
||||
' Note: dialog can be null since StandardMessageDialog is only available on 10.0 and later
|
||||
msgDialog = CreateObject("roSGNode", "StandardMessageDialog")
|
||||
SetPalette(msgDialog)
|
||||
msgDialog.message = message
|
||||
msgDialog.bulletText = bulletText
|
||||
msgDialog.bottomMessage = bottomMessage
|
||||
msgDialog.title = "Error loading Playlet"
|
||||
msgDialog.buttons = ["Exit"]
|
||||
' bs:disable-next-line NO_OBSERVE_STRING_CALLBACK
|
||||
msgDialog.observeField("buttonSelected", "DialogOnButtonSelected")
|
||||
' bs:disable-next-line NO_OBSERVE_STRING_CALLBACK
|
||||
msgDialog.observeField("wasClosed", "DialogOnClosed")
|
||||
|
||||
' bs:disable-next-line NO_OBSERVE_STRING_CALLBACK
|
||||
msgDialog.observeField("buttonSelected", "OnButtonSelected")
|
||||
' bs:disable-next-line NO_OBSERVE_STRING_CALLBACK
|
||||
msgDialog.observeField("wasClosed", "OnDialogClosed")
|
||||
m.top.getScene().dialog = msgDialog
|
||||
end function
|
||||
|
||||
m.top.getScene().dialog = msgDialog
|
||||
end function
|
||||
function DialogSetPalette(msgDialog as object)
|
||||
palette = createObject("roSGNode", "RSGPalette")
|
||||
palette.colors = {
|
||||
DialogBackgroundColor: "#242424FF"
|
||||
DialogFocusColor: "#CECECEFF"
|
||||
DialogFocusItemColor: "#202020FF"
|
||||
DialogSecondaryTextColor: "#DBDBDBFF"
|
||||
DialogSecondaryItemColor: "#FF1C30FF"
|
||||
DialogTextColor: "#DBDBDBFF"
|
||||
}
|
||||
msgDialog.palette = palette
|
||||
end function
|
||||
|
||||
function SetPalette(msgDialog as object)
|
||||
palette = createObject("roSGNode", "RSGPalette")
|
||||
palette.colors = {
|
||||
DialogBackgroundColor: "#242424FF"
|
||||
DialogFocusColor: "#CECECEFF"
|
||||
DialogFocusItemColor: "#202020FF"
|
||||
DialogSecondaryTextColor: "#DBDBDBFF"
|
||||
DialogSecondaryItemColor: "#FF1C30FF"
|
||||
DialogTextColor: "#DBDBDBFF"
|
||||
}
|
||||
msgDialog.palette = palette
|
||||
end function
|
||||
|
||||
function OnButtonSelected()
|
||||
m.top.getScene().dialog.close = true
|
||||
end function
|
||||
|
||||
function OnDialogClosed()
|
||||
' TODO:P1 throw an exception to cause a crash report to be generated
|
||||
' Should include which playlet lib failed to load
|
||||
m.top.getScene().exitChannel = true
|
||||
end function
|
||||
|
||||
end namespace
|
||||
function DialogOnButtonSelected()
|
||||
m.top.getScene().dialog.close = true
|
||||
end function
|
||||
|
||||
function DialogOnClosed()
|
||||
m.top.getScene().exitChannel = true
|
||||
end function
|
||||
@@ -45,7 +45,7 @@ function Main(args as object) as void
|
||||
input = CreateObject("roInput")
|
||||
input.setMessagePort(port)
|
||||
|
||||
' TODO:P1 follow up on bug where roSystemLog does not fire for a video player in ComponentLibrary
|
||||
' TODO:P2 follow up on bug where roSystemLog does not fire for a video player in ComponentLibrary
|
||||
' https://community.roku.com/t5/Roku-Developer-Program/BUG-roSystemLog-not-firing-with-ComponentLibrary/td-p/906075
|
||||
systemLog = CreateObject("roSystemLog")
|
||||
systemLog.SetMessagePort(port)
|
||||
|
||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "playlet-lib",
|
||||
"version": "0.19.1",
|
||||
"version": "0.19.2",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "playlet-lib",
|
||||
"version": "0.19.1"
|
||||
"version": "0.19.2"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "playlet-lib",
|
||||
"version": "0.19.1",
|
||||
"description": "Unofficial Youtube client for Roku",
|
||||
"version": "0.19.2",
|
||||
"description": "Unofficial YouTube client for Roku",
|
||||
"scripts": {
|
||||
"prebuild": "rm -rf build/playlet-lib",
|
||||
"prebuild:dev": "npm run prebuild",
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
translation="[115,20]"
|
||||
width="104"
|
||||
height="104"
|
||||
uri="pkg:/images/circle-mask-500.png">
|
||||
uri="pkg:/images/white-circle.png">
|
||||
|
||||
<CirclePoster
|
||||
id="thumbnail"
|
||||
|
||||
@@ -10,13 +10,13 @@
|
||||
<field id="failedBitmapUri" type="uri" alias="Poster.failedBitmapUri" />
|
||||
<field id="loadStatus" type="string" alias="Poster.loadStatus" />
|
||||
|
||||
<field id="maskUri" type="uri" value="pkg:/images/circle-mask-500.png" alias="MaskGroup.maskuri" />
|
||||
<field id="maskUri" type="uri" value="pkg:/images/white-circle.png" alias="MaskGroup.maskuri" />
|
||||
<field id="maskSize" type="vector2d" alias="MaskGroup.maskSize" />
|
||||
</interface>
|
||||
<children>
|
||||
<MaskGroup
|
||||
id="MaskGroup"
|
||||
maskuri="pkg:/images/circle-mask-500.png">
|
||||
maskuri="pkg:/images/white-circle.png">
|
||||
<Poster
|
||||
id="Poster" />
|
||||
</MaskGroup>
|
||||
|
||||
@@ -163,6 +163,17 @@ function OnkeyEvent(key as string, press as boolean) as boolean
|
||||
Close()
|
||||
return true
|
||||
end if
|
||||
|
||||
if key = "up"
|
||||
m.optionsList.jumpToItem = m.optionsList.content.getChildCount() - 1
|
||||
return true
|
||||
end if
|
||||
|
||||
if key = "down"
|
||||
m.optionsList.jumpToItem = 0
|
||||
return true
|
||||
end if
|
||||
|
||||
return false
|
||||
end function
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<StdDlgTitleArea primaryTitle="Login to Invidious" />
|
||||
<StdDlgContentArea>
|
||||
<StdDlgTextItem
|
||||
text="Login to Invidious in order to view Subscriptions, Playlists, and use the Watch history." />
|
||||
text="Login to Invidious in order to view Subscriptions, Playlists, and use the Watch history.

Please note that an Invidious account is different from a YouTube account." />
|
||||
</StdDlgContentArea>
|
||||
<StdDlgButtonArea id="buttonArea">
|
||||
<StdDlgButton text="OK" />
|
||||
|
||||
@@ -15,7 +15,11 @@ function Init()
|
||||
|
||||
m.port = port
|
||||
|
||||
StartLogger(m.top)
|
||||
#if DEBUG
|
||||
StartLogger(m.top, LogLevel.Debug)
|
||||
#else
|
||||
StartLogger(m.top, LogLevel.Info)
|
||||
#end if
|
||||
end function
|
||||
|
||||
function StartLogger(logger as object, logLevel = LogLevel.Info as LogLevel) as void
|
||||
|
||||
@@ -24,4 +24,5 @@ end function
|
||||
function StartWebServer()
|
||||
m.webServer = m.top.findNode("WebServer")
|
||||
m.webServer.callfunc("StartServer", invalid)
|
||||
end function'//# sourceMappingURL=./MainScene.bs.map
|
||||
end function
|
||||
'//# sourceMappingURL=./MainScene.brs.map
|
||||
@@ -8,6 +8,7 @@
|
||||
</interface>
|
||||
<script type="text/brightscript" uri="pkg:/components/parts/AutoBind/AutoBind.part.brs" />
|
||||
<script type="text/brightscript" uri="pkg:/components/MainScene_bindings.brs" />
|
||||
<script type="text/brightscript" uri="pkg:/source/utils/NodePathUtils.brs" />
|
||||
<script type="text/brightscript" uri="pkg:/components/MainScene.brs" />
|
||||
<script type="text/brightscript" uri="pkg:/source/utils/LoadingScreen.brs" />
|
||||
<script type="text/brightscript" uri="pkg:/components/parts/AutoBind/OnNodeReadyNoOp.brs" />
|
||||
|
||||
@@ -36,4 +36,5 @@ function InitializeBindings()
|
||||
}
|
||||
}
|
||||
}
|
||||
end function'//# sourceMappingURL=./MainScene_bindings.bs.map
|
||||
end function
|
||||
'//# sourceMappingURL=./MainScene_bindings.brs.map
|
||||
@@ -3,6 +3,7 @@
|
||||
<field id="content" type="node" onChange="OnContentSet" />
|
||||
<field id="thumbnail" type="uri" alias="thumbnailPoster.uri" />
|
||||
<field id="line1" type="string" alias="line1Label.text" />
|
||||
<field id="hintVisible" type="boolean" alias="hintLabel.visible" />
|
||||
<field id="show" type="boolean" alwaysNotify="true" onChange="OnShow" />
|
||||
</interface>
|
||||
<children>
|
||||
@@ -41,6 +42,7 @@
|
||||
wrap="true" />
|
||||
</LayoutGroup>
|
||||
<Label
|
||||
id="hintLabel"
|
||||
width="480"
|
||||
font="font:SmallestSystemFont"
|
||||
color="0x262626ff"
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
namespace PlayQueue
|
||||
const NOTIFICATION_NODE_ID = "PlayQueueNotification"
|
||||
|
||||
function ShowNotifcation(notifications as object, contentNode as object) as void
|
||||
function ShowNotifcation(notifications as object, contentNode as object, hintVisible as boolean) as void
|
||||
notification = notifications.findNode(NOTIFICATION_NODE_ID)
|
||||
if notification = invalid
|
||||
notification = notifications.createChild("PlayQueueNotification")
|
||||
notification.id = NOTIFICATION_NODE_ID
|
||||
end if
|
||||
notification.content = contentNode
|
||||
notification.hintVisible = hintVisible
|
||||
notification.show = true
|
||||
end function
|
||||
|
||||
|
||||
@@ -42,7 +42,8 @@ function AddToQueue(node as object)
|
||||
m.content.appendChild(node)
|
||||
queueNotifications = m.top.preferences["misc.queue_notifications"]
|
||||
if queueNotifications
|
||||
PlayQueue.ShowNotifcation(m.top.notifications, node)
|
||||
hintVisible = VideoUtils.GetVideoPlayer() = invalid or not VideoUtils.IsVideoPlayerFullScreen()
|
||||
PlayQueue.ShowNotifcation(m.top.notifications, node, hintVisible)
|
||||
end if
|
||||
end function
|
||||
|
||||
|
||||
@@ -252,7 +252,7 @@ function OnkeyEvent(key as string, press as boolean) as boolean
|
||||
return true
|
||||
end if
|
||||
|
||||
if key = "options" and press
|
||||
if key = "options"
|
||||
' A pass-through to the app controller, so it can toggle picture-in-picture
|
||||
return false
|
||||
end if
|
||||
|
||||
+9
-3
@@ -1,5 +1,6 @@
|
||||
import "pkg:/components/Navigation/Navigation.bs"
|
||||
import "pkg:/components/parts/AutoBind/OnNodeReadyNoOp.bs"
|
||||
import "pkg:/source/utils/Logging.bs"
|
||||
import "pkg:/source/utils/MathUtils.bs"
|
||||
import "pkg:/source/utils/Types.bs"
|
||||
|
||||
@@ -49,7 +50,7 @@ function OnkeyEvent(key as string, press as boolean) as boolean
|
||||
return true
|
||||
end if
|
||||
|
||||
if key = "options" and press
|
||||
if key = "options"
|
||||
' A pass-through to the app controller, so it can toggle picture-in-picture
|
||||
return false
|
||||
end if
|
||||
@@ -69,9 +70,14 @@ function OnValueChange()
|
||||
nodes = []
|
||||
checkedState = []
|
||||
for each item in value
|
||||
feed = m.homeLayout[item.id]
|
||||
if feed = invalid
|
||||
LogWarn("unknown feed id:", item.id)
|
||||
continue for
|
||||
end if
|
||||
node = CreateObject("roSGNode", "ContentNode")
|
||||
node.id = item.id
|
||||
node.title = m.homeLayout[item.id].title
|
||||
node.id = feed.id
|
||||
node.title = feed.title
|
||||
nodes.push(node)
|
||||
checkedState.push(item.enabled)
|
||||
end for
|
||||
|
||||
+1
-1
@@ -50,7 +50,7 @@ function OnkeyEvent(key as string, press as boolean) as boolean
|
||||
return true
|
||||
end if
|
||||
|
||||
if key = "options" and press
|
||||
if key = "options"
|
||||
' A pass-through to the app controller, so it can toggle picture-in-picture
|
||||
return false
|
||||
end if
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@ function OnkeyEvent(key as string, press as boolean) as boolean
|
||||
return true
|
||||
end if
|
||||
|
||||
if key = "options" and press
|
||||
if key = "options"
|
||||
' A pass-through to the app controller, so it can toggle picture-in-picture
|
||||
return false
|
||||
end if
|
||||
|
||||
+7
-18
@@ -1,22 +1,11 @@
|
||||
function Init()
|
||||
m.nameLabel = m.top.findNode("nameLabel")
|
||||
m.versionLabel = m.top.findNode("versionLabel")
|
||||
m.usersLabel = m.top.findNode("usersLabel")
|
||||
m.signupLabel = m.top.findNode("signupLabel")
|
||||
m.locationLabel = m.top.findNode("locationLabel")
|
||||
m.flagEmoji = m.top.findNode("flagEmoji")
|
||||
m.healthLabel = m.top.findNode("healthLabel")
|
||||
|
||||
end function
|
||||
|
||||
function OnContentSet() as void
|
||||
content = m.top.itemContent
|
||||
|
||||
m.nameLabel.text = content.name
|
||||
m.versionLabel.text = content.version
|
||||
m.usersLabel.text = content.users
|
||||
m.signupLabel.text = content.signup
|
||||
m.locationLabel.text = content.location
|
||||
m.flagEmoji.uri = content.flag
|
||||
m.healthLabel.text = content.health
|
||||
m.top.name = content.name
|
||||
m.top.version = content.version
|
||||
m.top.users = content.users
|
||||
m.top.signup = content.signup
|
||||
m.top.location = content.location
|
||||
m.top.flag = content.flag
|
||||
m.top.health = content.health
|
||||
end function
|
||||
+7
@@ -1,6 +1,13 @@
|
||||
<component name="InvidiousPublicInstancesListItem" extends="Group">
|
||||
<interface>
|
||||
<field id="itemContent" type="node" onChange="OnContentSet" />
|
||||
<field id="name" type="string" alias="nameLabel.text" />
|
||||
<field id="version" type="string" alias="versionLabel.text" />
|
||||
<field id="users" type="string" alias="usersLabel.text" />
|
||||
<field id="signup" type="string" alias="signupLabel.text" />
|
||||
<field id="location" type="string" alias="locationLabel.text" />
|
||||
<field id="flag" type="string" alias="flagEmoji.uri" />
|
||||
<field id="health" type="string" alias="healthLabel.text" />
|
||||
</interface>
|
||||
<children>
|
||||
<Label
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
import "pkg:/components/Navigation/Navigation.bs"
|
||||
import "pkg:/source/utils/FocusManagement.bs"
|
||||
import "pkg:/source/utils/MathUtils.bs"
|
||||
import "pkg:/source/utils/Types.bs"
|
||||
|
||||
function Init()
|
||||
m.top.focusable = true
|
||||
m.top.itemSpacings = [10]
|
||||
|
||||
m.minusButton = m.top.findNode("MinusButton")
|
||||
m.numberButton = m.top.findNode("NumberButton")
|
||||
m.plusButton = m.top.findNode("PlusButton")
|
||||
|
||||
m.minusButton.observeFieldScoped("buttonSelected", FuncName(OnMinusSelected))
|
||||
m.plusButton.observeFieldScoped("buttonSelected", FuncName(OnPlusSelected))
|
||||
|
||||
SetNavigation(m.minusButton, "right", m.numberButton)
|
||||
SetNavigation(m.numberButton, "left", m.minusButton)
|
||||
SetNavigation(m.numberButton, "right", m.plusButton)
|
||||
SetNavigation(m.plusButton, "left", m.numberButton)
|
||||
end function
|
||||
|
||||
function BindPreference(preferences as object, key as string)
|
||||
if m.preferences <> invalid and m.key <> invalid
|
||||
m.preferences.unobserveFieldScoped(m.key)
|
||||
end if
|
||||
|
||||
m.preferences = preferences
|
||||
m.key = key
|
||||
|
||||
if preferences <> invalid and key <> invalid
|
||||
preferences.observeFieldScoped(key, FuncName(OnPreferenceChange))
|
||||
OnPreferenceChange()
|
||||
end if
|
||||
end function
|
||||
|
||||
function OnPreferenceChange()
|
||||
m.top.value = MathUtils.Max(MathUtils.Min(m.preferences[m.key], m.top.max), m.top.min)
|
||||
end function
|
||||
|
||||
function OnValueChange() as void
|
||||
m.numberButton.text = `${m.top.value}`
|
||||
if m.preferences = invalid or m.key = invalid
|
||||
return
|
||||
end if
|
||||
|
||||
m.preferences[m.key] = m.top.value
|
||||
end function
|
||||
|
||||
function OnFocusChange() as void
|
||||
if not m.top.focus
|
||||
return
|
||||
end if
|
||||
|
||||
NodeSetFocus(m.numberButton, true)
|
||||
end function
|
||||
|
||||
function OnkeyEvent(key as string, press as boolean) as boolean
|
||||
if NavigationKeyHandler(key, press).handled
|
||||
return true
|
||||
end if
|
||||
return false
|
||||
end function
|
||||
|
||||
function OnMinusSelected()
|
||||
m.top.value = MathUtils.Max(m.top.value - 1, m.top.min)
|
||||
end function
|
||||
|
||||
function OnPlusSelected()
|
||||
m.top.value = MathUtils.Min(m.top.value + 1, m.top.max)
|
||||
end function
|
||||
@@ -0,0 +1,44 @@
|
||||
<component name="NumberControl" extends="LayoutGroup" includes="Focus">
|
||||
<interface>
|
||||
<field id="displayText" type="string" alias="DisplayTextLabel.text" />
|
||||
<field id="description" type="string" alias="DescriptionLabel.text" />
|
||||
<field id="min" type="integer" value="-999999" />
|
||||
<field id="max" type="integer" value="999999" />
|
||||
<field id="value" type="integer" onChange="OnValueChange" />
|
||||
<function name="BindPreference" />
|
||||
</interface>
|
||||
<children>
|
||||
<Label id="DisplayTextLabel" width="450" />
|
||||
<Label id="DescriptionLabel"
|
||||
width="450"
|
||||
color="0xb4b4b4ff"
|
||||
wrap="true">
|
||||
<Font role="font" uri="font:SystemFontFile" size="18" />
|
||||
</Label>
|
||||
<LayoutGroup layoutDirection="horiz">
|
||||
<Button
|
||||
id="MinusButton"
|
||||
iconUri=""
|
||||
focusedIconUri=""
|
||||
minWidth="64"
|
||||
maxWidth="64"
|
||||
showFocusFootprint="true"
|
||||
text="-" />
|
||||
<Button
|
||||
id="NumberButton"
|
||||
iconUri=""
|
||||
focusedIconUri=""
|
||||
minWidth="150"
|
||||
showFocusFootprint="true"
|
||||
text="0" />
|
||||
<Button
|
||||
id="PlusButton"
|
||||
iconUri=""
|
||||
focusedIconUri=""
|
||||
minWidth="64"
|
||||
maxWidth="64"
|
||||
showFocusFootprint="true"
|
||||
text="+" />
|
||||
</LayoutGroup>
|
||||
</children>
|
||||
</component>
|
||||
@@ -1,6 +1,6 @@
|
||||
<component name="SettingCategory" extends="Button">
|
||||
<interface>
|
||||
<field id="padding" type="integer" value="10" onChange="Resize" />
|
||||
<field id="padding" type="integer" value="15" onChange="Resize" />
|
||||
<field id="minimumWidth" type="integer" value="280" onChange="Resize" />
|
||||
<field id="displayText" type="string" alias="DisplayTextLabel.text" onChange="Resize" />
|
||||
<field id="description" type="string" alias="DescriptionLabel.text" onChange="Resize" />
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import "pkg:/components/Navigation/Navigation.bs"
|
||||
import "pkg:/components/Navigation/ScrollTo.bs"
|
||||
import "pkg:/source/utils/FocusManagement.bs"
|
||||
import "pkg:/source/utils/Types.bs"
|
||||
|
||||
function Init()
|
||||
m.top.focusable = true
|
||||
@@ -9,9 +10,9 @@ function Init()
|
||||
m.scrollAnimationInterpolator = m.scrollAnimation.findNode("scrollAnimationInterpolator")
|
||||
m.viewport = {
|
||||
x: 150
|
||||
y: 96
|
||||
y: 50
|
||||
width: 1920
|
||||
height: 550
|
||||
height: 620
|
||||
}
|
||||
end function
|
||||
|
||||
@@ -126,6 +127,8 @@ function CreateControl(item as object, container as object, startX as integer, s
|
||||
control = CreateRadioControl(item, container)
|
||||
else if item.type = "string"
|
||||
control = CreateStringControl(item, container)
|
||||
else if item.type = "number"
|
||||
control = CreateNumberComponent(item, container)
|
||||
else if item.rokuComponent <> invalid
|
||||
control = CreateRokuComponent(item, container)
|
||||
end if
|
||||
@@ -169,6 +172,19 @@ function CreateStringControl(item as object, container as object) as object
|
||||
return node
|
||||
end function
|
||||
|
||||
function CreateNumberComponent(item as object, container as object) as object
|
||||
node = container.createChild("NumberControl")
|
||||
node.displayText = item.displayText
|
||||
node.description = item.description
|
||||
if IsInt(item.min)
|
||||
node.min = item.min
|
||||
end if
|
||||
if IsInt(item.max)
|
||||
node.max = item.max
|
||||
end if
|
||||
return node
|
||||
end function
|
||||
|
||||
function CreateRokuComponent(item as object, container as object) as object
|
||||
node = container.createChild(item.rokuComponent)
|
||||
if node.hasField("displayText")
|
||||
|
||||
@@ -14,7 +14,7 @@ function GetLatestPlayletLibVersionFromGithubReleases() as string
|
||||
if response.StatusCode() = 200
|
||||
headers = response.Headers()
|
||||
if headers.location <> invalid
|
||||
regex = CreateObject("roRegex", "/v?(\d+\.\d+\.\d+)", "")
|
||||
regex = /\/v?(\d+\.\d+\.\d+)/
|
||||
match = regex.match(headers.location)
|
||||
if match.Count() = 2
|
||||
return match[1]
|
||||
|
||||
@@ -8,8 +8,28 @@ class DashManifest
|
||||
public invidiousInstance as dynamic
|
||||
|
||||
function new(invidiousInstance as string)
|
||||
m.utils = new Http.Utils()
|
||||
m.invidiousInstance = invidiousInstance
|
||||
|
||||
m.utils = new Http.Utils()
|
||||
m.urlRegex = /https?:\/\/\S+(\/\S+)/i
|
||||
|
||||
' https://github.com/LuanRT/YouTube.js/blob/6082b4a52ee07a622735e6e9128a0531a5ae3bfb/src/utils/StreamingInfo.ts#L332-L349
|
||||
m.colorInfo = {
|
||||
primaries: {
|
||||
"COLOR_PRIMARIES_BT709": "1"
|
||||
"COLOR_PRIMARIES_BT2020": "9"
|
||||
}
|
||||
transferCharacteristics: {
|
||||
"COLOR_TRANSFER_CHARACTERISTICS_BT709": "1"
|
||||
"COLOR_TRANSFER_CHARACTERISTICS_BT2020_10": "14"
|
||||
"COLOR_TRANSFER_CHARACTERISTICS_SMPTEST2084": "16"
|
||||
"COLOR_TRANSFER_CHARACTERISTICS_ARIB_STD_B67": "18"
|
||||
}
|
||||
matrixCoefficients: {
|
||||
"COLOR_MATRIX_COEFFICIENTS_BT709": "1"
|
||||
"COLOR_MATRIX_COEFFICIENTS_BT2020_NCL": "14"
|
||||
}
|
||||
}
|
||||
end function
|
||||
|
||||
function fromVideoMetadata(metadata as object, local as boolean) as string
|
||||
@@ -17,10 +37,8 @@ class DashManifest
|
||||
adaptiveFormats.Append (metadata.adaptiveFormats)
|
||||
|
||||
if local
|
||||
urlRegex = CreateObject("roRegex", "https?:\/\/\S+(\/\S+)", "i")
|
||||
|
||||
for i = 0 to adaptiveFormats.Count() - 1
|
||||
adaptiveFormats[i].url = urlRegex.replace(adaptiveFormats[i].url, m.invidiousInstance + "\1")
|
||||
adaptiveFormats[i].url = m.urlRegex.replace(adaptiveFormats[i].url, m.invidiousInstance + "\1")
|
||||
end for
|
||||
end if
|
||||
|
||||
@@ -55,11 +73,10 @@ class DashManifest
|
||||
end if
|
||||
|
||||
if xml.Node("AdaptationSet", adaptationSetAttributes)
|
||||
xml.Node("Role", {
|
||||
xml.EmptyNode("Role", {
|
||||
"schemeIdUri": "urn:mpeg:dash:role:2011"
|
||||
"value": audioSet.acont = "original" ? "main" : "alternate"
|
||||
})
|
||||
xml.End()
|
||||
|
||||
for i = 0 to audioStreams.Count() - 1
|
||||
stream = audioStreams[i]
|
||||
@@ -82,31 +99,23 @@ class DashManifest
|
||||
"bandwidth": stream.bitrate
|
||||
})
|
||||
|
||||
xml.Node("AudioChannelConfiguration", {
|
||||
xml.EmptyNode("AudioChannelConfiguration", {
|
||||
"schemeIdUri": "urn:mpeg:dash:23003:3:audio_channel_configuration:2011"
|
||||
"value": `${stream.audioChannels}`
|
||||
})
|
||||
xml.End()
|
||||
|
||||
if xml.Node("BaseURL")
|
||||
xml.Text(stream.url)
|
||||
xml.End()
|
||||
end if
|
||||
xml.TextNode("BaseURL", stream.url)
|
||||
|
||||
if xml.Node("SegmentBase", { "indexRange": stream.index })
|
||||
xml.EmptyNode("Initialization", { "range": stream.init })
|
||||
|
||||
if xml.Node("SegmentBase", {
|
||||
"indexRange": stream.index
|
||||
})
|
||||
if xml.Node("Initialization", {
|
||||
"range": stream.init
|
||||
})
|
||||
xml.End()
|
||||
end if
|
||||
xml.End()
|
||||
end if
|
||||
|
||||
xml.End()
|
||||
end if
|
||||
end for
|
||||
|
||||
xml.End()
|
||||
end if
|
||||
|
||||
@@ -154,19 +163,15 @@ class DashManifest
|
||||
end if
|
||||
|
||||
if xml.Node("Representation", representationAttributes)
|
||||
m.AddColorInfo(stream, xml)
|
||||
if xml.Node("BaseURL")
|
||||
xml.Text(stream.url)
|
||||
xml.End()
|
||||
end if
|
||||
|
||||
if xml.Node("SegmentBase", {
|
||||
"indexRange": stream.index
|
||||
})
|
||||
if xml.Node("Initialization", {
|
||||
"range": stream.init
|
||||
})
|
||||
xml.End()
|
||||
end if
|
||||
if xml.Node("SegmentBase", { "indexRange": stream.index })
|
||||
xml.EmptyNode("Initialization", { "range": stream.init })
|
||||
|
||||
xml.End()
|
||||
end if
|
||||
|
||||
@@ -184,7 +189,7 @@ class DashManifest
|
||||
for each storyboard in storyboards
|
||||
interval = ValidInt(storyboard.interval)
|
||||
if interval = 0
|
||||
LogWarn("Invalid storyboard interval=0")
|
||||
LogWarn("Invalid storyboard interval:", storyboard.interval)
|
||||
continue for
|
||||
end if
|
||||
|
||||
@@ -211,7 +216,7 @@ class DashManifest
|
||||
|
||||
intervalInSeconds = interval \ 1000
|
||||
|
||||
' Youtube template uses the var $M for tile pages
|
||||
' YouTube template uses the var $M for tile pages
|
||||
' DASH-IF uses $Number$ in the SegmentTemplate
|
||||
' https://dashif.org/docs/DASH-IF-IOP-v4.3.pdf
|
||||
url = templateUrl.replace("$M", "$Number$")
|
||||
@@ -230,12 +235,11 @@ class DashManifest
|
||||
"mimeType": "image/jpeg"
|
||||
"contentType": "image"
|
||||
})
|
||||
xml.Node("SegmentTemplate", {
|
||||
xml.EmptyNode("SegmentTemplate", {
|
||||
"media": url
|
||||
"duration": duration
|
||||
"startNumber": 0
|
||||
})
|
||||
xml.End()
|
||||
|
||||
if xml.Node("Representation", {
|
||||
"id": `thumbnails_${id}`
|
||||
@@ -244,11 +248,10 @@ class DashManifest
|
||||
"height": storyboardHeightInPixels
|
||||
})
|
||||
|
||||
xml.Node("EssentialProperty", {
|
||||
xml.EmptyNode("EssentialProperty", {
|
||||
"schemeIdUri": "http://dashif.org/guidelines/thumbnail_tile"
|
||||
"value": `${storyboardWidth}x${storyboardHeight}`
|
||||
})
|
||||
xml.End()
|
||||
|
||||
xml.End()
|
||||
end if
|
||||
@@ -371,4 +374,47 @@ class DashManifest
|
||||
end for
|
||||
return result
|
||||
end function
|
||||
|
||||
function AddColorInfo(videoStream as object, xml as object) as void
|
||||
if videoStream.colorInfo = invalid
|
||||
return
|
||||
end if
|
||||
|
||||
if videoStream.colorInfo.primaries <> invalid
|
||||
primaries = m.colorInfo.primaries[videoStream.colorInfo.primaries]
|
||||
if primaries <> invalid
|
||||
xml.EmptyNode("EssentialProperty", {
|
||||
"schemeIdUri": "urn:mpeg:mpegB:cicp:ColourPrimaries"
|
||||
"value": primaries
|
||||
})
|
||||
else
|
||||
LogWarn("Unknown colorInfo.primaries:", videoStream.colorInfo.primaries)
|
||||
end if
|
||||
end if
|
||||
|
||||
if videoStream.colorInfo.transferCharacteristics <> invalid
|
||||
transferCharacteristics = m.colorInfo.transferCharacteristics[videoStream.colorInfo.transferCharacteristics]
|
||||
if transferCharacteristics <> invalid
|
||||
xml.EmptyNode("EssentialProperty", {
|
||||
"schemeIdUri": "urn:mpeg:mpegB:cicp:TransferCharacteristics"
|
||||
"value": transferCharacteristics
|
||||
})
|
||||
else
|
||||
LogWarn("Unknown colorInfo.transferCharacteristics:", videoStream.colorInfo.transferCharacteristics)
|
||||
end if
|
||||
end if
|
||||
|
||||
if videoStream.colorInfo.matrixCoefficients <> invalid
|
||||
matrixCoefficients = m.colorInfo.matrixCoefficients[videoStream.colorInfo.matrixCoefficients]
|
||||
if matrixCoefficients <> invalid
|
||||
xml.EmptyNode("EssentialProperty", {
|
||||
"schemeIdUri": "urn:mpeg:mpegB:cicp:MatrixCoefficients"
|
||||
"value": matrixCoefficients
|
||||
})
|
||||
else
|
||||
LogWarn("Unknown colorInfo.matrixCoefficients:", videoStream.colorInfo.matrixCoefficients)
|
||||
end if
|
||||
end if
|
||||
end function
|
||||
|
||||
end class
|
||||
@@ -505,14 +505,22 @@ We apologize for the inconvenience.`
|
||||
function VerifyTokenScope(token as string) as boolean
|
||||
tokenObject = ParseJson(token)
|
||||
if tokenObject = invalid
|
||||
LogWarn("Failed to json parse token:", token)
|
||||
return false
|
||||
end if
|
||||
if not IsArray(tokenObject.scopes)
|
||||
LogWarn("Token scopes are not an array:", tokenObject.scopes)
|
||||
return false
|
||||
end if
|
||||
|
||||
scopes = tokenObject.scopes.join(",")
|
||||
return scopes = Invidious.AUTH_SCOPES
|
||||
expectedScopes = Invidious.AUTH_SCOPES
|
||||
validScopes = expectedScopes = scopes
|
||||
|
||||
if not validScopes
|
||||
LogWarn(`Token scopes do not match expected scopes. Expected: "${expectedScopes}", got: "${scopes}"`)
|
||||
end if
|
||||
return validScopes
|
||||
end function
|
||||
|
||||
function DeleteAuthToken()
|
||||
|
||||
@@ -5,6 +5,7 @@ function Init()
|
||||
m.typeMapping = {
|
||||
"boolean": "boolean"
|
||||
"string": "string"
|
||||
"number": "integer"
|
||||
"radio": "string"
|
||||
"array": "array"
|
||||
}
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
<component name="Preferences" extends="Node">
|
||||
<interface>
|
||||
<!--
|
||||
The version of the preferences model. This is used to determine if the
|
||||
user prefs saved need to be migrated. If the version is less than the
|
||||
current version, a migration is needed.
|
||||
-->
|
||||
<field id="__version" type="integer" value="1" />
|
||||
<field id="prefsModel" type="array" />
|
||||
<field id="preferenceFields" type="assocarray" />
|
||||
|
||||
@@ -144,13 +144,20 @@ function Close(_unused as dynamic)
|
||||
m.sponsorBlockTask = invalid
|
||||
end if
|
||||
|
||||
m.top.control = "stop"
|
||||
m.top.content = invalid
|
||||
parent = m.top.getParent()
|
||||
if parent <> invalid
|
||||
parent.RemoveChild(m.top)
|
||||
end if
|
||||
SponsorBlock.RemoveNotifcation(m.notifications)
|
||||
|
||||
' Stopping a video is slow and synchronous, and can lead to execution timeout crashes.
|
||||
try
|
||||
m.top.control = "stop"
|
||||
catch error
|
||||
DialogUtils.ShowDialog(ErrorUtils.Format(error), "Error closing video", true)
|
||||
end try
|
||||
|
||||
m.top.content = invalid
|
||||
end function
|
||||
|
||||
function OnVideoPlayerStateChange() as void
|
||||
|
||||
@@ -4,38 +4,40 @@ namespace Http
|
||||
|
||||
class BookmarksRouter extends HttpRouter
|
||||
|
||||
function new()
|
||||
function new(server as object)
|
||||
super()
|
||||
|
||||
m.Get("/api/bookmarks", function(context as object) as boolean
|
||||
response = context.response
|
||||
m.bookmarksNode = server.task.bookmarks
|
||||
end function
|
||||
|
||||
bookmarksString = RegistryUtils.Read(RegistryUtils.BOOKMARKS)
|
||||
if bookmarksString = invalid
|
||||
response.Json({
|
||||
groups: []
|
||||
})
|
||||
return true
|
||||
end if
|
||||
|
||||
response.SetBodyDataString(bookmarksString)
|
||||
response.ContentType("application/json")
|
||||
response.http_code = 200
|
||||
@get("/api/bookmarks")
|
||||
function GetBookmarks(context as object) as boolean
|
||||
response = context.response
|
||||
|
||||
bookmarksString = RegistryUtils.Read(RegistryUtils.BOOKMARKS)
|
||||
if bookmarksString = invalid
|
||||
response.Json({
|
||||
groups: []
|
||||
})
|
||||
return true
|
||||
end function)
|
||||
end if
|
||||
|
||||
m.Get("/api/bookmarks/feeds", function(context as object) as boolean
|
||||
response = context.response
|
||||
router = context.router
|
||||
bookmarks = context.server.task.bookmarks
|
||||
response.SetBodyDataString(bookmarksString)
|
||||
response.ContentType("application/json")
|
||||
response.http_code = 200
|
||||
|
||||
feeds = router.BookmarksContentToFeeds(bookmarks.content)
|
||||
return true
|
||||
end function
|
||||
|
||||
response.Json(feeds)
|
||||
@get("/api/bookmarks/feeds")
|
||||
function GetBookmarksFeeds(context as object) as boolean
|
||||
response = context.response
|
||||
|
||||
return true
|
||||
end function)
|
||||
feeds = m.BookmarksContentToFeeds(m.bookmarksNode.content)
|
||||
|
||||
response.Json(feeds)
|
||||
|
||||
return true
|
||||
end function
|
||||
|
||||
' TODO:P1 refactor to share code with Bookmarks screen
|
||||
|
||||
@@ -5,43 +5,45 @@ import "pkg:/source/utils/Types.bs"
|
||||
namespace Http
|
||||
|
||||
class DashRouter extends HttpRouter
|
||||
|
||||
function new()
|
||||
function new(server as object)
|
||||
super()
|
||||
|
||||
m.Get("/api/dash", function(context as object) as boolean
|
||||
request = context.request
|
||||
response = context.response
|
||||
task = context.server.task
|
||||
invidiousNode = task.invidious
|
||||
m.invidiousNode = server.task.invidious
|
||||
m.invidiousService = new Invidious.InvidiousService(m.invidiousNode)
|
||||
' No need to pass the invidious instance here, we will refresh it for
|
||||
' each request to make sure we are using the latest one
|
||||
m.dashManifest = new DashManifest("")
|
||||
end function
|
||||
|
||||
v = request.query.v
|
||||
local = request.query.local
|
||||
@get("/api/dash")
|
||||
function GenerateDashManifest(context as object) as boolean
|
||||
request = context.request
|
||||
response = context.response
|
||||
|
||||
if StringUtils.IsNullOrEmpty(v)
|
||||
response.Default(400, "Missing video id")
|
||||
return true
|
||||
end if
|
||||
|
||||
service = new Invidious.InvidiousService(invidiousNode)
|
||||
metadataRequest = service.GetVideoMetadata(v)
|
||||
if not metadataRequest.IsSuccess()
|
||||
response.Default(metadataRequest.StatusCode(), metadataRequest.ErrorMessage())
|
||||
return true
|
||||
end if
|
||||
|
||||
metadata = metadataRequest.Json()
|
||||
instance = service.GetInstance()
|
||||
|
||||
dash = new DashManifest(instance)
|
||||
xmlContent = dash.fromVideoMetadata(metadata, ValidString(local) = "true")
|
||||
|
||||
response.http_code = 200
|
||||
response.SetBodyDataString(xmlContent)
|
||||
response.ContentType("application/dash+xml")
|
||||
v = request.query.v
|
||||
local = request.query.local
|
||||
|
||||
if StringUtils.IsNullOrEmpty(v)
|
||||
response.Default(400, "Missing video id")
|
||||
return true
|
||||
end function)
|
||||
end if
|
||||
|
||||
metadataRequest = m.invidiousService.GetVideoMetadata(v)
|
||||
if not metadataRequest.IsSuccess()
|
||||
response.Default(metadataRequest.StatusCode(), metadataRequest.ErrorMessage())
|
||||
return true
|
||||
end if
|
||||
|
||||
metadata = metadataRequest.Json()
|
||||
m.dashManifest.invidiousInstance = m.invidiousService.GetInstance()
|
||||
|
||||
xmlContent = m.dashManifest.fromVideoMetadata(metadata, ValidString(local) = "true")
|
||||
|
||||
response.http_code = 200
|
||||
response.SetBodyDataString(xmlContent)
|
||||
response.ContentType("application/dash+xml")
|
||||
|
||||
return true
|
||||
end function
|
||||
|
||||
end class
|
||||
|
||||
@@ -4,20 +4,20 @@ namespace Http
|
||||
|
||||
class HomeLayoutRouter extends HttpRouter
|
||||
|
||||
function new()
|
||||
function new(server as object)
|
||||
super()
|
||||
|
||||
m.Get("/api/home-layout", function(context as object) as boolean
|
||||
response = context.response
|
||||
task = context.server.task
|
||||
preferences = task.preferences
|
||||
m.preferencesNode = server.task.preferences
|
||||
end function
|
||||
|
||||
feed = HomeScreenUtils.GetFeed("libpkg:/config/default_home_layout.yaml", preferences)
|
||||
response.Json(feed)
|
||||
@get("/api/home-layout")
|
||||
function GetHomeLayout(context as object) as boolean
|
||||
response = context.response
|
||||
|
||||
return true
|
||||
end function)
|
||||
feed = HomeScreenUtils.GetFeed("libpkg:/config/default_home_layout.yaml", m.preferencesNode)
|
||||
response.Json(feed)
|
||||
|
||||
return true
|
||||
end function
|
||||
|
||||
end class
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
namespace Http
|
||||
|
||||
class HomeRouter extends HttpRouter
|
||||
|
||||
function new()
|
||||
super()
|
||||
end function
|
||||
|
||||
@get("/")
|
||||
function GoHome(context as object) as boolean
|
||||
response = context.response
|
||||
response.Redirect("/index.html")
|
||||
return true
|
||||
end function
|
||||
|
||||
end class
|
||||
|
||||
end namespace
|
||||
@@ -5,89 +5,88 @@ namespace Http
|
||||
|
||||
class InvidiousRouter extends HttpRouter
|
||||
|
||||
function new()
|
||||
function new(server as object)
|
||||
super()
|
||||
|
||||
m.Get("/invidious/login", function(context as object) as boolean
|
||||
response = context.response
|
||||
invidiousNode = context.server.task.invidious
|
||||
m.invidiousNode = server.task.invidious
|
||||
m.invidiousService = new Invidious.InvidiousService(m.invidiousNode)
|
||||
end function
|
||||
|
||||
authLink = invidiousNode@.GetAuthorizeTokenLink()
|
||||
response.Redirect(authLink)
|
||||
@get("/invidious/login")
|
||||
function Login(context as object) as boolean
|
||||
response = context.response
|
||||
|
||||
authLink = m.invidiousNode@.GetAuthorizeTokenLink()
|
||||
response.Redirect(authLink)
|
||||
return true
|
||||
end function
|
||||
|
||||
@get("/invidious/logout")
|
||||
function Logout(context as object) as boolean
|
||||
response = context.response
|
||||
|
||||
m.invidiousService.Logout()
|
||||
|
||||
response.Default(204, "OK")
|
||||
return true
|
||||
end function
|
||||
|
||||
@get("/invidious/token_callback")
|
||||
function OnTokenReceived(context as object) as boolean
|
||||
request = context.request
|
||||
response = context.response
|
||||
|
||||
if request.query["token"] <> invalid and request.query["ref"] <> invalid
|
||||
' Invidious encodes token and username twice
|
||||
token = request.query["token"].DecodeUriComponent().DecodeUriComponent()
|
||||
username = request.query["username"].DecodeUriComponent().DecodeUriComponent()
|
||||
referer = request.query["ref"].DecodeUriComponent()
|
||||
|
||||
m.invidiousNode@.SetAuthToken(token, referer, username)
|
||||
end if
|
||||
response.Redirect("/")
|
||||
return true
|
||||
end function
|
||||
|
||||
' This is an endpoint allowing the web app to make an authenticated request
|
||||
' without needing the Invidious token
|
||||
' This is a GET not a POST for better caching
|
||||
@get("/invidious/authenticated-request")
|
||||
function AuthRequestProxy(context as object) as boolean
|
||||
request = context.request
|
||||
response = context.response
|
||||
|
||||
token = m.invidiousNode.authToken
|
||||
if token = invalid
|
||||
response.Default(403, "No token, not logged in")
|
||||
return true
|
||||
end function)
|
||||
end if
|
||||
|
||||
m.Get("/invidious/logout", function(context as object) as boolean
|
||||
response = context.response
|
||||
invidiousNode = context.server.task.invidious
|
||||
|
||||
service = new Invidious.InvidiousService(invidiousNode)
|
||||
service.Logout()
|
||||
|
||||
response.Default(204, "OK")
|
||||
feedSource = request.query["feed-source"]
|
||||
if feedSource = invalid
|
||||
response.Default(400, "Expected feed-source")
|
||||
return true
|
||||
end function)
|
||||
end if
|
||||
|
||||
m.Get(Invidious.TOKEN_CALLBACK, function(context as object) as boolean
|
||||
request = context.request
|
||||
response = context.response
|
||||
invidiousNode = context.server.task.invidious
|
||||
|
||||
if request.query["token"] <> invalid and request.query["ref"] <> invalid
|
||||
' Invidious encodes token and username twice
|
||||
token = request.query["token"].DecodeUriComponent().DecodeUriComponent()
|
||||
username = request.query["username"].DecodeUriComponent().DecodeUriComponent()
|
||||
referer = request.query["ref"].DecodeUriComponent()
|
||||
|
||||
invidiousNode@.SetAuthToken(token, referer, username)
|
||||
end if
|
||||
response.Redirect("/")
|
||||
feedSource = ParseJson(feedSource)
|
||||
if feedSource = invalid
|
||||
response.Default(400, "Expected valid JSON for feed-source")
|
||||
return true
|
||||
end function)
|
||||
end if
|
||||
|
||||
' This is an endpoint allowing the web app to make an authenticated request
|
||||
' without needing the Invidious token
|
||||
' This is a GET not a POST for better caching
|
||||
m.Get("/invidious/authenticated-request", function(context as object) as boolean
|
||||
request = context.request
|
||||
response = context.response
|
||||
invidiousNode = context.server.task.invidious
|
||||
additionalQueryParams = invalid
|
||||
if feedSource.state <> invalid and feedSource.state.queryParams <> invalid
|
||||
additionalQueryParams = feedSource.state.queryParams
|
||||
end if
|
||||
|
||||
token = invidiousNode.authToken
|
||||
if token = invalid
|
||||
response.Default(403, "No token, not logged in")
|
||||
return true
|
||||
end if
|
||||
|
||||
feedSource = request.query["feed-source"]
|
||||
if feedSource = invalid
|
||||
response.Default(400, "Expected feed-source")
|
||||
return true
|
||||
end if
|
||||
|
||||
feedSource = ParseJson(feedSource)
|
||||
if feedSource = invalid
|
||||
response.Default(400, "Expected valid JSON for feed-source")
|
||||
return true
|
||||
end if
|
||||
|
||||
invService = new Invidious.InvidiousService(invidiousNode)
|
||||
|
||||
additionalQueryParams = invalid
|
||||
if feedSource.state <> invalid and feedSource.state.queryParams <> invalid
|
||||
additionalQueryParams = feedSource.state.queryParams
|
||||
end if
|
||||
|
||||
invResponse = invService.MakeRequest(feedSource, additionalQueryParams)
|
||||
if not invResponse.success
|
||||
response.Default(500, `Failed to make request: ${invResponse.error}`)
|
||||
return true
|
||||
end if
|
||||
|
||||
response.Json(invResponse.result)
|
||||
invResponse = m.invidiousService.MakeRequest(feedSource, additionalQueryParams)
|
||||
if not invResponse.success
|
||||
response.Default(500, `Failed to make request: ${invResponse.error}`)
|
||||
return true
|
||||
end function)
|
||||
end if
|
||||
|
||||
response.Json(invResponse.result)
|
||||
return true
|
||||
end function
|
||||
|
||||
end class
|
||||
|
||||
@@ -5,109 +5,96 @@ namespace Http
|
||||
|
||||
class PlayQueueRouter extends HttpRouter
|
||||
|
||||
function new()
|
||||
function new(server as object)
|
||||
super()
|
||||
|
||||
' Get queue
|
||||
m.Get("/api/queue", function(context as object) as boolean
|
||||
response = context.response
|
||||
task = context.server.task
|
||||
playQueue = task.playQueue
|
||||
task = server.task
|
||||
m.playQueueNode = task.playQueue
|
||||
m.invidiousNode = task.invidious
|
||||
m.invidiousService = new Invidious.InvidiousService(m.invidiousNode)
|
||||
end function
|
||||
|
||||
queue = playQueue@.GetQueue()
|
||||
response.Json(queue)
|
||||
@get("/api/queue")
|
||||
function GetQueue(context as object) as boolean
|
||||
response = context.response
|
||||
|
||||
queue = m.playQueueNode@.GetQueue()
|
||||
response.Json(queue)
|
||||
return true
|
||||
end function
|
||||
|
||||
@post("/api/queue")
|
||||
function AddToQueue(context as object) as boolean
|
||||
request = context.request
|
||||
response = context.response
|
||||
|
||||
payload = request.Json()
|
||||
if payload = invalid
|
||||
response.Default(400, `Invalid JSON payload`)
|
||||
return true
|
||||
end function)
|
||||
end if
|
||||
|
||||
' Add to queue
|
||||
m.Post("/api/queue", function(context as object) as boolean
|
||||
request = context.request
|
||||
response = context.response
|
||||
task = context.server.task
|
||||
playQueue = task.playQueue
|
||||
invidiousNode = task.invidious
|
||||
|
||||
payload = request.Json()
|
||||
if payload = invalid
|
||||
response.Default(400, `Invalid JSON payload`)
|
||||
return true
|
||||
end if
|
||||
|
||||
videoId = payload.videoId
|
||||
playlistId = payload.playlistId
|
||||
if StringUtils.IsNullOrEmpty(videoId) and StringUtils.IsNullOrEmpty(playlistId)
|
||||
response.Default(400, `Missing "videoId" or "playlistId" in payload`)
|
||||
return true
|
||||
end if
|
||||
|
||||
service = new Invidious.InvidiousService(invidiousNode)
|
||||
instance = service.GetInstance()
|
||||
|
||||
contentNode = InvidiousContent.ToRowCellContentNode(payload, instance)
|
||||
playQueue@.AddToQueue(contentNode)
|
||||
|
||||
queue = playQueue@.GetQueue()
|
||||
response.Json(queue)
|
||||
videoId = payload.videoId
|
||||
playlistId = payload.playlistId
|
||||
if StringUtils.IsNullOrEmpty(videoId) and StringUtils.IsNullOrEmpty(playlistId)
|
||||
response.Default(400, `Missing "videoId" or "playlistId" in payload`)
|
||||
return true
|
||||
end function)
|
||||
end if
|
||||
|
||||
' Play a video
|
||||
m.Post("/api/queue/play", function(context as object) as boolean
|
||||
request = context.request
|
||||
response = context.response
|
||||
task = context.server.task
|
||||
playQueue = task.playQueue
|
||||
invidiousNode = task.invidious
|
||||
instance = m.invidiousService.GetInstance()
|
||||
|
||||
payload = request.Json()
|
||||
if payload = invalid
|
||||
response.Default(400, `Invalid JSON payload`)
|
||||
return true
|
||||
end if
|
||||
contentNode = InvidiousContent.ToRowCellContentNode(payload, instance)
|
||||
m.playQueueNode@.AddToQueue(contentNode)
|
||||
|
||||
videoId = payload.videoId
|
||||
playlistId = payload.playlistId
|
||||
if StringUtils.IsNullOrEmpty(videoId) and StringUtils.IsNullOrEmpty(playlistId)
|
||||
response.Default(400, `Missing "videoId" or "playlistId" in payload`)
|
||||
return true
|
||||
end if
|
||||
queue = m.playQueueNode@.GetQueue()
|
||||
response.Json(queue)
|
||||
return true
|
||||
end function
|
||||
|
||||
if IsString(payload.timestamp)
|
||||
payload.timestamp = payload.timestamp.toInt()
|
||||
end if
|
||||
@post("/api/queue/play")
|
||||
function Play(context as object) as boolean
|
||||
request = context.request
|
||||
response = context.response
|
||||
|
||||
service = new Invidious.InvidiousService(invidiousNode)
|
||||
instance = service.GetInstance()
|
||||
|
||||
contentNode = InvidiousContent.ToRowCellContentNode(payload, instance)
|
||||
playlistIndex = IsInt(payload.playlistIndex) ? payload.playlistIndex : -1
|
||||
if contentNode.type = "playlist" and playlistIndex = -1
|
||||
playlistIndex = 0
|
||||
end if
|
||||
|
||||
'TODO:P1 play existing item by index instead of new item inserted
|
||||
playQueue@.Play(contentNode, playlistIndex)
|
||||
|
||||
response.Default(204, "OK")
|
||||
payload = request.Json()
|
||||
if payload = invalid
|
||||
response.Default(400, `Invalid JSON payload`)
|
||||
return true
|
||||
end function)
|
||||
end if
|
||||
|
||||
' clear queue
|
||||
m.Delete("/api/queue", function(context as object) as boolean
|
||||
response = context.response
|
||||
task = context.server.task
|
||||
playQueue = task.playQueue
|
||||
|
||||
if playQueue = invalid
|
||||
response.Default(500, `Reference to "playQueue" object was invalid`)
|
||||
return true
|
||||
end if
|
||||
|
||||
playQueue@.Clear()
|
||||
response.Default(204, "OK")
|
||||
videoId = payload.videoId
|
||||
playlistId = payload.playlistId
|
||||
if StringUtils.IsNullOrEmpty(videoId) and StringUtils.IsNullOrEmpty(playlistId)
|
||||
response.Default(400, `Missing "videoId" or "playlistId" in payload`)
|
||||
return true
|
||||
end function)
|
||||
end if
|
||||
|
||||
if IsString(payload.timestamp)
|
||||
payload.timestamp = payload.timestamp.toInt()
|
||||
end if
|
||||
|
||||
instance = m.invidiousService.GetInstance()
|
||||
|
||||
contentNode = InvidiousContent.ToRowCellContentNode(payload, instance)
|
||||
playlistIndex = IsInt(payload.playlistIndex) ? payload.playlistIndex : -1
|
||||
if contentNode.type = "playlist" and playlistIndex = -1
|
||||
playlistIndex = 0
|
||||
end if
|
||||
|
||||
'TODO:P1 play existing item by index instead of new item inserted
|
||||
m.playQueueNode@.Play(contentNode, playlistIndex)
|
||||
|
||||
response.Default(204, "OK")
|
||||
return true
|
||||
end function
|
||||
|
||||
@delete("/api/queue")
|
||||
function ClearQueue(context as object) as boolean
|
||||
response = context.response
|
||||
|
||||
m.playQueueNode@.Clear()
|
||||
response.Default(204, "OK")
|
||||
return true
|
||||
end function
|
||||
|
||||
end class
|
||||
|
||||
+57
-55
@@ -4,65 +4,67 @@ namespace Http
|
||||
|
||||
class PlayletLibUrlsRouter extends HttpRouter
|
||||
|
||||
function new()
|
||||
function new(server as object)
|
||||
super()
|
||||
|
||||
m.Get("/api/playlet-lib-urls", function(context as object) as boolean
|
||||
response = context.response
|
||||
task = context.server.task
|
||||
scene = task.getScene()
|
||||
|
||||
saved = RegistryUtils.Read(RegistryUtils.PLAYLET_LIB_URLS)
|
||||
if saved <> invalid
|
||||
saved = ParseJson(saved)
|
||||
end if
|
||||
|
||||
response.Json({
|
||||
loaded: scene.playletLibLoadedUrl
|
||||
saved: saved
|
||||
})
|
||||
return true
|
||||
end function)
|
||||
|
||||
m.Post("/api/playlet-lib-urls", function(context as object) as boolean
|
||||
request = context.request
|
||||
response = context.response
|
||||
|
||||
payload = request.Json()
|
||||
if payload = invalid or not IsArray(payload)
|
||||
response.Default(400, "Invalid payload")
|
||||
return true
|
||||
end if
|
||||
|
||||
if payload.Count() = 0
|
||||
response.Default(400, "Payload must contain at least one item")
|
||||
return true
|
||||
end if
|
||||
|
||||
for each item in payload
|
||||
if StringUtils.IsNullOrEmpty(item.link) or StringUtils.IsNullOrEmpty(item.type)
|
||||
response.Default(400, `Invalid item in array (must have "link" and "type" properties)`)
|
||||
return true
|
||||
end if
|
||||
end for
|
||||
|
||||
RegistryUtils.Write(RegistryUtils.PLAYLET_LIB_URLS, request.body)
|
||||
|
||||
response.Default(204, "OK")
|
||||
return true
|
||||
end function)
|
||||
|
||||
m.Delete("/api/playlet-lib-urls", function(context as object) as boolean
|
||||
response = context.response
|
||||
|
||||
RegistryUtils.Delete(RegistryUtils.PLAYLET_LIB_URLS)
|
||||
|
||||
response.Default(204, "OK")
|
||||
return true
|
||||
end function)
|
||||
|
||||
task = server.task
|
||||
m.scene = task.getScene()
|
||||
end function
|
||||
|
||||
@get("/api/playlet-lib-urls")
|
||||
function GetPlayletLibUrls(context as object) as boolean
|
||||
response = context.response
|
||||
|
||||
saved = RegistryUtils.Read(RegistryUtils.PLAYLET_LIB_URLS)
|
||||
if saved <> invalid
|
||||
saved = ParseJson(saved)
|
||||
end if
|
||||
|
||||
response.Json({
|
||||
loaded: m.scene.playletLibLoadedUrl
|
||||
saved: saved
|
||||
})
|
||||
return true
|
||||
end function
|
||||
|
||||
@post("/api/playlet-lib-urls")
|
||||
function SetPlayletLibUrls(context as object) as boolean
|
||||
request = context.request
|
||||
response = context.response
|
||||
|
||||
payload = request.Json()
|
||||
if payload = invalid or not IsArray(payload)
|
||||
response.Default(400, "Invalid payload")
|
||||
return true
|
||||
end if
|
||||
|
||||
if payload.Count() = 0
|
||||
response.Default(400, "Payload must contain at least one item")
|
||||
return true
|
||||
end if
|
||||
|
||||
for each item in payload
|
||||
if StringUtils.IsNullOrEmpty(item.link) or StringUtils.IsNullOrEmpty(item.type)
|
||||
response.Default(400, `Invalid item in array (must have "link" and "type" properties)`)
|
||||
return true
|
||||
end if
|
||||
end for
|
||||
|
||||
RegistryUtils.Write(RegistryUtils.PLAYLET_LIB_URLS, request.body)
|
||||
|
||||
response.Default(204, "OK")
|
||||
return true
|
||||
end function
|
||||
|
||||
@delete("/api/playlet-lib-urls")
|
||||
function DeletePlayletLibUrls(context as object) as boolean
|
||||
response = context.response
|
||||
|
||||
RegistryUtils.Delete(RegistryUtils.PLAYLET_LIB_URLS)
|
||||
|
||||
response.Default(204, "OK")
|
||||
return true
|
||||
end function
|
||||
end class
|
||||
|
||||
end namespace
|
||||
@@ -2,64 +2,44 @@ namespace Http
|
||||
|
||||
class PreferencesRouter extends HttpRouter
|
||||
|
||||
function new()
|
||||
function new(server as object)
|
||||
super()
|
||||
|
||||
' Get preferences
|
||||
m.Get("/api/preferences", function(context as object) as boolean
|
||||
response = context.response
|
||||
task = context.server.task
|
||||
preferences = task.preferences
|
||||
m.preferencesNode = server.task.preferences
|
||||
end function
|
||||
|
||||
if preferences = invalid
|
||||
response.Default(500, `Reference to "preferences" object was invalid`)
|
||||
return true
|
||||
end if
|
||||
@get("/api/preferences")
|
||||
function GetPreferences(context as object) as boolean
|
||||
response = context.response
|
||||
|
||||
userPrefs = preferences@.GetUserPreferences()
|
||||
response.Json(userPrefs)
|
||||
userPrefs = m.preferencesNode@.GetUserPreferences()
|
||||
response.Json(userPrefs)
|
||||
return true
|
||||
end function
|
||||
|
||||
@put("/api/preferences")
|
||||
function UpdatePreferences(context as object) as boolean
|
||||
request = context.request
|
||||
response = context.response
|
||||
|
||||
payload = request.Json()
|
||||
if payload = invalid
|
||||
response.Default(400, `Invalid JSON payload`)
|
||||
return true
|
||||
end function)
|
||||
end if
|
||||
|
||||
' Update preferences
|
||||
m.Put("/api/preferences", function(context as object) as boolean
|
||||
request = context.request
|
||||
response = context.response
|
||||
task = context.server.task
|
||||
preferences = task.preferences
|
||||
m.preferencesNode@.ApplyUserPreferences(payload)
|
||||
response.Default(204, "OK")
|
||||
return true
|
||||
end function
|
||||
|
||||
payload = request.Json()
|
||||
if payload = invalid
|
||||
response.Default(400, `Invalid JSON payload`)
|
||||
return true
|
||||
end if
|
||||
|
||||
if preferences = invalid
|
||||
response.Default(500, `Reference to "preferences" object was invalid`)
|
||||
return true
|
||||
end if
|
||||
|
||||
preferences@.ApplyUserPreferences(payload)
|
||||
response.Default(204, "OK")
|
||||
return true
|
||||
end function)
|
||||
|
||||
' Reset default preferences
|
||||
m.Delete("/api/preferences", function(context as object) as boolean
|
||||
response = context.response
|
||||
task = context.server.task
|
||||
preferences = task.preferences
|
||||
|
||||
if preferences = invalid
|
||||
response.Default(500, `Reference to "preferences" object was invalid`)
|
||||
return true
|
||||
end if
|
||||
|
||||
preferences@.ClearUserPreferences()
|
||||
response.Default(204, "OK")
|
||||
return true
|
||||
end function)
|
||||
@delete("/api/preferences")
|
||||
function ResetPreferences(context as object) as boolean
|
||||
response = context.response
|
||||
|
||||
m.preferencesNode@.ClearUserPreferences()
|
||||
response.Default(204, "OK")
|
||||
return true
|
||||
end function
|
||||
|
||||
end class
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
#if DEBUG
|
||||
import "pkg:/source/utils/RegistryUtils.bs"
|
||||
|
||||
namespace Http
|
||||
|
||||
class RegistryRouter extends HttpRouter
|
||||
|
||||
function new()
|
||||
super()
|
||||
end function
|
||||
|
||||
@get("/debug/registry")
|
||||
function GetRegistry(context as object) as boolean
|
||||
response = context.response
|
||||
|
||||
registryValues = RegistryUtils.ReadAll()
|
||||
response.Json(registryValues)
|
||||
return true
|
||||
end function
|
||||
|
||||
@post("/debug/registry")
|
||||
function SetRegistry(context as object) as boolean
|
||||
request = context.request
|
||||
response = context.response
|
||||
|
||||
payload = request.Json()
|
||||
if payload = invalid
|
||||
response.Default(400, "Invalid JSON")
|
||||
return true
|
||||
end if
|
||||
|
||||
RegistryUtils.WriteAll(payload)
|
||||
response.Default(204, "OK")
|
||||
return true
|
||||
end function
|
||||
|
||||
@delete("/debug/registry")
|
||||
function ClearRegistry(context as object) as boolean
|
||||
response = context.response
|
||||
|
||||
RegistryUtils.DeleteAll()
|
||||
response.Default(204, "OK")
|
||||
return true
|
||||
end function
|
||||
|
||||
end class
|
||||
|
||||
end namespace
|
||||
#end if
|
||||
@@ -4,49 +4,49 @@ namespace Http
|
||||
|
||||
class SearchHistoryRouter extends HttpRouter
|
||||
|
||||
function new()
|
||||
function new(server as object)
|
||||
super()
|
||||
|
||||
m.Get("/api/search-history", function(context as object) as boolean
|
||||
response = context.response
|
||||
task = context.server.task
|
||||
preferences = task.preferences
|
||||
m.preferencesNode = server.task.preferences
|
||||
end function
|
||||
|
||||
response.Json(SearchHistoryUtils.GetAllSaved(preferences))
|
||||
@get("/api/search-history")
|
||||
function GetSearchHistory(context as object) as boolean
|
||||
response = context.response
|
||||
|
||||
response.Json(SearchHistoryUtils.GetAllSaved(m.preferencesNode))
|
||||
return true
|
||||
end function
|
||||
|
||||
@post("/api/search-history")
|
||||
function AddSearchHistory(context as object) as boolean
|
||||
request = context.request
|
||||
response = context.response
|
||||
|
||||
payload = request.Json()
|
||||
if payload = invalid
|
||||
response.Default(400, `Invalid JSON payload`)
|
||||
return true
|
||||
end function)
|
||||
end if
|
||||
|
||||
m.Put("/api/search-history", function(context as object) as boolean
|
||||
request = context.request
|
||||
response = context.response
|
||||
task = context.server.task
|
||||
preferences = task.preferences
|
||||
|
||||
payload = request.Json()
|
||||
if payload = invalid
|
||||
response.Default(400, `Invalid JSON payload`)
|
||||
return true
|
||||
end if
|
||||
|
||||
query = payload.query
|
||||
if query = invalid
|
||||
response.Default(400, `missing "query" property in JSON payload`)
|
||||
return true
|
||||
end if
|
||||
|
||||
SearchHistoryUtils.Save(preferences, query)
|
||||
response.Json(SearchHistoryUtils.GetAllSaved(preferences))
|
||||
query = payload.query
|
||||
if query = invalid
|
||||
response.Default(400, `missing "query" property in JSON payload`)
|
||||
return true
|
||||
end function)
|
||||
end if
|
||||
|
||||
m.Delete("/api/search-history", function(context as object) as boolean
|
||||
response = context.response
|
||||
SearchHistoryUtils.Save(m.preferencesNode, query)
|
||||
response.Json(SearchHistoryUtils.GetAllSaved(m.preferencesNode))
|
||||
return true
|
||||
end function
|
||||
|
||||
SearchHistoryUtils.Clear()
|
||||
response.Default(204, "OK")
|
||||
return true
|
||||
end function)
|
||||
@delete("/api/search-history")
|
||||
function ClearSearchHistory(context as object) as boolean
|
||||
response = context.response
|
||||
|
||||
SearchHistoryUtils.Clear()
|
||||
response.Default(204, "OK")
|
||||
return true
|
||||
end function
|
||||
|
||||
end class
|
||||
|
||||
@@ -4,67 +4,69 @@ namespace Http
|
||||
|
||||
class StateApiRouter extends HttpRouter
|
||||
|
||||
function new()
|
||||
function new(server as object)
|
||||
super()
|
||||
|
||||
m.Get("/api/state", function(context as object) as boolean
|
||||
request = context.request
|
||||
response = context.response
|
||||
task = context.server.task
|
||||
applicationInfoNode = task.applicationInfo
|
||||
preferencesNode = task.preferences
|
||||
invidiousNode = task.invidious
|
||||
task = server.task
|
||||
m.applicationInfoNode = task.applicationInfo
|
||||
m.invidiousNode = task.invidious
|
||||
m.preferencesNode = task.preferences
|
||||
end function
|
||||
|
||||
keys = ["app", "device", "invidious", "preferences"]
|
||||
@get("/api/state")
|
||||
function GetState(context as object) as boolean
|
||||
request = context.request
|
||||
response = context.response
|
||||
|
||||
if request.query.DoesExist("key")
|
||||
keys = request.query["key"]
|
||||
if not IsArray(keys)
|
||||
keys = [keys]
|
||||
end if
|
||||
keys = ["app", "device", "invidious", "preferences"]
|
||||
|
||||
if request.query.DoesExist("key")
|
||||
keys = request.query["key"]
|
||||
if not IsArray(keys)
|
||||
keys = [keys]
|
||||
end if
|
||||
end if
|
||||
|
||||
state = {}
|
||||
|
||||
if ArrayUtils.IndexOfString(keys, "app") <> -1
|
||||
appInfo = m.applicationInfoNode@.GetAppInfo()
|
||||
|
||||
if appInfo.lib_version_latest = "N/A"
|
||||
' If the lib_version_latest field is not available, we can give it a few seconds
|
||||
' To make a request to Github to get the latest version.
|
||||
msgPort = CreateObject("roMessagePort")
|
||||
m.applicationInfoNode.observeFieldScoped("lib_version_latest", msgPort)
|
||||
wait(5000, msgPort)
|
||||
m.applicationInfoNode.unobserveFieldScoped("lib_version_latest")
|
||||
|
||||
appInfo.lib_version_latest = m.applicationInfoNode.lib_version_latest
|
||||
end if
|
||||
|
||||
state = {}
|
||||
state["app"] = appInfo
|
||||
end if
|
||||
|
||||
if ArrayUtils.IndexOfString(keys, "app") <> -1
|
||||
appInfo = applicationInfoNode@.GetAppInfo()
|
||||
if ArrayUtils.IndexOfString(keys, "device") <> -1
|
||||
state["device"] = m.applicationInfoNode@.GetDeviceInfo()
|
||||
end if
|
||||
|
||||
if appInfo.lib_version_latest = "N/A"
|
||||
' If the lib_version_latest field is not available, we can give it a few seconds
|
||||
' To make a request to Github to get the latest version.
|
||||
msgPort = CreateObject("roMessagePort")
|
||||
applicationInfoNode.observeFieldScoped("lib_version_latest", msgPort)
|
||||
wait(5000, msgPort)
|
||||
applicationInfoNode.unobserveFieldScoped("lib_version_latest")
|
||||
if ArrayUtils.IndexOfString(keys, "invidious") <> -1
|
||||
authToken = m.invidiousNode.authToken
|
||||
state["invidious"] = {
|
||||
current_instance: m.invidiousNode@.GetCurrentInstance()
|
||||
auth_url: m.invidiousNode@.GetAuthorizeTokenLink()
|
||||
logged_in: authToken <> invalid
|
||||
logged_in_instance: authToken <> invalid ? authToken.instance : invalid
|
||||
logged_in_username: authToken <> invalid ? authToken.username : invalid
|
||||
}
|
||||
end if
|
||||
|
||||
appInfo.lib_version_latest = applicationInfoNode.lib_version_latest
|
||||
end if
|
||||
if ArrayUtils.IndexOfString(keys, "preferences") <> -1
|
||||
state["preferences"] = m.preferencesNode@.GetUserPreferences()
|
||||
end if
|
||||
|
||||
state["app"] = appInfo
|
||||
end if
|
||||
|
||||
if ArrayUtils.IndexOfString(keys, "device") <> -1
|
||||
state["device"] = applicationInfoNode@.GetDeviceInfo()
|
||||
end if
|
||||
|
||||
if ArrayUtils.IndexOfString(keys, "invidious") <> -1
|
||||
authToken = invidiousNode.authToken
|
||||
state["invidious"] = {
|
||||
current_instance: invidiousNode@.GetCurrentInstance()
|
||||
auth_url: invidiousNode@.GetAuthorizeTokenLink()
|
||||
logged_in: authToken <> invalid
|
||||
logged_in_instance: authToken <> invalid ? authToken.instance : invalid
|
||||
logged_in_username: authToken <> invalid ? authToken.username : invalid
|
||||
}
|
||||
end if
|
||||
|
||||
if ArrayUtils.IndexOfString(keys, "preferences") <> -1
|
||||
state["preferences"] = preferencesNode@.GetUserPreferences()
|
||||
end if
|
||||
|
||||
response.Json(state)
|
||||
return true
|
||||
end function)
|
||||
response.Json(state)
|
||||
return true
|
||||
end function
|
||||
|
||||
end class
|
||||
|
||||
@@ -6,37 +6,39 @@ namespace Http
|
||||
|
||||
class ViewRouter extends HttpRouter
|
||||
|
||||
function new()
|
||||
function new(server as object)
|
||||
super()
|
||||
|
||||
m.Get("/api/view/open", function(context as object) as boolean
|
||||
request = context.request
|
||||
response = context.response
|
||||
appController = context.server.task.appController
|
||||
m.appController = server.task.appController
|
||||
end function
|
||||
|
||||
playlistId = request.query.playlistId
|
||||
authorId = request.query.authorId
|
||||
@get("/api/view/open")
|
||||
function OpenView(context as object) as boolean
|
||||
request = context.request
|
||||
response = context.response
|
||||
|
||||
if not StringUtils.IsNullOrEmpty(playlistId)
|
||||
contentNode = InvidiousContent.ToPlaylistContentNode(invalid, { playlistId: playlistId }, invalid)
|
||||
PlaylistUtils.Open(contentNode, appController)
|
||||
if VideoUtils.IsVideoPlayerOpen() and VideoUtils.IsVideoPlayerFullScreen()
|
||||
VideoUtils.ToggleVideoPictureInPicture()
|
||||
end if
|
||||
response.Default(204, "OK")
|
||||
else if not StringUtils.IsNullOrEmpty(authorId)
|
||||
contentNode = InvidiousContent.ToChannelContentNode(invalid, { authorId: authorId }, invalid)
|
||||
ChannelUtils.Open(contentNode, appController)
|
||||
if VideoUtils.IsVideoPlayerOpen() and VideoUtils.IsVideoPlayerFullScreen()
|
||||
VideoUtils.ToggleVideoPictureInPicture()
|
||||
end if
|
||||
response.Default(204, "OK")
|
||||
else
|
||||
response.Default(400, "Invalid request")
|
||||
playlistId = request.query.playlistId
|
||||
authorId = request.query.authorId
|
||||
|
||||
if not StringUtils.IsNullOrEmpty(playlistId)
|
||||
contentNode = InvidiousContent.ToPlaylistContentNode(invalid, { playlistId: playlistId }, invalid)
|
||||
PlaylistUtils.Open(contentNode, m.appController)
|
||||
if VideoUtils.IsVideoPlayerOpen() and VideoUtils.IsVideoPlayerFullScreen()
|
||||
VideoUtils.ToggleVideoPictureInPicture()
|
||||
end if
|
||||
response.Default(204, "OK")
|
||||
else if not StringUtils.IsNullOrEmpty(authorId)
|
||||
contentNode = InvidiousContent.ToChannelContentNode(invalid, { authorId: authorId }, invalid)
|
||||
ChannelUtils.Open(contentNode, m.appController)
|
||||
if VideoUtils.IsVideoPlayerOpen() and VideoUtils.IsVideoPlayerFullScreen()
|
||||
VideoUtils.ToggleVideoPictureInPicture()
|
||||
end if
|
||||
response.Default(204, "OK")
|
||||
else
|
||||
response.Default(400, "Invalid request")
|
||||
end if
|
||||
|
||||
return true
|
||||
end function)
|
||||
return true
|
||||
end function
|
||||
|
||||
end class
|
||||
|
||||
@@ -2,10 +2,12 @@ import "pkg:/components/parts/AutoBind/OnNodeReadyNoOp.bs"
|
||||
import "pkg:/components/Web/PlayletWebServer/Middleware/BookmarksRouter.bs"
|
||||
import "pkg:/components/Web/PlayletWebServer/Middleware/DashRouter.bs"
|
||||
import "pkg:/components/Web/PlayletWebServer/Middleware/HomeLayoutRouter.bs"
|
||||
import "pkg:/components/Web/PlayletWebServer/Middleware/HomeRouter.bs"
|
||||
import "pkg:/components/Web/PlayletWebServer/Middleware/InvidiousRouter.bs"
|
||||
import "pkg:/components/Web/PlayletWebServer/Middleware/PlayletLibUrlsRouter.bs"
|
||||
import "pkg:/components/Web/PlayletWebServer/Middleware/PlayQueueRouter.bs"
|
||||
import "pkg:/components/Web/PlayletWebServer/Middleware/PreferencesRouter.bs"
|
||||
import "pkg:/components/Web/PlayletWebServer/Middleware/RegistryRouter.bs"
|
||||
import "pkg:/components/Web/PlayletWebServer/Middleware/SearchHistoryRouter.bs"
|
||||
import "pkg:/components/Web/PlayletWebServer/Middleware/StateApiRouter.bs"
|
||||
import "pkg:/components/Web/PlayletWebServer/Middleware/ViewRouter.bs"
|
||||
@@ -29,34 +31,29 @@ function GetServerAddress(_unused as dynamic) as dynamic
|
||||
end function
|
||||
|
||||
function SetupRoutes(server as object)
|
||||
homeRouter = new Http.HttpRouter()
|
||||
homeRouter.Get("/", function(context as object) as boolean
|
||||
response = context.response
|
||||
response.Redirect("/index.html")
|
||||
return true
|
||||
end function)
|
||||
|
||||
server.UseRouter(new Http.CorsMiddleware())
|
||||
if server.settings.WebSocketsEnabled
|
||||
server.UseRouter(new Http.WebSocketMiddleware())
|
||||
end if
|
||||
server.UseRouter(homeRouter)
|
||||
server.UseRouter(new Http.StateApiRouter())
|
||||
server.UseRouter(new Http.DashRouter())
|
||||
server.UseRouter(new Http.PreferencesRouter())
|
||||
server.UseRouter(new Http.InvidiousRouter())
|
||||
server.UseRouter(new Http.PlayQueueRouter())
|
||||
server.UseRouter(new Http.BookmarksRouter())
|
||||
server.UseRouter(new Http.HomeLayoutRouter())
|
||||
server.UseRouter(new Http.ViewRouter())
|
||||
server.UseRouter(new Http.SearchHistoryRouter())
|
||||
server.UseRouter(new Http.PlayletLibUrlsRouter())
|
||||
server.UseRouter(new Http.HomeRouter())
|
||||
server.UseRouter(new Http.StateApiRouter(server))
|
||||
server.UseRouter(new Http.DashRouter(server))
|
||||
server.UseRouter(new Http.PreferencesRouter(server))
|
||||
server.UseRouter(new Http.InvidiousRouter(server))
|
||||
server.UseRouter(new Http.PlayQueueRouter(server))
|
||||
server.UseRouter(new Http.BookmarksRouter(server))
|
||||
server.UseRouter(new Http.HomeLayoutRouter(server))
|
||||
server.UseRouter(new Http.ViewRouter(server))
|
||||
server.UseRouter(new Http.SearchHistoryRouter(server))
|
||||
server.UseRouter(new Http.PlayletLibUrlsRouter(server))
|
||||
|
||||
etags = new Http.EtagUtils()
|
||||
server.UseRouter(new Http.HttpStaticFilesRouter("/", "libpkg:/www", etags, { staticFiles: true }))
|
||||
server.UseRouter(new Http.HttpStaticFilesRouter("/config", "libpkg:/config", etags, { staticFiles: true }))
|
||||
server.UseRouter(new Http.HttpStaticFilesRouter("/logs", "cachefs:/logs", etags, { fsCheck: true }))
|
||||
#if DEBUG
|
||||
server.UseRouter(new Http.RegistryRouter())
|
||||
|
||||
options = { showDirectories: true, showHidden: true, staticFiles: true }
|
||||
server.UseRouter(new Http.HttpStaticFilesRouter("/debug/libpkg", "libpkg:/", etags, options))
|
||||
options = { showDirectories: true, showHidden: true, fsCheck: true, staticFiles: true }
|
||||
|
||||
@@ -174,7 +174,7 @@ namespace Http
|
||||
|
||||
function SetState(newState as Http.HttpConnectionState)
|
||||
if m.state <> newState
|
||||
LogDebug(m, "state change" + Stri(m.state) + " ->" + Stri(newState))
|
||||
' LogDebug("state change" + Stri(m.state) + " ->" + Stri(newState))
|
||||
m.state = newState
|
||||
end if
|
||||
end function
|
||||
|
||||
@@ -58,11 +58,11 @@ namespace Http
|
||||
m.http_code = errcode
|
||||
|
||||
buffer = `<html><head><title>${errcode} ${errname}</title></head><body>
|
||||
<h1>${errname}</h1>
|
||||
${reason}
|
||||
<hr>
|
||||
${m.GeneratedBy()}
|
||||
</body></html>`
|
||||
<h1>${errname}</h1>
|
||||
${reason}
|
||||
<hr>
|
||||
${m.GeneratedBy()}
|
||||
</body></html>`
|
||||
|
||||
m.SetBodyDataString(buffer)
|
||||
m.ContentType("text/html")
|
||||
|
||||
@@ -2,48 +2,36 @@ namespace Http
|
||||
|
||||
class HttpRouter
|
||||
|
||||
' [{
|
||||
' method: "GET"
|
||||
' path: "/example"
|
||||
' router: router as HttpRouter
|
||||
' func: func as string
|
||||
' }]
|
||||
private routes
|
||||
|
||||
function new()
|
||||
m.routes = []
|
||||
end function
|
||||
|
||||
function Get(path as string, handler as function)
|
||||
m.routes.push({ method: "GET", path: path, handler: handler })
|
||||
end function
|
||||
|
||||
function Head(path as string, handler as function)
|
||||
m.routes.push({ method: "HEAD", path: path, handler: handler })
|
||||
end function
|
||||
|
||||
function Post(path as string, handler as function)
|
||||
m.routes.push({ method: "POST", path: path, handler: handler })
|
||||
end function
|
||||
|
||||
function Put(path as string, handler as function)
|
||||
m.routes.push({ method: "PUT", path: path, handler: handler })
|
||||
end function
|
||||
|
||||
function Delete(path as string, handler as function)
|
||||
m.routes.push({ method: "DELETE", path: path, handler: handler })
|
||||
end function
|
||||
|
||||
function All(path as string, handler as function)
|
||||
m.routes.push({ method: "*", path: path, handler: handler })
|
||||
end function
|
||||
|
||||
private function OnRequest(request as object, response as HttpResponse, connection as HttpConnection) as boolean
|
||||
for each route in m.routes
|
||||
if m.RouteMatchesRequest(route, request)
|
||||
if route.handler({
|
||||
router: m
|
||||
request: request
|
||||
response: response
|
||||
connection: connection
|
||||
server: response.server
|
||||
}) = true
|
||||
try
|
||||
if route.router[route.func]({
|
||||
request: request
|
||||
response: response
|
||||
connection: connection
|
||||
server: response.server
|
||||
}) = true
|
||||
return true
|
||||
end if
|
||||
catch error
|
||||
formattedError = ErrorUtils.Format(error)
|
||||
LogError(formattedError)
|
||||
response.Default(500, formattedError)
|
||||
return true
|
||||
end if
|
||||
end try
|
||||
end if
|
||||
end for
|
||||
return false
|
||||
|
||||
@@ -11,24 +11,24 @@ namespace Http
|
||||
m.origin = origin
|
||||
m.headers = headers
|
||||
m.methods = methods
|
||||
|
||||
m.All("*", function(context as object) as boolean
|
||||
router = context.router
|
||||
request = context.request
|
||||
response = context.response
|
||||
response.headers["Access-Control-Allow-Origin"] = router.origin
|
||||
response.headers["Access-Control-Allow-Headers"] = router.headers
|
||||
response.headers["Access-Control-Allow-Methods"] = router.methods
|
||||
|
||||
if request.method = "OPTIONS"
|
||||
response.header_only = true
|
||||
response.http_code = 200
|
||||
return true
|
||||
end if
|
||||
return false
|
||||
end function)
|
||||
end function
|
||||
|
||||
@all("*")
|
||||
function AddAccessControlHeaders(context as object) as boolean
|
||||
request = context.request
|
||||
response = context.response
|
||||
|
||||
response.headers["Access-Control-Allow-Origin"] = m.origin
|
||||
response.headers["Access-Control-Allow-Headers"] = m.headers
|
||||
response.headers["Access-Control-Allow-Methods"] = m.methods
|
||||
|
||||
if request.method = "OPTIONS"
|
||||
response.header_only = true
|
||||
response.http_code = 200
|
||||
return true
|
||||
end if
|
||||
return false
|
||||
end function
|
||||
end class
|
||||
|
||||
end namespace
|
||||
@@ -11,21 +11,21 @@ namespace Http
|
||||
super()
|
||||
|
||||
m.etags = etags
|
||||
end function
|
||||
|
||||
m.Get("*", function(context as object) as boolean
|
||||
router = context.router
|
||||
request = context.request
|
||||
response = context.response
|
||||
|
||||
if response.http_code <> 200
|
||||
return false
|
||||
end if
|
||||
|
||||
router.etags.AddEtagFromBody(request, response)
|
||||
router.etags.ClearContentIfNoneMatch(request, response)
|
||||
@get("*")
|
||||
function HandleEtag(context as object) as boolean
|
||||
request = context.request
|
||||
response = context.response
|
||||
|
||||
if response.http_code <> 200
|
||||
return false
|
||||
end function)
|
||||
end if
|
||||
|
||||
m.etags.AddEtagFromBody(request, response)
|
||||
m.etags.ClearContentIfNoneMatch(request, response)
|
||||
|
||||
return false
|
||||
end function
|
||||
|
||||
end class
|
||||
|
||||
@@ -11,6 +11,11 @@ namespace Http
|
||||
return false
|
||||
end if
|
||||
|
||||
cacheControl = response.headers["Cache-Control"]
|
||||
if IsString(cacheControl) and cacheControl.instr("no-cache") <> -1
|
||||
return false
|
||||
end if
|
||||
|
||||
etag = response.headers["ETag"]
|
||||
if not StringUtils.IsNullOrEmpty(etag)
|
||||
return false
|
||||
@@ -42,6 +47,11 @@ namespace Http
|
||||
return false
|
||||
end if
|
||||
|
||||
cacheControl = response.headers["Cache-Control"]
|
||||
if IsString(cacheControl) and cacheControl.instr("no-cache") <> -1
|
||||
return false
|
||||
end if
|
||||
|
||||
etag = response.headers["ETag"]
|
||||
if not StringUtils.IsNullOrEmpty(etag)
|
||||
return false
|
||||
|
||||
@@ -4,24 +4,24 @@ namespace Http
|
||||
|
||||
function new()
|
||||
super()
|
||||
|
||||
m.All("*", function(context as object) as boolean
|
||||
request = context.request
|
||||
response = context.response
|
||||
|
||||
method = request.method
|
||||
uri = request.uri
|
||||
|
||||
if method = ""
|
||||
response.Default(400, "You sent a request that the server couldn't understand.")
|
||||
else
|
||||
response.Default(404, `Cannot ${method} ${uri}`)
|
||||
end if
|
||||
|
||||
return true
|
||||
end function)
|
||||
end function
|
||||
|
||||
@all("*")
|
||||
function HandleDefault(context as object) as boolean
|
||||
request = context.request
|
||||
response = context.response
|
||||
|
||||
method = request.method
|
||||
uri = request.uri
|
||||
|
||||
if method = ""
|
||||
response.Default(400, "You sent a request that the server couldn't understand.")
|
||||
else
|
||||
response.Default(404, `Cannot ${method} ${uri}`)
|
||||
end if
|
||||
|
||||
return true
|
||||
end function
|
||||
end class
|
||||
|
||||
end namespace
|
||||
@@ -30,98 +30,98 @@ namespace Http
|
||||
m.fsCheck = ValidBool(options.fsCheck)
|
||||
' staticFiles: if true, Etag tags will be cached to skip reading the file entirely.
|
||||
m.staticFiles = ValidBool(options.staticFiles)
|
||||
|
||||
m.Get("*", function(context as object) as boolean
|
||||
router = context.router
|
||||
request = context.request
|
||||
response = context.response
|
||||
server = context.server
|
||||
|
||||
if not request.route.StartsWith(router.route)
|
||||
return false
|
||||
end if
|
||||
|
||||
path_in_route = request.route.Mid(router.route.Len())
|
||||
|
||||
decoded_path = path_in_route.DecodeUri()
|
||||
full_path = StringUtils.PathJoin(router.root, decoded_path)
|
||||
|
||||
if router.staticFiles
|
||||
' Although we have an Etag middleware, having a check here allows us to
|
||||
' skip reading the file entirely if the Etag matches.
|
||||
if router.etags.AddFileEtagFromCache(request, response, full_path)
|
||||
if router.etags.ClearContentIfNoneMatch(request, response)
|
||||
return true
|
||||
end if
|
||||
end if
|
||||
end if
|
||||
|
||||
if not router.fsCheck
|
||||
' libpkg:/ does not work with roFilesystem...
|
||||
buffer = createObject("roByteArray")
|
||||
if buffer.ReadFile(full_path) and buffer.count() > 0
|
||||
mimetype = server.utils.MimeType(decoded_path)
|
||||
response.SetBodyDataBuffer(buffer)
|
||||
response.ContentType(mimetype)
|
||||
response.http_code = 200
|
||||
|
||||
if router.staticFiles
|
||||
router.etags.AddEtagFromBody(request, response, full_path)
|
||||
end if
|
||||
return true
|
||||
end if
|
||||
end if
|
||||
|
||||
path = CreateObject("roPath", full_path)
|
||||
fs = CreateObject("roFilesystem")
|
||||
|
||||
if not path.isValid()
|
||||
' Skip, let next middleware handle it
|
||||
return false
|
||||
else if not fs.exists(path)
|
||||
' Skip, let next middleware handle it
|
||||
return false
|
||||
end if
|
||||
|
||||
stat = fs.stat(path)
|
||||
if stat = invalid
|
||||
response.Default(500, "fstat() failed.")
|
||||
return true
|
||||
end if
|
||||
|
||||
if stat.type = "directory"
|
||||
if not router.showDirectories
|
||||
response.Default(403, "Forbidden")
|
||||
return true
|
||||
end if
|
||||
response.ContentType("text/html")
|
||||
router.GenerateDirectoryListing(path, router, request, response)
|
||||
if router.staticFiles
|
||||
router.etags.AddEtagFromBody(request, response, full_path)
|
||||
end if
|
||||
return true
|
||||
else if stat.type = "file"
|
||||
mimetype = server.utils.MimeType(decoded_path)
|
||||
response.ContentType(mimetype)
|
||||
response.SetBodyDataFile(path)
|
||||
response.http_code = 200
|
||||
LogInfo("uri:", request.uri, "target:", path, "content-type:", mimetype, "content-length", stat.size)
|
||||
if router.staticFiles
|
||||
router.etags.AddEtagFromBody(request, response, full_path)
|
||||
end if
|
||||
return true
|
||||
else
|
||||
response.Default(403, "Not a regular file.")
|
||||
return true
|
||||
end if
|
||||
end function)
|
||||
end function
|
||||
|
||||
function GenerateDirectoryListing(path as object, router as object, request as HttpRequest, response as HttpResponse) as boolean
|
||||
@get("*")
|
||||
function GetFileOrFolder(context as object) as boolean
|
||||
request = context.request
|
||||
response = context.response
|
||||
server = context.server
|
||||
|
||||
if not request.route.StartsWith(m.route)
|
||||
return false
|
||||
end if
|
||||
|
||||
path_in_route = request.route.Mid(m.route.Len())
|
||||
|
||||
decoded_path = path_in_route.DecodeUri()
|
||||
full_path = StringUtils.PathJoin(m.root, decoded_path)
|
||||
|
||||
if m.staticFiles
|
||||
' Although we have an Etag middleware, having a check here allows us to
|
||||
' skip reading the file entirely if the Etag matches.
|
||||
if m.etags.AddFileEtagFromCache(request, response, full_path)
|
||||
if m.etags.ClearContentIfNoneMatch(request, response)
|
||||
return true
|
||||
end if
|
||||
end if
|
||||
end if
|
||||
|
||||
if not m.fsCheck
|
||||
' libpkg:/ does not work with roFilesystem...
|
||||
buffer = createObject("roByteArray")
|
||||
if buffer.ReadFile(full_path) and buffer.count() > 0
|
||||
mimetype = server.utils.MimeType(decoded_path)
|
||||
response.SetBodyDataBuffer(buffer)
|
||||
response.ContentType(mimetype)
|
||||
response.http_code = 200
|
||||
|
||||
if m.staticFiles
|
||||
m.etags.AddEtagFromBody(request, response, full_path)
|
||||
end if
|
||||
return true
|
||||
end if
|
||||
end if
|
||||
|
||||
path = CreateObject("roPath", full_path)
|
||||
fs = CreateObject("roFilesystem")
|
||||
|
||||
if not path.isValid()
|
||||
' Skip, let next middleware handle it
|
||||
return false
|
||||
else if not fs.exists(path)
|
||||
' Skip, let next middleware handle it
|
||||
return false
|
||||
end if
|
||||
|
||||
stat = fs.stat(path)
|
||||
if stat = invalid
|
||||
response.Default(500, "fstat() failed.")
|
||||
return true
|
||||
end if
|
||||
|
||||
if stat.type = "directory"
|
||||
if not m.showDirectories
|
||||
response.Default(403, "Forbidden")
|
||||
return true
|
||||
end if
|
||||
response.ContentType("text/html")
|
||||
m.GenerateDirectoryListing(path, request, response)
|
||||
if m.staticFiles
|
||||
m.etags.AddEtagFromBody(request, response, full_path)
|
||||
end if
|
||||
return true
|
||||
else if stat.type = "file"
|
||||
mimetype = server.utils.MimeType(decoded_path)
|
||||
response.ContentType(mimetype)
|
||||
response.SetBodyDataFile(path)
|
||||
response.http_code = 200
|
||||
LogInfo("uri:", request.uri, "target:", path, "content-type:", mimetype, "content-length", stat.size)
|
||||
if m.staticFiles
|
||||
m.etags.AddEtagFromBody(request, response, full_path)
|
||||
end if
|
||||
return true
|
||||
else
|
||||
response.Default(403, "Not a regular file.")
|
||||
return true
|
||||
end if
|
||||
end function
|
||||
|
||||
function GenerateDirectoryListing(path as object, request as HttpRequest, response as HttpResponse) as boolean
|
||||
fs = CreateObject("roFilesystem")
|
||||
dirList = fs.GetDirectoryListing(path)
|
||||
if dirList = invalid
|
||||
response.default(500, "Couldn't list directory")
|
||||
response.Default(500, "Couldn't list directory")
|
||||
return false
|
||||
end if
|
||||
|
||||
@@ -151,7 +151,7 @@ namespace Http
|
||||
uriDir = uriDir + "/"
|
||||
end if
|
||||
|
||||
routeDir = router.route
|
||||
routeDir = m.route
|
||||
if routeDir.len() > 0 and routeDir.right(1) <> "/"
|
||||
routeDir = routeDir + "/"
|
||||
end if
|
||||
@@ -162,7 +162,7 @@ namespace Http
|
||||
end if
|
||||
|
||||
for each item in dirList
|
||||
if router.showHidden or item.left(1) <> "."
|
||||
if m.showHidden or item.left(1) <> "."
|
||||
indicator = invalid
|
||||
stat = fs.stat(dir + item)
|
||||
if stat <> invalid
|
||||
|
||||
@@ -8,42 +8,43 @@ namespace Http
|
||||
|
||||
function new()
|
||||
super()
|
||||
end function
|
||||
|
||||
m.Get("*", function(context as object) as boolean
|
||||
request = context.request
|
||||
response = context.response
|
||||
connection = context.connection
|
||||
@get("*")
|
||||
function HandleWebSocketHeaders(context as object) as boolean
|
||||
request = context.request
|
||||
response = context.response
|
||||
connection = context.connection
|
||||
|
||||
if LCase(ValidString(request.headers["Connection"])) <> "upgrade"
|
||||
return false
|
||||
end if
|
||||
if LCase(ValidString(request.headers["Connection"])) <> "upgrade"
|
||||
return false
|
||||
end if
|
||||
|
||||
if LCase(ValidString(request.headers["Upgrade"])) <> "websocket"
|
||||
return false
|
||||
end if
|
||||
if LCase(ValidString(request.headers["Upgrade"])) <> "websocket"
|
||||
return false
|
||||
end if
|
||||
|
||||
webSocketKey = request.headers["Sec-WebSocket-Key"]
|
||||
if webSocketKey = invalid
|
||||
return false
|
||||
end if
|
||||
webSocketKey = request.headers["Sec-WebSocket-Key"]
|
||||
if webSocketKey = invalid
|
||||
return false
|
||||
end if
|
||||
|
||||
sha1Hash = CryptoUtils.GetSha1(webSocketKey + Http.WEB_SOCKET_MAGIC_STRING)
|
||||
buffer = CreateObject("roByteArray")
|
||||
buffer.FromHexString(sha1Hash)
|
||||
webSocketAccept = StringUtils.ToBase64(buffer.ToAsciiString())
|
||||
sha1Hash = CryptoUtils.GetSha1(webSocketKey + Http.WEB_SOCKET_MAGIC_STRING)
|
||||
buffer = CreateObject("roByteArray")
|
||||
buffer.FromHexString(sha1Hash)
|
||||
webSocketAccept = StringUtils.ToBase64(buffer.ToAsciiString())
|
||||
|
||||
response.http_code = 101
|
||||
response.headers["Connection"] = "Upgrade"
|
||||
response.headers["Upgrade"] = "websocket"
|
||||
response.headers["Sec-WebSocket-Accept"] = webSocketAccept
|
||||
response.header_only = true
|
||||
response.http_code = 101
|
||||
response.headers["Connection"] = "Upgrade"
|
||||
response.headers["Upgrade"] = "websocket"
|
||||
response.headers["Sec-WebSocket-Accept"] = webSocketAccept
|
||||
response.header_only = true
|
||||
|
||||
' We want this connection to be upgraded to a WebSocket connection
|
||||
' The connection will stop being handled by the HTTP server and will be handled by the WebSocket server
|
||||
connection.ws_upgrade = true
|
||||
' We want this connection to be upgraded to a WebSocket connection
|
||||
' The connection will stop being handled by the HTTP server and will be handled by the WebSocket server
|
||||
connection.ws_upgrade = true
|
||||
|
||||
return true
|
||||
end function)
|
||||
return true
|
||||
end function
|
||||
|
||||
end class
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import "pkg:/source/utils/NodePathUtils.bs"
|
||||
|
||||
' Bind all nodes that registered for auto-binding
|
||||
' Should be called once from a root node
|
||||
' Can be called later to rebind nodes that were added after the first call
|
||||
@@ -35,7 +37,7 @@ function BindNodeFieldsAndProps(_unused as dynamic) as void
|
||||
if node.getField(fieldId) <> invalid
|
||||
continue for
|
||||
end if
|
||||
reference = FindNodeFromPath(node, bindings.fields[fieldId])
|
||||
reference = NodePathUtils.FindNodeFromPath(node, bindings.fields[fieldId])
|
||||
if reference <> invalid
|
||||
node[fieldId] = reference
|
||||
end if
|
||||
@@ -54,7 +56,7 @@ function BindNodeFieldsAndProps(_unused as dynamic) as void
|
||||
if child.getField(childPropId) <> invalid
|
||||
continue for
|
||||
end if
|
||||
reference = FindNodeFromPath(child, childProps[childPropId])
|
||||
reference = NodePathUtils.FindNodeFromPath(child, childProps[childPropId])
|
||||
if reference <> invalid
|
||||
child[childPropId] = reference
|
||||
end if
|
||||
@@ -63,38 +65,6 @@ function BindNodeFieldsAndProps(_unused as dynamic) as void
|
||||
end if
|
||||
end function
|
||||
|
||||
function FindNodeFromPath(root as object, path as string) as object
|
||||
node = root
|
||||
|
||||
if path.StartsWith("/")
|
||||
node = node.getScene()
|
||||
path = path.Mid(1)
|
||||
end if
|
||||
|
||||
pathParts = path.Tokenize("/")
|
||||
|
||||
for i = 0 to pathParts.Count() - 1
|
||||
if node = invalid
|
||||
return invalid
|
||||
end if
|
||||
if pathParts[i] = "."
|
||||
continue for
|
||||
end if
|
||||
if pathParts[i] = ".."
|
||||
node = node.getParent()
|
||||
continue for
|
||||
end if
|
||||
node = node.findNode(pathParts[i])
|
||||
end for
|
||||
|
||||
if root.isSameNode(node)
|
||||
' if a node is referencing itself, it's probably a mistake
|
||||
return invalid
|
||||
end if
|
||||
|
||||
return node
|
||||
end function
|
||||
|
||||
' Create scoped fields (m.fieldName) for all fields in this node
|
||||
' To be called after BindNodeFieldsAndProps
|
||||
function BindScopeFields(_unused as dynamic)
|
||||
|
||||
@@ -2,4 +2,5 @@
|
||||
|
||||
function Init()
|
||||
InitializeBindings() ' auto-generated!
|
||||
end function'//# sourceMappingURL=./AutoBindNode1.bs.map
|
||||
end function
|
||||
'//# sourceMappingURL=./AutoBindNode1.brs.map
|
||||
@@ -12,6 +12,7 @@
|
||||
<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:/components/parts/AutoBind/OnNodeReadyNoOp.brs" />
|
||||
<script type="text/brightscript" uri="pkg:/source/utils/NodePathUtils.brs" />
|
||||
<script type="text/brightscript" uri="pkg:/source/bslib.brs" />
|
||||
<children>
|
||||
<AutoBindNode2 id="AutoBindNode2" />
|
||||
|
||||
+2
-1
@@ -2,4 +2,5 @@
|
||||
|
||||
function Init()
|
||||
InitializeBindings() ' auto-generated!
|
||||
end function'//# sourceMappingURL=./AutoBindNode1Container.bs.map
|
||||
end function
|
||||
'//# sourceMappingURL=./AutoBindNode1Container.brs.map
|
||||
@@ -10,6 +10,7 @@
|
||||
<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:/components/parts/AutoBind/OnNodeReadyNoOp.brs" />
|
||||
<script type="text/brightscript" uri="pkg:/source/utils/NodePathUtils.brs" />
|
||||
<script type="text/brightscript" uri="pkg:/source/bslib.brs" />
|
||||
<children>
|
||||
<AutoBindNode1 id="AutoBindNode1" reference2=".." />
|
||||
|
||||
+2
-1
@@ -8,4 +8,5 @@ function InitializeBindings()
|
||||
|
||||
}
|
||||
}
|
||||
end function'//# sourceMappingURL=./AutoBindNode1Container_bindings.bs.map
|
||||
end function
|
||||
'//# sourceMappingURL=./AutoBindNode1Container_bindings.brs.map
|
||||
+2
-1
@@ -8,4 +8,5 @@ function InitializeBindings()
|
||||
|
||||
}
|
||||
}
|
||||
end function'//# sourceMappingURL=./AutoBindNode1_bindings.bs.map
|
||||
end function
|
||||
'//# sourceMappingURL=./AutoBindNode1_bindings.brs.map
|
||||
@@ -2,4 +2,5 @@
|
||||
|
||||
function Init()
|
||||
InitializeBindings() ' auto-generated!
|
||||
end function'//# sourceMappingURL=./AutoBindNode2.bs.map
|
||||
end function
|
||||
'//# sourceMappingURL=./AutoBindNode2.brs.map
|
||||
@@ -12,6 +12,7 @@
|
||||
<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:/components/parts/AutoBind/OnNodeReadyNoOp.brs" />
|
||||
<script type="text/brightscript" uri="pkg:/source/utils/NodePathUtils.brs" />
|
||||
<script type="text/brightscript" uri="pkg:/source/bslib.brs" />
|
||||
</component>
|
||||
<!--//# sourceMappingURL=./AutoBindNode2.xml.map -->
|
||||
+2
-1
@@ -9,4 +9,5 @@ function InitializeBindings()
|
||||
|
||||
}
|
||||
}
|
||||
end function'//# sourceMappingURL=./AutoBindNode2_bindings.bs.map
|
||||
end function
|
||||
'//# sourceMappingURL=./AutoBindNode2_bindings.brs.map
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 9.6 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 7.3 KiB |
@@ -3,7 +3,7 @@ title=PlayletLib
|
||||
# Do not update version manually, it is auto updated from package.json
|
||||
major_version=0
|
||||
minor_version=19
|
||||
build_version=00001
|
||||
build_version=00002
|
||||
|
||||
ui_resolutions=hd
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ namespace Tests
|
||||
class ApplicationInfoTests extends Rooibos.BaseTestSuite
|
||||
|
||||
protected override function setup()
|
||||
m.ipAddressRegex = CreateObject("roRegex", "\d+\.\d+\.\d+.\d+", "")
|
||||
m.ipAddressRegex = /\d+\.\d+\.\d+.\d+/
|
||||
end function
|
||||
|
||||
protected override function beforeEach()
|
||||
|
||||
@@ -242,6 +242,11 @@ namespace HttpClient
|
||||
return m
|
||||
end function
|
||||
|
||||
function UseHttp2() as HttpRequest
|
||||
m._useHttp2 = true
|
||||
return m
|
||||
end function
|
||||
|
||||
function Cancellation(cancellation as object) as HttpRequest
|
||||
m._cancellation = cancellation
|
||||
return m
|
||||
@@ -261,6 +266,10 @@ namespace HttpClient
|
||||
command += ` \\\n --compressed`
|
||||
end if
|
||||
|
||||
if m._useHttp2 = true
|
||||
command += ` \\\n --http2`
|
||||
end if
|
||||
|
||||
if m._headers <> invalid
|
||||
for each key in m._headers
|
||||
command += ` \\\n -H '${key}: ${m._headers[key]}'`
|
||||
@@ -489,6 +498,11 @@ namespace HttpClient
|
||||
urlTransfer.SetCertificatesFile("common:/certs/ca-bundle.crt")
|
||||
urlTransfer.InitClientCertificates()
|
||||
end if
|
||||
|
||||
if m._useHttp2 = true
|
||||
urlTransfer.SetHttpVersion("http2")
|
||||
end if
|
||||
|
||||
return urlTransfer
|
||||
end function
|
||||
|
||||
|
||||
@@ -32,6 +32,17 @@ class XmlObject
|
||||
end if
|
||||
end function
|
||||
|
||||
function TextNode(name as string, text as string, attributes = invalid as object)
|
||||
m.Node(name, attributes)
|
||||
m.Text(text)
|
||||
m.End()
|
||||
end function
|
||||
|
||||
function EmptyNode(name as string, attributes = invalid as object)
|
||||
m.Node(name, attributes)
|
||||
m.End()
|
||||
end function
|
||||
|
||||
function End()
|
||||
m.stack.pop()
|
||||
end function
|
||||
|
||||
@@ -49,7 +49,8 @@ end function
|
||||
|
||||
function AssocArrayToString(dict as object) as string
|
||||
result = "{"
|
||||
count = dict.count()
|
||||
' This is in case the dictionary has a `count` key
|
||||
count = dict.ifAssociativeArray.count()
|
||||
i = 0
|
||||
for each key in dict
|
||||
result += key + ": " + ToString(dict[key])
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
namespace NodePathUtils
|
||||
|
||||
function FindNodeFromPath(root as object, path as string) as object
|
||||
node = root
|
||||
|
||||
if path.StartsWith("/")
|
||||
node = node.getScene()
|
||||
path = path.Mid(1)
|
||||
end if
|
||||
|
||||
pathParts = path.Tokenize("/")
|
||||
|
||||
for i = 0 to pathParts.Count() - 1
|
||||
if node = invalid
|
||||
return invalid
|
||||
end if
|
||||
if pathParts[i] = "."
|
||||
continue for
|
||||
end if
|
||||
if pathParts[i] = ".."
|
||||
node = node.getParent()
|
||||
continue for
|
||||
end if
|
||||
node = node.findNode(pathParts[i])
|
||||
end for
|
||||
|
||||
if root.isSameNode(node)
|
||||
' if a node is referencing itself, it's probably a mistake
|
||||
return invalid
|
||||
end if
|
||||
|
||||
return node
|
||||
end function
|
||||
|
||||
end namespace
|
||||
@@ -13,24 +13,24 @@ namespace RegistryUtils
|
||||
' "invidious_instances" is deprecated, but we keep for migration purposes
|
||||
const INVIDIOUS_INSTANCES = "invidious_instances"
|
||||
|
||||
function Read(key as string, section = DEFAULT_SECTION as string) as dynamic
|
||||
sec = CreateObject("roRegistrySection", section)
|
||||
if sec.Exists(key)
|
||||
return sec.Read(key)
|
||||
function Read(key as string, sectionName = DEFAULT_SECTION as string) as dynamic
|
||||
section = CreateObject("roRegistrySection", sectionName)
|
||||
if section.Exists(key)
|
||||
return section.Read(key)
|
||||
end if
|
||||
return invalid
|
||||
end function
|
||||
|
||||
function Write(key as string, value as string, section = DEFAULT_SECTION as string)
|
||||
sec = CreateObject("roRegistrySection", section)
|
||||
sec.Write(key, value)
|
||||
sec.Flush()
|
||||
function Write(key as string, value as string, sectionName = DEFAULT_SECTION as string)
|
||||
section = CreateObject("roRegistrySection", sectionName)
|
||||
section.Write(key, value)
|
||||
section.Flush()
|
||||
end function
|
||||
|
||||
function Delete(key as string, section = DEFAULT_SECTION as string)
|
||||
sec = CreateObject("roRegistrySection", section)
|
||||
sec.Delete(key)
|
||||
sec.Flush()
|
||||
function Delete(key as string, sectionName = DEFAULT_SECTION as string)
|
||||
section = CreateObject("roRegistrySection", sectionName)
|
||||
section.Delete(key)
|
||||
section.Flush()
|
||||
end function
|
||||
|
||||
function ReadAll() as object
|
||||
@@ -46,4 +46,22 @@ namespace RegistryUtils
|
||||
return result
|
||||
end function
|
||||
|
||||
function WriteAll(values as object) as void
|
||||
DeleteAll()
|
||||
for each sectionName in values
|
||||
section = CreateObject("roRegistrySection", sectionName)
|
||||
section.WriteMulti(values[sectionName])
|
||||
section.Flush()
|
||||
end for
|
||||
end function
|
||||
|
||||
function DeleteAll() as void
|
||||
registry = CreateObject("roRegistry")
|
||||
sectionNames = registry.GetSectionList()
|
||||
for each sectionName in sectionNames
|
||||
registry.Delete(sectionName)
|
||||
end for
|
||||
registry.Flush()
|
||||
end function
|
||||
|
||||
end namespace
|
||||
Generated
+250
-276
@@ -1,31 +1,31 @@
|
||||
{
|
||||
"name": "playlet-web",
|
||||
"version": "0.19.1",
|
||||
"version": "0.19.2",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "playlet-web",
|
||||
"version": "0.19.1",
|
||||
"version": "0.19.2",
|
||||
"devDependencies": {
|
||||
"@sveltejs/vite-plugin-svelte": "^3.0.1",
|
||||
"@sveltejs/vite-plugin-svelte": "^3.0.2",
|
||||
"@tailwindcss/typography": "^0.5.10",
|
||||
"@tsconfig/svelte": "^5.0.2",
|
||||
"@vitejs/plugin-legacy": "^5.2.0",
|
||||
"autoprefixer": "^10.4.16",
|
||||
"daisyui": "^4.6.0",
|
||||
"dotenv": "^16.3.1",
|
||||
"@vitejs/plugin-legacy": "^5.3.0",
|
||||
"autoprefixer": "^10.4.17",
|
||||
"daisyui": "^4.6.2",
|
||||
"dotenv": "^16.4.1",
|
||||
"ip": "^1.1.8",
|
||||
"postcss": "^8.4.33",
|
||||
"svelte": "^4.2.8",
|
||||
"svelte-check": "^3.6.3",
|
||||
"postcss": "^8.4.35",
|
||||
"svelte": "^4.2.10",
|
||||
"svelte-check": "^3.6.4",
|
||||
"svelte-preprocess": "^5.1.3",
|
||||
"tailwindcss": "^3.4.1",
|
||||
"terser": "^5.26.0",
|
||||
"terser": "^5.27.0",
|
||||
"tslib": "^2.6.2",
|
||||
"typescript": "^5.3.3",
|
||||
"vite": "^5.0.11",
|
||||
"vite-tsconfig-paths": "^4.2.3"
|
||||
"vite": "^5.1.1",
|
||||
"vite-tsconfig-paths": "^4.3.1"
|
||||
}
|
||||
},
|
||||
"node_modules/@alloc/quick-lru": {
|
||||
@@ -66,44 +66,6 @@
|
||||
"node": ">=6.9.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/code-frame/node_modules/ansi-styles": {
|
||||
"version": "3.2.1",
|
||||
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
|
||||
"integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"color-convert": "^1.9.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/code-frame/node_modules/chalk": {
|
||||
"version": "2.4.2",
|
||||
"resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
|
||||
"integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"ansi-styles": "^3.2.1",
|
||||
"escape-string-regexp": "^1.0.5",
|
||||
"supports-color": "^5.3.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/code-frame/node_modules/supports-color": {
|
||||
"version": "5.5.0",
|
||||
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
|
||||
"integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"has-flag": "^3.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/compat-data": {
|
||||
"version": "7.23.5",
|
||||
"resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.23.5.tgz",
|
||||
@@ -114,9 +76,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/core": {
|
||||
"version": "7.23.6",
|
||||
"resolved": "https://registry.npmjs.org/@babel/core/-/core-7.23.6.tgz",
|
||||
"integrity": "sha512-FxpRyGjrMJXh7X3wGLGhNDCRiwpWEF74sKjTLDJSG5Kyvow3QZaG0Adbqzi9ZrVjTWpsX+2cxWXD71NMg93kdw==",
|
||||
"version": "7.23.9",
|
||||
"resolved": "https://registry.npmjs.org/@babel/core/-/core-7.23.9.tgz",
|
||||
"integrity": "sha512-5q0175NOjddqpvvzU+kDiSOAk4PfdO6FvwCWoQ6RO7rTzEe8vlo+4HVfcnAREhD4npMs0e9uZypjTwzZPCf/cw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@ampproject/remapping": "^2.2.0",
|
||||
@@ -124,11 +86,11 @@
|
||||
"@babel/generator": "^7.23.6",
|
||||
"@babel/helper-compilation-targets": "^7.23.6",
|
||||
"@babel/helper-module-transforms": "^7.23.3",
|
||||
"@babel/helpers": "^7.23.6",
|
||||
"@babel/parser": "^7.23.6",
|
||||
"@babel/template": "^7.22.15",
|
||||
"@babel/traverse": "^7.23.6",
|
||||
"@babel/types": "^7.23.6",
|
||||
"@babel/helpers": "^7.23.9",
|
||||
"@babel/parser": "^7.23.9",
|
||||
"@babel/template": "^7.23.9",
|
||||
"@babel/traverse": "^7.23.9",
|
||||
"@babel/types": "^7.23.9",
|
||||
"convert-source-map": "^2.0.0",
|
||||
"debug": "^4.1.0",
|
||||
"gensync": "^1.0.0-beta.2",
|
||||
@@ -199,9 +161,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/helper-create-class-features-plugin": {
|
||||
"version": "7.23.6",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.23.6.tgz",
|
||||
"integrity": "sha512-cBXU1vZni/CpGF29iTu4YRbOZt3Wat6zCoMDxRF1MayiEc4URxOj31tT65HUM0CRpMowA3HCJaAOVOUnMf96cw==",
|
||||
"version": "7.23.9",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.23.9.tgz",
|
||||
"integrity": "sha512-B2L9neXTIyPQoXDm+NtovPvG6VOLWnaXu3BIeVDWwdKFgG30oNa6CqVGiJPDWQwIAK49t9gnQI9c6K6RzabiKw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@babel/helper-annotate-as-pure": "^7.22.5",
|
||||
@@ -239,9 +201,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/helper-define-polyfill-provider": {
|
||||
"version": "0.4.4",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.4.4.tgz",
|
||||
"integrity": "sha512-QcJMILQCu2jm5TFPGA3lCpJJTeEP+mqeXooG/NZbg/h5FTFi6V0+99ahlRsW8/kRLyb24LZVCCiclDedhLKcBA==",
|
||||
"version": "0.5.0",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.5.0.tgz",
|
||||
"integrity": "sha512-NovQquuQLAQ5HuyjCz7WQP9MjRj7dx++yspwiyUiGl9ZyadHRSql1HZh5ogRd8W8w6YM6EQ/NTB8rgjLt5W65Q==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@babel/helper-compilation-targets": "^7.22.6",
|
||||
@@ -464,14 +426,14 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/helpers": {
|
||||
"version": "7.23.6",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.23.6.tgz",
|
||||
"integrity": "sha512-wCfsbN4nBidDRhpDhvcKlzHWCTlgJYUUdSJfzXb2NuBssDSIjc3xcb+znA7l+zYsFljAcGM0aFkN40cR3lXiGA==",
|
||||
"version": "7.23.9",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.23.9.tgz",
|
||||
"integrity": "sha512-87ICKgU5t5SzOT7sBMfCOZQ2rHjRU+Pcb9BoILMYz600W6DkVRLFBPwQ18gwUVvggqXivaUakpnxWQGbpywbBQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@babel/template": "^7.22.15",
|
||||
"@babel/traverse": "^7.23.6",
|
||||
"@babel/types": "^7.23.6"
|
||||
"@babel/template": "^7.23.9",
|
||||
"@babel/traverse": "^7.23.9",
|
||||
"@babel/types": "^7.23.9"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
@@ -491,54 +453,10 @@
|
||||
"node": ">=6.9.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/highlight/node_modules/ansi-styles": {
|
||||
"version": "3.2.1",
|
||||
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
|
||||
"integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"color-convert": "^1.9.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/highlight/node_modules/chalk": {
|
||||
"version": "2.4.2",
|
||||
"resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
|
||||
"integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"ansi-styles": "^3.2.1",
|
||||
"escape-string-regexp": "^1.0.5",
|
||||
"supports-color": "^5.3.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/highlight/node_modules/js-tokens": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
|
||||
"integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@babel/highlight/node_modules/supports-color": {
|
||||
"version": "5.5.0",
|
||||
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
|
||||
"integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"has-flag": "^3.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/parser": {
|
||||
"version": "7.23.6",
|
||||
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.6.tgz",
|
||||
"integrity": "sha512-Z2uID7YJ7oNvAI20O9X0bblw7Qqs8Q2hFy0R9tAfnfLkp5MW0UH9eUvnDSnFwKZ0AvgS1ucqR4KzvVHgnke1VQ==",
|
||||
"version": "7.23.9",
|
||||
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.9.tgz",
|
||||
"integrity": "sha512-9tcKgqKbs3xGJ+NtKF2ndOBBLVwPjl1SHxPQkd36r3Dlirw3xWUeGaTbqr7uGZcTaxkVNwc+03SVP7aCdWrTlA==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"parser": "bin/babel-parser.js"
|
||||
@@ -580,9 +498,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly": {
|
||||
"version": "7.23.3",
|
||||
"resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly/-/plugin-bugfix-v8-static-class-fields-redefine-readonly-7.23.3.tgz",
|
||||
"integrity": "sha512-XaJak1qcityzrX0/IU5nKHb34VaibwP3saKqG6a/tppelgllOH13LUann4ZCIBcVOeE6H18K4Vx9QKkVww3z/w==",
|
||||
"version": "7.23.7",
|
||||
"resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly/-/plugin-bugfix-v8-static-class-fields-redefine-readonly-7.23.7.tgz",
|
||||
"integrity": "sha512-LlRT7HgaifEpQA1ZgLVOIJZZFVPWN5iReq/7/JixwBtwcoeVGDBD53ZV28rrsLYOZs1Y/EHhA8N/Z6aazHR8cw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@babel/helper-environment-visitor": "^7.22.20",
|
||||
@@ -858,9 +776,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/plugin-transform-async-generator-functions": {
|
||||
"version": "7.23.4",
|
||||
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-generator-functions/-/plugin-transform-async-generator-functions-7.23.4.tgz",
|
||||
"integrity": "sha512-efdkfPhHYTtn0G6n2ddrESE91fgXxjlqLsnUtPWnJs4a4mZIbUaK7ffqKIIUKXSHwcDvaCVX6GXkaJJFqtX7jw==",
|
||||
"version": "7.23.9",
|
||||
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-generator-functions/-/plugin-transform-async-generator-functions-7.23.9.tgz",
|
||||
"integrity": "sha512-8Q3veQEDGe14dTYuwagbRtwxQDnytyg1JFu4/HwEMETeofocrB0U0ejBJIXoeG/t2oXZ8kzCyI0ZZfbT80VFNQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@babel/helper-environment-visitor": "^7.22.20",
|
||||
@@ -956,16 +874,15 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/plugin-transform-classes": {
|
||||
"version": "7.23.5",
|
||||
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.23.5.tgz",
|
||||
"integrity": "sha512-jvOTR4nicqYC9yzOHIhXG5emiFEOpappSJAl73SDSEDcybD+Puuze8Tnpb9p9qEyYup24tq891gkaygIFvWDqg==",
|
||||
"version": "7.23.8",
|
||||
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.23.8.tgz",
|
||||
"integrity": "sha512-yAYslGsY1bX6Knmg46RjiCiNSwJKv2IUC8qOdYKqMMr0491SXFhcHqOdRDeCRohOOIzwN/90C6mQ9qAKgrP7dg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@babel/helper-annotate-as-pure": "^7.22.5",
|
||||
"@babel/helper-compilation-targets": "^7.22.15",
|
||||
"@babel/helper-compilation-targets": "^7.23.6",
|
||||
"@babel/helper-environment-visitor": "^7.22.20",
|
||||
"@babel/helper-function-name": "^7.23.0",
|
||||
"@babel/helper-optimise-call-expression": "^7.22.5",
|
||||
"@babel/helper-plugin-utils": "^7.22.5",
|
||||
"@babel/helper-replace-supers": "^7.22.20",
|
||||
"@babel/helper-split-export-declaration": "^7.22.6",
|
||||
@@ -978,15 +895,6 @@
|
||||
"@babel/core": "^7.0.0-0"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/plugin-transform-classes/node_modules/globals": {
|
||||
"version": "11.12.0",
|
||||
"resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz",
|
||||
"integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/plugin-transform-computed-properties": {
|
||||
"version": "7.23.3",
|
||||
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.23.3.tgz",
|
||||
@@ -1226,9 +1134,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/plugin-transform-modules-systemjs": {
|
||||
"version": "7.23.3",
|
||||
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.23.3.tgz",
|
||||
"integrity": "sha512-ZxyKGTkF9xT9YJuKQRo19ewf3pXpopuYQd8cDXqNzc3mUNbOME0RKMoZxviQk74hwzfQsEe66dE92MaZbdHKNQ==",
|
||||
"version": "7.23.9",
|
||||
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.23.9.tgz",
|
||||
"integrity": "sha512-KDlPRM6sLo4o1FkiSlXoAa8edLXFsKKIda779fbLrvmeuc3itnjCtaO6RrtoaANsIJANj+Vk1zqbZIMhkCAHVw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@babel/helper-hoist-variables": "^7.22.5",
|
||||
@@ -1625,9 +1533,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/preset-env": {
|
||||
"version": "7.23.6",
|
||||
"resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.23.6.tgz",
|
||||
"integrity": "sha512-2XPn/BqKkZCpzYhUUNZ1ssXw7DcXfKQEjv/uXZUXgaebCMYmkEsfZ2yY+vv+xtXv50WmL5SGhyB6/xsWxIvvOQ==",
|
||||
"version": "7.23.9",
|
||||
"resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.23.9.tgz",
|
||||
"integrity": "sha512-3kBGTNBBk9DQiPoXYS0g0BYlwTQYUTifqgKTjxUwEUkduRT2QOa0FPGBJ+NROQhGyYO5BuTJwGvBnqKDykac6A==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@babel/compat-data": "^7.23.5",
|
||||
@@ -1636,7 +1544,7 @@
|
||||
"@babel/helper-validator-option": "^7.23.5",
|
||||
"@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": "^7.23.3",
|
||||
"@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": "^7.23.3",
|
||||
"@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly": "^7.23.3",
|
||||
"@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly": "^7.23.7",
|
||||
"@babel/plugin-proposal-private-property-in-object": "7.21.0-placeholder-for-preset-env.2",
|
||||
"@babel/plugin-syntax-async-generators": "^7.8.4",
|
||||
"@babel/plugin-syntax-class-properties": "^7.12.13",
|
||||
@@ -1657,13 +1565,13 @@
|
||||
"@babel/plugin-syntax-top-level-await": "^7.14.5",
|
||||
"@babel/plugin-syntax-unicode-sets-regex": "^7.18.6",
|
||||
"@babel/plugin-transform-arrow-functions": "^7.23.3",
|
||||
"@babel/plugin-transform-async-generator-functions": "^7.23.4",
|
||||
"@babel/plugin-transform-async-generator-functions": "^7.23.9",
|
||||
"@babel/plugin-transform-async-to-generator": "^7.23.3",
|
||||
"@babel/plugin-transform-block-scoped-functions": "^7.23.3",
|
||||
"@babel/plugin-transform-block-scoping": "^7.23.4",
|
||||
"@babel/plugin-transform-class-properties": "^7.23.3",
|
||||
"@babel/plugin-transform-class-static-block": "^7.23.4",
|
||||
"@babel/plugin-transform-classes": "^7.23.5",
|
||||
"@babel/plugin-transform-classes": "^7.23.8",
|
||||
"@babel/plugin-transform-computed-properties": "^7.23.3",
|
||||
"@babel/plugin-transform-destructuring": "^7.23.3",
|
||||
"@babel/plugin-transform-dotall-regex": "^7.23.3",
|
||||
@@ -1679,7 +1587,7 @@
|
||||
"@babel/plugin-transform-member-expression-literals": "^7.23.3",
|
||||
"@babel/plugin-transform-modules-amd": "^7.23.3",
|
||||
"@babel/plugin-transform-modules-commonjs": "^7.23.3",
|
||||
"@babel/plugin-transform-modules-systemjs": "^7.23.3",
|
||||
"@babel/plugin-transform-modules-systemjs": "^7.23.9",
|
||||
"@babel/plugin-transform-modules-umd": "^7.23.3",
|
||||
"@babel/plugin-transform-named-capturing-groups-regex": "^7.22.5",
|
||||
"@babel/plugin-transform-new-target": "^7.23.3",
|
||||
@@ -1705,9 +1613,9 @@
|
||||
"@babel/plugin-transform-unicode-regex": "^7.23.3",
|
||||
"@babel/plugin-transform-unicode-sets-regex": "^7.23.3",
|
||||
"@babel/preset-modules": "0.1.6-no-external-plugins",
|
||||
"babel-plugin-polyfill-corejs2": "^0.4.6",
|
||||
"babel-plugin-polyfill-corejs3": "^0.8.5",
|
||||
"babel-plugin-polyfill-regenerator": "^0.5.3",
|
||||
"babel-plugin-polyfill-corejs2": "^0.4.8",
|
||||
"babel-plugin-polyfill-corejs3": "^0.9.0",
|
||||
"babel-plugin-polyfill-regenerator": "^0.5.5",
|
||||
"core-js-compat": "^3.31.0",
|
||||
"semver": "^6.3.1"
|
||||
},
|
||||
@@ -1739,9 +1647,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@babel/runtime": {
|
||||
"version": "7.23.6",
|
||||
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.23.6.tgz",
|
||||
"integrity": "sha512-zHd0eUrf5GZoOWVCXp6koAKQTfZV07eit6bGPmJgnZdnSAvvZee6zniW2XMF7Cmc4ISOOnPy3QaSiIJGJkVEDQ==",
|
||||
"version": "7.23.9",
|
||||
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.23.9.tgz",
|
||||
"integrity": "sha512-0CX6F+BI2s9dkUqr08KFrAIZgNFj75rdBU/DjCyYLIaV/quFjkk6T+EJ2LkZHyZTbEV4L5p97mNkUsHl2wLFAw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"regenerator-runtime": "^0.14.0"
|
||||
@@ -1750,30 +1658,24 @@
|
||||
"node": ">=6.9.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/runtime/node_modules/regenerator-runtime": {
|
||||
"version": "0.14.1",
|
||||
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz",
|
||||
"integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@babel/template": {
|
||||
"version": "7.22.15",
|
||||
"resolved": "https://registry.npmjs.org/@babel/template/-/template-7.22.15.tgz",
|
||||
"integrity": "sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w==",
|
||||
"version": "7.23.9",
|
||||
"resolved": "https://registry.npmjs.org/@babel/template/-/template-7.23.9.tgz",
|
||||
"integrity": "sha512-+xrD2BWLpvHKNmX2QbpdpsBaWnRxahMwJjO+KZk2JOElj5nSmKezyS1B4u+QbHMTX69t4ukm6hh9lsYQ7GHCKA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@babel/code-frame": "^7.22.13",
|
||||
"@babel/parser": "^7.22.15",
|
||||
"@babel/types": "^7.22.15"
|
||||
"@babel/code-frame": "^7.23.5",
|
||||
"@babel/parser": "^7.23.9",
|
||||
"@babel/types": "^7.23.9"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/traverse": {
|
||||
"version": "7.23.6",
|
||||
"resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.6.tgz",
|
||||
"integrity": "sha512-czastdK1e8YByZqezMPFiZ8ahwVMh/ESl9vPgvgdB9AmFMGP5jfpFax74AQgl5zj4XHzqeYAg2l8PuUeRS1MgQ==",
|
||||
"version": "7.23.9",
|
||||
"resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.9.tgz",
|
||||
"integrity": "sha512-I/4UJ9vs90OkBtY6iiiTORVMyIhJ4kAVmsKo9KFc8UOxMeUfi2hvtIBsET5u9GizXE6/GFSuKCTNfgCswuEjRg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@babel/code-frame": "^7.23.5",
|
||||
@@ -1782,8 +1684,8 @@
|
||||
"@babel/helper-function-name": "^7.23.0",
|
||||
"@babel/helper-hoist-variables": "^7.22.5",
|
||||
"@babel/helper-split-export-declaration": "^7.22.6",
|
||||
"@babel/parser": "^7.23.6",
|
||||
"@babel/types": "^7.23.6",
|
||||
"@babel/parser": "^7.23.9",
|
||||
"@babel/types": "^7.23.9",
|
||||
"debug": "^4.3.1",
|
||||
"globals": "^11.1.0"
|
||||
},
|
||||
@@ -1791,19 +1693,10 @@
|
||||
"node": ">=6.9.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/traverse/node_modules/globals": {
|
||||
"version": "11.12.0",
|
||||
"resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz",
|
||||
"integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/types": {
|
||||
"version": "7.23.6",
|
||||
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.6.tgz",
|
||||
"integrity": "sha512-+uarb83brBzPKN38NX1MkB6vb6+mwvR6amUulqAE7ccQw1pEl+bCia9TbdG1lsnFP7lZySvUn37CHyXQdfTwzg==",
|
||||
"version": "7.23.9",
|
||||
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.9.tgz",
|
||||
"integrity": "sha512-dQjSq/7HaSjRM43FFGnv5keM2HsxpmyV1PfaSVm0nzzjwwTmjOe6J4bC8e3+pTEIgHaHj+1ZlLThRJ2auc/w1Q==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@babel/helper-string-parser": "^7.23.4",
|
||||
@@ -2425,12 +2318,12 @@
|
||||
]
|
||||
},
|
||||
"node_modules/@sveltejs/vite-plugin-svelte": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@sveltejs/vite-plugin-svelte/-/vite-plugin-svelte-3.0.1.tgz",
|
||||
"integrity": "sha512-CGURX6Ps+TkOovK6xV+Y2rn8JKa8ZPUHPZ/NKgCxAmgBrXReavzFl8aOSCj3kQ1xqT7yGJj53hjcV/gqwDAaWA==",
|
||||
"version": "3.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@sveltejs/vite-plugin-svelte/-/vite-plugin-svelte-3.0.2.tgz",
|
||||
"integrity": "sha512-MpmF/cju2HqUls50WyTHQBZUV3ovV/Uk8k66AN2gwHogNAG8wnW8xtZDhzNBsFJJuvmq1qnzA5kE7YfMJNFv2Q==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@sveltejs/vite-plugin-svelte-inspector": "^2.0.0-next.0 || ^2.0.0",
|
||||
"@sveltejs/vite-plugin-svelte-inspector": "^2.0.0",
|
||||
"debug": "^4.3.4",
|
||||
"deepmerge": "^4.3.1",
|
||||
"kleur": "^4.1.5",
|
||||
@@ -2497,18 +2390,19 @@
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@vitejs/plugin-legacy": {
|
||||
"version": "5.2.0",
|
||||
"resolved": "https://registry.npmjs.org/@vitejs/plugin-legacy/-/plugin-legacy-5.2.0.tgz",
|
||||
"integrity": "sha512-FGpxQCgyI8SHA/TkFH5vfBManyc6GYkCoYtmom924c7sKObnBE7q543RQuKK46duI4j31Nv1wg4GRNtCfsGpGQ==",
|
||||
"version": "5.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@vitejs/plugin-legacy/-/plugin-legacy-5.3.0.tgz",
|
||||
"integrity": "sha512-BhW+WcJmEgW5G/1UQRiVQ7wz9/ZPnxqzExT9n0zAk4RlqQQ/26udIeXzdU8+03AGnaF61wmZlCspexgEnxFWMA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@babel/core": "^7.23.3",
|
||||
"@babel/preset-env": "^7.23.3",
|
||||
"browserslist": "^4.22.1",
|
||||
"core-js": "^3.33.2",
|
||||
"@babel/core": "^7.23.7",
|
||||
"@babel/preset-env": "^7.23.8",
|
||||
"browserslist": "^4.22.2",
|
||||
"core-js": "^3.35.0",
|
||||
"esbuild-plugin-browserslist": "^0.10.0",
|
||||
"magic-string": "^0.30.5",
|
||||
"regenerator-runtime": "^0.14.0",
|
||||
"systemjs": "^6.14.2"
|
||||
"regenerator-runtime": "^0.14.1",
|
||||
"systemjs": "^6.14.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^18.0.0 || >=20.0.0"
|
||||
@@ -2521,23 +2415,6 @@
|
||||
"vite": "^5.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@vitejs/plugin-legacy/node_modules/core-js": {
|
||||
"version": "3.34.0",
|
||||
"resolved": "https://registry.npmjs.org/core-js/-/core-js-3.34.0.tgz",
|
||||
"integrity": "sha512-aDdvlDder8QmY91H88GzNi9EtQi2TjvQhpCX6B1v/dAZHU1AuLgHvRh54RiOerpEhEW46Tkf+vgAViB/CWC0ag==",
|
||||
"dev": true,
|
||||
"hasInstallScript": true,
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/core-js"
|
||||
}
|
||||
},
|
||||
"node_modules/@vitejs/plugin-legacy/node_modules/regenerator-runtime": {
|
||||
"version": "0.14.1",
|
||||
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz",
|
||||
"integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/acorn": {
|
||||
"version": "8.11.2",
|
||||
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.2.tgz",
|
||||
@@ -2550,6 +2427,18 @@
|
||||
"node": ">=0.4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/ansi-styles": {
|
||||
"version": "3.2.1",
|
||||
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
|
||||
"integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"color-convert": "^1.9.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/any-promise": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz",
|
||||
@@ -2585,9 +2474,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/autoprefixer": {
|
||||
"version": "10.4.16",
|
||||
"resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.16.tgz",
|
||||
"integrity": "sha512-7vd3UC6xKp0HLfua5IjZlcXvGAGy7cBAXTg2lyQ/8WpNhd6SiZ8Be+xm3FyBSYJx5GKcpRCzBh7RH4/0dnY+uQ==",
|
||||
"version": "10.4.17",
|
||||
"resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.17.tgz",
|
||||
"integrity": "sha512-/cpVNRLSfhOtcGflT13P2794gVSgmPgTR+erw5ifnMLZb0UnSlkK4tquLmkd3BhA+nLo5tX8Cu0upUsGKvKbmg==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
@@ -2604,9 +2493,9 @@
|
||||
}
|
||||
],
|
||||
"dependencies": {
|
||||
"browserslist": "^4.21.10",
|
||||
"caniuse-lite": "^1.0.30001538",
|
||||
"fraction.js": "^4.3.6",
|
||||
"browserslist": "^4.22.2",
|
||||
"caniuse-lite": "^1.0.30001578",
|
||||
"fraction.js": "^4.3.7",
|
||||
"normalize-range": "^0.1.2",
|
||||
"picocolors": "^1.0.0",
|
||||
"postcss-value-parser": "^4.2.0"
|
||||
@@ -2622,22 +2511,22 @@
|
||||
}
|
||||
},
|
||||
"node_modules/axobject-query": {
|
||||
"version": "3.2.1",
|
||||
"resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-3.2.1.tgz",
|
||||
"integrity": "sha512-jsyHu61e6N4Vbz/v18DHwWYKK0bSWLqn47eeDSKPB7m8tqMHF9YJ+mhIk2lVteyZrY8tnSj/jHOv4YiTCuCJgg==",
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-4.0.0.tgz",
|
||||
"integrity": "sha512-+60uv1hiVFhHZeO+Lz0RYzsVHy5Wr1ayX0mwda9KPDVLNJgZ1T9Ny7VmFbLDzxsH0D87I86vgj3gFrjTJUYznw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"dequal": "^2.0.3"
|
||||
}
|
||||
},
|
||||
"node_modules/babel-plugin-polyfill-corejs2": {
|
||||
"version": "0.4.7",
|
||||
"resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.4.7.tgz",
|
||||
"integrity": "sha512-LidDk/tEGDfuHW2DWh/Hgo4rmnw3cduK6ZkOI1NPFceSK3n/yAGeOsNT7FLnSGHkXj3RHGSEVkN3FsCTY6w2CQ==",
|
||||
"version": "0.4.8",
|
||||
"resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.4.8.tgz",
|
||||
"integrity": "sha512-OtIuQfafSzpo/LhnJaykc0R/MMnuLSSVjVYy9mHArIZ9qTCSZ6TpWCuEKZYVoN//t8HqBNScHrOtCrIK5IaGLg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@babel/compat-data": "^7.22.6",
|
||||
"@babel/helper-define-polyfill-provider": "^0.4.4",
|
||||
"@babel/helper-define-polyfill-provider": "^0.5.0",
|
||||
"semver": "^6.3.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
@@ -2645,25 +2534,25 @@
|
||||
}
|
||||
},
|
||||
"node_modules/babel-plugin-polyfill-corejs3": {
|
||||
"version": "0.8.7",
|
||||
"resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.8.7.tgz",
|
||||
"integrity": "sha512-KyDvZYxAzkC0Aj2dAPyDzi2Ym15e5JKZSK+maI7NAwSqofvuFglbSsxE7wUOvTg9oFVnHMzVzBKcqEb4PJgtOA==",
|
||||
"version": "0.9.0",
|
||||
"resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.9.0.tgz",
|
||||
"integrity": "sha512-7nZPG1uzK2Ymhy/NbaOWTg3uibM2BmGASS4vHS4szRZAIR8R6GwA/xAujpdrXU5iyklrimWnLWU+BLF9suPTqg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@babel/helper-define-polyfill-provider": "^0.4.4",
|
||||
"core-js-compat": "^3.33.1"
|
||||
"@babel/helper-define-polyfill-provider": "^0.5.0",
|
||||
"core-js-compat": "^3.34.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/babel-plugin-polyfill-regenerator": {
|
||||
"version": "0.5.4",
|
||||
"resolved": "https://registry.npmjs.org/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.5.4.tgz",
|
||||
"integrity": "sha512-S/x2iOCvDaCASLYsOOgWOq4bCfKYVqvO/uxjkaYyZ3rVsVE3CeAI/c84NpyuBBymEgNvHgjEot3a9/Z/kXvqsg==",
|
||||
"version": "0.5.5",
|
||||
"resolved": "https://registry.npmjs.org/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.5.5.tgz",
|
||||
"integrity": "sha512-OJGYZlhLqBh2DDHeqAxWB1XIvr49CxiJ2gIt61/PU55CQK4Z58OzMqjDe1zwQdQk+rBYsRc+1rJmdajM3gimHg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@babel/helper-define-polyfill-provider": "^0.4.4"
|
||||
"@babel/helper-define-polyfill-provider": "^0.5.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0"
|
||||
@@ -2772,9 +2661,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/caniuse-lite": {
|
||||
"version": "1.0.30001570",
|
||||
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001570.tgz",
|
||||
"integrity": "sha512-+3e0ASu4sw1SWaoCtvPeyXp+5PsjigkSt8OXZbF9StH5pQWbxEjLAZE3n8Aup5udop1uRiKA7a4utUk/uoSpUw==",
|
||||
"version": "1.0.30001579",
|
||||
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001579.tgz",
|
||||
"integrity": "sha512-u5AUVkixruKHJjw/pj9wISlcMpgFWzSrczLZbrqBSxukQixmg0SJ5sZTpvaFvxU0HoQKd4yoyAogyrAz9pzJnA==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
@@ -2791,6 +2680,20 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"node_modules/chalk": {
|
||||
"version": "2.4.2",
|
||||
"resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
|
||||
"integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"ansi-styles": "^3.2.1",
|
||||
"escape-string-regexp": "^1.0.5",
|
||||
"supports-color": "^5.3.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/chokidar": {
|
||||
"version": "3.5.3",
|
||||
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz",
|
||||
@@ -2867,10 +2770,21 @@
|
||||
"integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/core-js": {
|
||||
"version": "3.35.1",
|
||||
"resolved": "https://registry.npmjs.org/core-js/-/core-js-3.35.1.tgz",
|
||||
"integrity": "sha512-IgdsbxNyMskrTFxa9lWHyMwAJU5gXOPP+1yO+K59d50VLVAIDAbs7gIv705KzALModfK3ZrSZTPNpC0PQgIZuw==",
|
||||
"dev": true,
|
||||
"hasInstallScript": true,
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/core-js"
|
||||
}
|
||||
},
|
||||
"node_modules/core-js-compat": {
|
||||
"version": "3.34.0",
|
||||
"resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.34.0.tgz",
|
||||
"integrity": "sha512-4ZIyeNbW/Cn1wkMMDy+mvrRUxrwFNjKwbhCfQpDd+eLgYipDqp8oGFGtLmhh18EDPKA0g3VUBYOxQGGwvWLVpA==",
|
||||
"version": "3.35.1",
|
||||
"resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.35.1.tgz",
|
||||
"integrity": "sha512-sftHa5qUJY3rs9Zht1WEnmkvXputCyDBczPnr7QDgL8n3qrF3CMXY4VPSYtOLLiOUJcah2WNXREd48iOl6mQIw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"browserslist": "^4.22.2"
|
||||
@@ -2925,9 +2839,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/daisyui": {
|
||||
"version": "4.6.0",
|
||||
"resolved": "https://registry.npmjs.org/daisyui/-/daisyui-4.6.0.tgz",
|
||||
"integrity": "sha512-B5ZB/sczXpp4LMdo/SZrtYY/U2hq+Vr9I15QawuWZ0VwgtSAbuZpAZUftKVryEsPuv3BM0yVlBED0nAmtis/dw==",
|
||||
"version": "4.6.2",
|
||||
"resolved": "https://registry.npmjs.org/daisyui/-/daisyui-4.6.2.tgz",
|
||||
"integrity": "sha512-LBIbI76wVVRCQt1Uis2Y2/PRdGfMkNMFsHOjfpav8n7SamwRwPOCiNUClIrnX2jerWW3mLZlzRMCnQfxmGEjow==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"css-selector-tokenizer": "^0.8",
|
||||
@@ -3000,9 +2914,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/dotenv": {
|
||||
"version": "16.3.1",
|
||||
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.3.1.tgz",
|
||||
"integrity": "sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ==",
|
||||
"version": "16.4.1",
|
||||
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.1.tgz",
|
||||
"integrity": "sha512-CjA3y+Dr3FyFDOAMnxZEGtnW9KBR2M0JvvUtXNW+dYJL5ROWxP9DUHCwgFqpMk0OXCc0ljhaNTr2w/kutYIcHQ==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
@@ -3060,6 +2974,23 @@
|
||||
"@esbuild/win32-x64": "0.19.6"
|
||||
}
|
||||
},
|
||||
"node_modules/esbuild-plugin-browserslist": {
|
||||
"version": "0.10.0",
|
||||
"resolved": "https://registry.npmjs.org/esbuild-plugin-browserslist/-/esbuild-plugin-browserslist-0.10.0.tgz",
|
||||
"integrity": "sha512-rZWFcp3l+73xDiJB+Vl9UqP1VVs+L4E0lygbwJl6UTmW2qQago7DLT56hBu0vocH/TtZsAcRHj0+qHqkkB5Gww==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"debug": "^4.3.4",
|
||||
"zod": "^3.21.4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"browserslist": "^4.21.8",
|
||||
"esbuild": "~0.19.2"
|
||||
}
|
||||
},
|
||||
"node_modules/escalade": {
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz",
|
||||
@@ -3222,6 +3153,15 @@
|
||||
"node": ">= 6"
|
||||
}
|
||||
},
|
||||
"node_modules/globals": {
|
||||
"version": "11.12.0",
|
||||
"resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz",
|
||||
"integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/globrex": {
|
||||
"version": "0.1.2",
|
||||
"resolved": "https://registry.npmjs.org/globrex/-/globrex-0.1.2.tgz",
|
||||
@@ -3365,6 +3305,12 @@
|
||||
"jiti": "bin/jiti.js"
|
||||
}
|
||||
},
|
||||
"node_modules/js-tokens": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
|
||||
"integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/jsesc": {
|
||||
"version": "2.5.2",
|
||||
"resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz",
|
||||
@@ -3704,9 +3650,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/postcss": {
|
||||
"version": "8.4.33",
|
||||
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.33.tgz",
|
||||
"integrity": "sha512-Kkpbhhdjw2qQs2O2DGX+8m5OVqEcbB9HRBvuYM9pgrjEFUg30A9LmXNlTAUj4S9kgtGyrMbTzVjH7E+s5Re2yg==",
|
||||
"version": "8.4.35",
|
||||
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.35.tgz",
|
||||
"integrity": "sha512-u5U8qYpBCpN13BsiEB0CbR1Hhh4Gc0zLFuedrHJKMctHCHAGrMdG0PRM/KErzAL3CU6/eckEtmHNB3x6e3c0vA==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
@@ -3921,6 +3867,12 @@
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/regenerator-runtime": {
|
||||
"version": "0.14.1",
|
||||
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz",
|
||||
"integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/regenerator-transform": {
|
||||
"version": "0.15.2",
|
||||
"resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.15.2.tgz",
|
||||
@@ -4197,6 +4149,18 @@
|
||||
"url": "https://github.com/sponsors/isaacs"
|
||||
}
|
||||
},
|
||||
"node_modules/supports-color": {
|
||||
"version": "5.5.0",
|
||||
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
|
||||
"integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"has-flag": "^3.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/supports-preserve-symlinks-flag": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz",
|
||||
@@ -4210,17 +4174,18 @@
|
||||
}
|
||||
},
|
||||
"node_modules/svelte": {
|
||||
"version": "4.2.8",
|
||||
"resolved": "https://registry.npmjs.org/svelte/-/svelte-4.2.8.tgz",
|
||||
"integrity": "sha512-hU6dh1MPl8gh6klQZwK/n73GiAHiR95IkFsesLPbMeEZi36ydaXL/ZAb4g9sayT0MXzpxyZjR28yderJHxcmYA==",
|
||||
"version": "4.2.10",
|
||||
"resolved": "https://registry.npmjs.org/svelte/-/svelte-4.2.10.tgz",
|
||||
"integrity": "sha512-Ep06yCaCdgG1Mafb/Rx8sJ1QS3RW2I2BxGp2Ui9LBHSZ2/tO/aGLc5WqPjgiAP6KAnLJGaIr/zzwQlOo1b8MxA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@ampproject/remapping": "^2.2.1",
|
||||
"@jridgewell/sourcemap-codec": "^1.4.15",
|
||||
"@jridgewell/trace-mapping": "^0.3.18",
|
||||
"@types/estree": "^1.0.1",
|
||||
"acorn": "^8.9.0",
|
||||
"aria-query": "^5.3.0",
|
||||
"axobject-query": "^3.2.1",
|
||||
"axobject-query": "^4.0.0",
|
||||
"code-red": "^1.0.3",
|
||||
"css-tree": "^2.3.1",
|
||||
"estree-walker": "^3.0.3",
|
||||
@@ -4234,9 +4199,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/svelte-check": {
|
||||
"version": "3.6.3",
|
||||
"resolved": "https://registry.npmjs.org/svelte-check/-/svelte-check-3.6.3.tgz",
|
||||
"integrity": "sha512-Q2nGnoysxUnB9KjnjpQLZwdjK62DHyW6nuH/gm2qteFnDk0lCehe/6z8TsIvYeKjC6luKaWxiNGyOcWiLLPSwA==",
|
||||
"version": "3.6.4",
|
||||
"resolved": "https://registry.npmjs.org/svelte-check/-/svelte-check-3.6.4.tgz",
|
||||
"integrity": "sha512-mY/dqucqm46p72M8yZmn81WPZx9mN6uuw8UVfR3ZKQeLxQg5HDGO3HHm5AZuWZPYNMLJ+TRMn+TeN53HfQ/vsw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@jridgewell/trace-mapping": "^0.3.17",
|
||||
@@ -4331,9 +4296,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/systemjs": {
|
||||
"version": "6.14.2",
|
||||
"resolved": "https://registry.npmjs.org/systemjs/-/systemjs-6.14.2.tgz",
|
||||
"integrity": "sha512-1TlOwvKWdXxAY9vba+huLu99zrQURDWA8pUTYsRIYDZYQbGyK+pyEP4h4dlySsqo7ozyJBmYD20F+iUHhAltEg==",
|
||||
"version": "6.14.3",
|
||||
"resolved": "https://registry.npmjs.org/systemjs/-/systemjs-6.14.3.tgz",
|
||||
"integrity": "sha512-hQv45irdhXudAOr8r6SVSpJSGtogdGZUbJBRKCE5nsIS7tsxxvnIHqT4IOPWj+P+HcSzeWzHlGCGpmhPDIKe+w==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/tailwindcss": {
|
||||
@@ -4399,9 +4364,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/terser": {
|
||||
"version": "5.26.0",
|
||||
"resolved": "https://registry.npmjs.org/terser/-/terser-5.26.0.tgz",
|
||||
"integrity": "sha512-dytTGoE2oHgbNV9nTzgBEPaqAWvcJNl66VZ0BkJqlvp71IjO8CxdBx/ykCNb47cLnCmCvRZ6ZR0tLkqvZCdVBQ==",
|
||||
"version": "5.27.0",
|
||||
"resolved": "https://registry.npmjs.org/terser/-/terser-5.27.0.tgz",
|
||||
"integrity": "sha512-bi1HRwVRskAjheeYl291n3JC4GgO/Ty4z1nVs5AAsmonJulGxpSektecnNedrwK9C7vpvVtcX3cw00VSLt7U2A==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@jridgewell/source-map": "^0.3.3",
|
||||
@@ -4462,18 +4427,18 @@
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/tsconfck": {
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmjs.org/tsconfck/-/tsconfck-2.1.2.tgz",
|
||||
"integrity": "sha512-ghqN1b0puy3MhhviwO2kGF8SeMDNhEbnKxjK7h6+fvY9JAxqvXi8y5NAHSQv687OVboS2uZIByzGd45/YxrRHg==",
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/tsconfck/-/tsconfck-3.0.1.tgz",
|
||||
"integrity": "sha512-7ppiBlF3UEddCLeI1JRx5m2Ryq+xk4JrZuq4EuYXykipebaq1dV0Fhgr1hb7CkmHt32QSgOZlcqVLEtHBG4/mg==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"tsconfck": "bin/tsconfck.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^14.13.1 || ^16 || >=18"
|
||||
"node": "^18 || >=20"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"typescript": "^4.3.5 || ^5.0.0"
|
||||
"typescript": "^5.0.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"typescript": {
|
||||
@@ -4577,13 +4542,13 @@
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/vite": {
|
||||
"version": "5.0.11",
|
||||
"resolved": "https://registry.npmjs.org/vite/-/vite-5.0.11.tgz",
|
||||
"integrity": "sha512-XBMnDjZcNAw/G1gEiskiM1v6yzM4GE5aMGvhWTlHAYYhxb7S3/V1s3m2LDHa8Vh6yIWYYB0iJwsEaS523c4oYA==",
|
||||
"version": "5.1.1",
|
||||
"resolved": "https://registry.npmjs.org/vite/-/vite-5.1.1.tgz",
|
||||
"integrity": "sha512-wclpAgY3F1tR7t9LL5CcHC41YPkQIpKUGeIuT8MdNwNZr6OqOTLs7JX5vIHAtzqLWXts0T+GDrh9pN2arneKqg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"esbuild": "^0.19.3",
|
||||
"postcss": "^8.4.32",
|
||||
"postcss": "^8.4.35",
|
||||
"rollup": "^4.2.0"
|
||||
},
|
||||
"bin": {
|
||||
@@ -4632,14 +4597,14 @@
|
||||
}
|
||||
},
|
||||
"node_modules/vite-tsconfig-paths": {
|
||||
"version": "4.2.3",
|
||||
"resolved": "https://registry.npmjs.org/vite-tsconfig-paths/-/vite-tsconfig-paths-4.2.3.tgz",
|
||||
"integrity": "sha512-xVsA2xe6QSlzBujtWF8q2NYexh7PAUYfzJ4C8Axpe/7d2pcERYxuxGgph9F4f0iQO36g5tyGq6eBUYIssdUrVw==",
|
||||
"version": "4.3.1",
|
||||
"resolved": "https://registry.npmjs.org/vite-tsconfig-paths/-/vite-tsconfig-paths-4.3.1.tgz",
|
||||
"integrity": "sha512-cfgJwcGOsIxXOLU/nELPny2/LUD/lcf1IbfyeKTv2bsupVbTH/xpFtdQlBmIP1GEK2CjjLxYhFfB+QODFAx5aw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"debug": "^4.1.1",
|
||||
"globrex": "^0.1.2",
|
||||
"tsconfck": "^2.1.0"
|
||||
"tsconfck": "^3.0.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"vite": "*"
|
||||
@@ -4684,6 +4649,15 @@
|
||||
"engines": {
|
||||
"node": ">= 14"
|
||||
}
|
||||
},
|
||||
"node_modules/zod": {
|
||||
"version": "3.22.4",
|
||||
"resolved": "https://registry.npmjs.org/zod/-/zod-3.22.4.tgz",
|
||||
"integrity": "sha512-iC+8Io04lddc+mVqQ9AZ7OQ2MrUKGN+oIQyq1vemgt46jwCwLfhq7/pwnBnNXXXZb8VTVLKwp9EDkx+ryxIWmg==",
|
||||
"dev": true,
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/colinhacks"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+12
-12
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "playlet-web",
|
||||
"version": "0.19.1",
|
||||
"version": "0.19.2",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
@@ -9,23 +9,23 @@
|
||||
"check": "svelte-check --tsconfig ./tsconfig.json"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@sveltejs/vite-plugin-svelte": "^3.0.1",
|
||||
"@sveltejs/vite-plugin-svelte": "^3.0.2",
|
||||
"@tailwindcss/typography": "^0.5.10",
|
||||
"@tsconfig/svelte": "^5.0.2",
|
||||
"@vitejs/plugin-legacy": "^5.2.0",
|
||||
"autoprefixer": "^10.4.16",
|
||||
"daisyui": "^4.6.0",
|
||||
"dotenv": "^16.3.1",
|
||||
"@vitejs/plugin-legacy": "^5.3.0",
|
||||
"autoprefixer": "^10.4.17",
|
||||
"daisyui": "^4.6.2",
|
||||
"dotenv": "^16.4.1",
|
||||
"ip": "^1.1.8",
|
||||
"postcss": "^8.4.33",
|
||||
"svelte": "^4.2.8",
|
||||
"svelte-check": "^3.6.3",
|
||||
"postcss": "^8.4.35",
|
||||
"svelte": "^4.2.10",
|
||||
"svelte-check": "^3.6.4",
|
||||
"svelte-preprocess": "^5.1.3",
|
||||
"tailwindcss": "^3.4.1",
|
||||
"terser": "^5.26.0",
|
||||
"terser": "^5.27.0",
|
||||
"tslib": "^2.6.2",
|
||||
"typescript": "^5.3.3",
|
||||
"vite": "^5.0.11",
|
||||
"vite-tsconfig-paths": "^4.2.3"
|
||||
"vite": "^5.1.1",
|
||||
"vite-tsconfig-paths": "^4.3.1"
|
||||
}
|
||||
}
|
||||
@@ -111,8 +111,8 @@ export class PlayletApi {
|
||||
return await response.json();
|
||||
}
|
||||
|
||||
static async putSearchHistory(query: string) {
|
||||
const response = await PlayletApi.putJson(`${PlayletApi.host()}/api/search-history`, { query });
|
||||
static async addSearchHistory(query: string) {
|
||||
const response = await PlayletApi.postJson(`${PlayletApi.host()}/api/search-history`, { query });
|
||||
return await response.json();
|
||||
}
|
||||
|
||||
|
||||
@@ -195,7 +195,7 @@
|
||||
: 'hidden'} fixed w-full h-full bg-base-100/80 z-50 flex justify-center items-center"
|
||||
>
|
||||
{#if isDragging}
|
||||
<div class="text-2xl font-bold">Drop a Youtube link here</div>
|
||||
<div class="text-2xl font-bold">Drop a YouTube link here</div>
|
||||
{:else if isLoading}
|
||||
<span class="loading loading-spinner loading-md" />
|
||||
{/if}
|
||||
|
||||
@@ -95,7 +95,7 @@
|
||||
class="tooltip tooltip-left"
|
||||
data-tip={`Login using ${currentInstance}`}
|
||||
>
|
||||
<button on:click={login}>Login</button>
|
||||
<button on:click={login}>Login to Invidious</button>
|
||||
</div>
|
||||
</li>
|
||||
{/if}
|
||||
|
||||
@@ -104,7 +104,7 @@
|
||||
}
|
||||
|
||||
if (page === 1) {
|
||||
const newSearchHistory = await PlayletApi.putSearchHistory(searchBoxText);
|
||||
const newSearchHistory = await PlayletApi.addSearchHistory(searchBoxText);
|
||||
searchHistoryStore.set(newSearchHistory);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
<script lang="ts">
|
||||
import { PlayletApi } from "lib/Api/PlayletApi";
|
||||
import { userPreferencesStore } from "lib/Stores";
|
||||
const textSizes = ["text-2xl", "text-lg", "text-base", "text-sm", "text-xs"];
|
||||
export let displayText: string = "";
|
||||
export let key: string = "";
|
||||
export let description: string = "";
|
||||
export let level: number = 0;
|
||||
export let min: number = -999999;
|
||||
export let max: number = 999999;
|
||||
let value;
|
||||
userPreferencesStore.subscribe((userPreferences) => {
|
||||
value = userPreferences[key];
|
||||
});
|
||||
async function handleChange() {
|
||||
if (key !== "") {
|
||||
await PlayletApi.saveUserPreference(key, value);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="form-control m-5">
|
||||
<label class="label p-0 cursor-pointer">
|
||||
<div class="label-text {textSizes[level]}">{displayText}</div>
|
||||
<div class="join mt-2 mb-2">
|
||||
<button
|
||||
class="join-item btn btn-sm btn-primary"
|
||||
on:click={() => {
|
||||
value = Math.max(min, value - 1);
|
||||
handleChange();
|
||||
}}
|
||||
>
|
||||
-
|
||||
</button>
|
||||
<input
|
||||
class="join-item input input-bordered input-sm"
|
||||
type="number"
|
||||
name={key}
|
||||
{min}
|
||||
{max}
|
||||
bind:value
|
||||
on:change={handleChange}
|
||||
/>
|
||||
<button
|
||||
class="join-item btn btn-sm btn-primary"
|
||||
on:click={() => {
|
||||
value = Math.min(max, value + 1);
|
||||
handleChange();
|
||||
}}
|
||||
>
|
||||
+
|
||||
</button>
|
||||
</div>
|
||||
</label>
|
||||
<div class="text-xs text-gray-500">{@html description}</div>
|
||||
</div>
|
||||
@@ -4,15 +4,19 @@
|
||||
import EditHomeScreenControl from "lib/Screens/Settings/SettingControls/EditHomeScreenControl.svelte";
|
||||
import RadioControl from "lib/Screens/Settings/SettingControls/RadioControl.svelte";
|
||||
import StringControl from "lib/Screens/Settings/SettingControls/StringControl.svelte";
|
||||
import NumberControl from "./SettingControls/NumberControl.svelte";
|
||||
|
||||
const textSizes = ["text-2xl", "text-lg", "text-base", "text-sm", "text-xs"];
|
||||
|
||||
export let displayText: string = "";
|
||||
export let key: string = "";
|
||||
export let description: string = "";
|
||||
export let type: "boolean" | "radio" | "string" | undefined = undefined;
|
||||
export let type: "boolean" | "radio" | "string" | "number" | undefined =
|
||||
undefined;
|
||||
export let svelteComponent: string | undefined = undefined;
|
||||
export let options: any[] | undefined = undefined;
|
||||
export let min: number = -999999;
|
||||
export let max: number = 999999;
|
||||
export let visibility: string | undefined = undefined;
|
||||
export let children: any[] | undefined = [];
|
||||
export let level: number = 0;
|
||||
@@ -35,6 +39,8 @@
|
||||
<RadioControl {displayText} {key} {description} {level} {options} />
|
||||
{:else if type === "string"}
|
||||
<StringControl {displayText} {key} {description} {level} />
|
||||
{:else if type === "number"}
|
||||
<NumberControl {displayText} {key} {description} {level} {min} {max} />
|
||||
{:else if svelteComponent}
|
||||
<svelte:component
|
||||
this={customComponents[svelteComponent]}
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
import DevSettings from "lib/Screens/Settings/DevSettings.svelte";
|
||||
import SettingsNode from "lib/Screens/Settings/SettingsNode.svelte";
|
||||
import { preferencesModelStore } from "lib/Stores";
|
||||
import { onMount } from "svelte";
|
||||
|
||||
export let visibility: boolean;
|
||||
</script>
|
||||
|
||||
@@ -79,6 +79,7 @@ Function RALE_InitConfig() as Object
|
||||
minSocketPort: 49152,
|
||||
maxSocketPort: 65535,
|
||||
screensaverResetTimeout: 30000,
|
||||
' Note: commandTimeout reduced from 10000 to 1000 to improve responsiveness
|
||||
commandTimeout: 1000,
|
||||
defaultLogLevel: 3,
|
||||
logFormat: "[RALE][%level%] - %message%"
|
||||
|
||||
@@ -53,7 +53,7 @@ export class ManifestEditPlugin implements CompilerPlugin {
|
||||
}
|
||||
|
||||
afterPublish(builder: ProgramBuilder) {
|
||||
this.restoreManifest(builder.program);
|
||||
this.restoreManifest(builder.program!);
|
||||
}
|
||||
|
||||
beforeProgramDispose(event: BeforeProgramDisposeEvent) {
|
||||
|
||||
@@ -0,0 +1,153 @@
|
||||
// This plugin handles router annotations (@get, @post, etc) and register
|
||||
// associated functions with the router.
|
||||
|
||||
import {
|
||||
BeforeFileTranspileEvent,
|
||||
BscFile,
|
||||
ClassStatement,
|
||||
CompilerPlugin,
|
||||
FunctionExpression,
|
||||
FunctionStatement,
|
||||
MethodStatement,
|
||||
OnFileValidateEvent,
|
||||
TokenKind,
|
||||
WalkMode,
|
||||
createVisitor,
|
||||
isBrsFile
|
||||
} from "brighterscript";
|
||||
import { RawCodeStatement } from "./Classes/RawCodeStatement";
|
||||
|
||||
const annotationNames = ['all', 'get', 'post', 'put', 'delete', 'patch', 'head', 'options'];
|
||||
const httpRouterBaseClass = 'HttpRouter';
|
||||
|
||||
export class WebServerPlugin implements CompilerPlugin {
|
||||
public name = 'WebServerPlugin';
|
||||
|
||||
onFileValidate(event: OnFileValidateEvent<BscFile>) {
|
||||
if (!isBrsFile(event.file)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Make sure each class that inherits from HttpRouter has a constructor
|
||||
event.file.ast.walk(createVisitor({
|
||||
ClassStatement: (classStmt) => {
|
||||
if (!classStmt.parentClassName) {
|
||||
return;
|
||||
}
|
||||
|
||||
const parentClass = classStmt.parentClassName.expression.name.text;
|
||||
if (parentClass !== httpRouterBaseClass) {
|
||||
return;
|
||||
}
|
||||
|
||||
const classConstructor = this.getClassConstructor(classStmt);
|
||||
if (!classConstructor) {
|
||||
event.file.addDiagnostics([{
|
||||
file: event.file,
|
||||
range: classStmt.name.range,
|
||||
message: `Class ${classStmt.name.text} extends ${httpRouterBaseClass} and must have a constructor`,
|
||||
severity: 1,
|
||||
code: 'HTTP_ROUTER_NO_CONSTRUCTOR',
|
||||
}]);
|
||||
}
|
||||
},
|
||||
}), {
|
||||
walkMode: WalkMode.visitStatementsRecursive
|
||||
});
|
||||
}
|
||||
|
||||
beforeFileTranspile(event: BeforeFileTranspileEvent<BscFile>) {
|
||||
if (!isBrsFile(event.file)) {
|
||||
return;
|
||||
}
|
||||
|
||||
event.file.ast.walk(createVisitor({
|
||||
FunctionExpression: (func) => {
|
||||
if (!this.isHttpRouterFunction(func)) {
|
||||
return;
|
||||
}
|
||||
|
||||
const functionStatement = func.functionStatement;
|
||||
if (!functionStatement) {
|
||||
return;
|
||||
}
|
||||
|
||||
const routeInfo = this.getRouteInfo(functionStatement);
|
||||
if (!routeInfo) {
|
||||
return;
|
||||
}
|
||||
|
||||
const classStmt = this.getClass(func);
|
||||
if (!classStmt) {
|
||||
return;
|
||||
}
|
||||
const classConstructor = this.getClassConstructor(classStmt) as MethodStatement;
|
||||
|
||||
const method = routeInfo.method === 'ALL' ? '*' : routeInfo.method;
|
||||
const stmt = new RawCodeStatement(`m.routes.push({ method: "${method}", path: "${routeInfo.route}", router: m, func: "${func.functionStatement?.name.text}" })`)
|
||||
event.editor.arrayPush(classConstructor.func.body.statements, stmt);
|
||||
},
|
||||
}), {
|
||||
walkMode: WalkMode.visitExpressionsRecursive
|
||||
});
|
||||
}
|
||||
|
||||
isHttpRouterFunction(func: FunctionExpression) {
|
||||
const classStmt = this.getClass(func);
|
||||
if (!classStmt || !classStmt.parentClassName) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const parentClass = classStmt.parentClassName.expression.name.text;
|
||||
return parentClass === httpRouterBaseClass;
|
||||
}
|
||||
|
||||
getRouteInfo(functionStatement: FunctionStatement | undefined) {
|
||||
const annotations = functionStatement?.annotations
|
||||
if (!annotations || annotations.length === 0) {
|
||||
return undefined
|
||||
}
|
||||
|
||||
for (let index = 0; index < annotations.length; index++) {
|
||||
const annotation = annotations[index];
|
||||
if (annotationNames.includes(annotation.name)) {
|
||||
const args = annotation.getArguments()
|
||||
if (args.length !== 1) {
|
||||
throw new Error(`Expected 1 argument for annotation ${annotation.name}`)
|
||||
}
|
||||
|
||||
if (typeof args[0] !== 'string') {
|
||||
throw new Error(`Expected string argument for annotation ${annotation.name}`)
|
||||
}
|
||||
|
||||
return {
|
||||
method: annotation.name.toUpperCase(),
|
||||
route: args[0]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
getClass(func: FunctionExpression) {
|
||||
const functionStatement = func.functionStatement;
|
||||
if (!functionStatement) {
|
||||
return;
|
||||
}
|
||||
|
||||
return functionStatement.parent as ClassStatement;
|
||||
}
|
||||
|
||||
getClassConstructor(classStmt: ClassStatement) {
|
||||
return classStmt.body.find((stmt) => {
|
||||
const methodStmt = stmt as MethodStatement;
|
||||
// @ts-ignore
|
||||
if (methodStmt.name?.kind === TokenKind.New) {
|
||||
return stmt;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export default () => {
|
||||
return new WebServerPlugin();
|
||||
};
|
||||
@@ -5,7 +5,7 @@ const { convertFile } = require('convert-svg-to-png');
|
||||
|
||||
(async () => {
|
||||
const parser = new ArgumentParser({
|
||||
description: 'Sync Youtube profile with Invidious'
|
||||
description: 'Sync YouTube profile with Invidious'
|
||||
});
|
||||
|
||||
parser.add_argument('--input', { help: 'Input file path' });
|
||||
|
||||
Loaded 100 of 103 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user