Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
510d81b872 | ||
|
|
ebabb6ca99 | ||
|
|
1678bee3b5 | ||
|
|
c055260023 | ||
|
|
e0f5c9691b | ||
|
|
9da9bdf06f | ||
|
|
fea1c22aa9 | ||
|
|
48b10e8618 | ||
|
|
7286c099a0 | ||
|
|
f29b0f0af8 | ||
|
|
a07d92eaa9 | ||
|
|
4218dc7fd2 | ||
|
|
95deab6ca4 | ||
|
|
156a4b5172 | ||
|
|
a974670f8d | ||
|
|
e7cce7e71b | ||
|
|
d09facc9ff | ||
|
|
78102e747b |
No files matched your search
@@ -8,6 +8,7 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
update_wiki_stats:
|
update_wiki_stats:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
timeout-minutes: 20
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|||||||
@@ -5,6 +5,20 @@ 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.1.0/),
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
||||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
## [0.48.4] - 2026-09-24
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Default audio track is now the regular audio instead of "Voice Boost" or "Stable Volume", which are now separate tracks
|
||||||
|
|
||||||
|
## [0.48.3] - 2026-07-28
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Display issues for 720p devices
|
||||||
|
- Attempt to fix session data fetch errors
|
||||||
|
- Remove volume handing from cast, to avoid a possible "mute softlock" - feature will be added back later.
|
||||||
|
|
||||||
## [0.48.2] - 2026-07-11
|
## [0.48.2] - 2026-07-11
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|||||||
@@ -1,39 +1,38 @@
|
|||||||
{
|
{
|
||||||
"name": "playlet",
|
"name": "playlet",
|
||||||
"version": "0.48.2",
|
"version": "0.48.4",
|
||||||
"description": "Unofficial YouTube client for Roku",
|
"description": "Unofficial YouTube client for Roku",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@rokucommunity/bslint": "^0.8.44",
|
"@rokucommunity/bslint": "^0.8.45",
|
||||||
"@types/crypto-js": "^4.2.2",
|
"@types/crypto-js": "^4.2.2",
|
||||||
"@types/fs-extra": "^11.0.4",
|
"@types/fs-extra": "^11.0.4",
|
||||||
"@types/node": "^26.1.1",
|
"@types/node": "^26.4.1",
|
||||||
"@types/xml2js": "^0.4.14",
|
"@types/xml2js": "^0.4.14",
|
||||||
"argparse": "^2.0.1",
|
"argparse": "^3.0.1",
|
||||||
"brighterscript": "0.73.0",
|
"brighterscript": "0.73.1",
|
||||||
"brighterscript-formatter": "^1.8.1",
|
"brighterscript-formatter": "^1.8.2",
|
||||||
"convert-svg-to-png": "^0.7.1",
|
"convert-svg-to-png": "^0.7.1",
|
||||||
"crypto-js": "^4.2.0",
|
"crypto-js": "^4.2.0",
|
||||||
"dotenv": "^17.4.2",
|
"dotenv": "^17.4.2",
|
||||||
"fs-extra": "^11.3.6",
|
"fs-extra": "^11.4.0",
|
||||||
"glob": "^13.0.6",
|
"glob": "^13.0.6",
|
||||||
"imap": "^0.8.19",
|
"imap": "^0.8.19",
|
||||||
"ip": "^2.0.1",
|
"ip": "^2.0.1",
|
||||||
"json5": "^2.2.3",
|
"json5": "^2.2.3",
|
||||||
"mailparser": "^3.9.14",
|
"mailparser": "^3.9.20",
|
||||||
"protocol-buffers-schema": "^3.6.1",
|
"protocol-buffers-schema": "^3.6.1",
|
||||||
"puppeteer": "^25.3.0",
|
"puppeteer": "^25.10.0",
|
||||||
"roku-deploy": "^3.17.7",
|
"roku-deploy": "^3.18.4",
|
||||||
"roku-test-automation": "^2.2.2",
|
"roku-test-automation": "^2.2.2",
|
||||||
"rooibos-roku": "5.16.4",
|
"rooibos-roku": "5.16.4",
|
||||||
"rounded-rect-9patch": "^1.1.2",
|
|
||||||
"semver": "^7.8.5",
|
"semver": "^7.8.5",
|
||||||
"shelljs": "^0.10.0",
|
"shelljs": "^0.10.0",
|
||||||
"telnet-client": "^2.2.13",
|
"telnet-client": "^2.2.14",
|
||||||
"ts-node": "^10.9.2",
|
"ts-node": "^10.9.2",
|
||||||
"typescript": "6.0.3",
|
"typescript": "6.0.3",
|
||||||
"xml2js": "^0.6.2",
|
"xml2js": "^0.6.2",
|
||||||
"yaml": "^2.9.0",
|
"yaml": "^2.9.0",
|
||||||
"youtubei.js": "^17.2.0"
|
"youtubei.js": "^18.0.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "22"
|
"node": "22"
|
||||||
@@ -68,20 +67,16 @@
|
|||||||
"test:integration:player": "npx tsx ./integration-tests/vpd-run-player.ts",
|
"test:integration:player": "npx tsx ./integration-tests/vpd-run-player.ts",
|
||||||
"version-sync": "node tools/version-sync.js",
|
"version-sync": "node tools/version-sync.js",
|
||||||
"manifest-git-hash": "node tools/update-manifest-git-hash.js",
|
"manifest-git-hash": "node tools/update-manifest-git-hash.js",
|
||||||
"sign-released-package": "node tools/sign-released-package.js",
|
|
||||||
"screenshot": "node tools/screenshot.js",
|
"screenshot": "node tools/screenshot.js",
|
||||||
"convert-images": "node tools/convert-images.js",
|
"convert-images": "node tools/convert-images.js",
|
||||||
"update-rale-component": "cd tools/RALE && rm TrackerTask.xml && curl -o TrackerTask.zip https://devtools.web.roku.com/roku-advanced-layout-editor/app/TrackerTask.zip && unzip TrackerTask.zip && rm TrackerTask.zip",
|
"update-rale-component": "cd tools/RALE && rm TrackerTask.xml && curl -o TrackerTask.zip https://devtools.web.roku.com/roku-advanced-layout-editor/app/TrackerTask.zip && unzip TrackerTask.zip && rm TrackerTask.zip",
|
||||||
"postinstall": "cd playlet-lib && npm install && cd ../playlet-app && npm install && cd ../playground && npm install && cd ../playlet-web && npm install",
|
"postinstall": "cd playlet-lib && npm install && cd ../playlet-app && npm install && cd ../playground && npm install && cd ../playlet-web && npm install",
|
||||||
"update-deps": "npx npm-check-updates --deep --upgrade --install always --reject typescript,svelte-preprocess",
|
"update-deps": "npx npm-check-updates --deep --upgrade --install always --reject typescript",
|
||||||
"registry:write": "node tools/registry.js --input registry.json",
|
"registry:write": "node tools/registry.js --input registry.json",
|
||||||
"registry:read": "node tools/registry.js --output registry.json",
|
"registry:read": "node tools/registry.js --output registry.json",
|
||||||
"registry:clear": "node tools/registry.js --clear",
|
"registry:clear": "node tools/registry.js --clear",
|
||||||
"restart-app": "node tools/restart-app.js",
|
"restart-app": "node tools/restart-app.js",
|
||||||
"check-for-updates": "node tools/check-for-updates.js",
|
"check-for-updates": "node tools/check-for-updates.js",
|
||||||
"shutdown": "node tools/shutdown.js"
|
"shutdown": "node tools/shutdown.js"
|
||||||
},
|
|
||||||
"optionalDependencies": {
|
|
||||||
"@rollup/rollup-linux-x64-gnu": "^4.62.2"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "playlet-app",
|
"name": "playlet-app",
|
||||||
"version": "0.48.2",
|
"version": "0.48.4",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "playlet-app",
|
"name": "playlet-app",
|
||||||
"version": "0.48.2"
|
"version": "0.48.4"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "playlet-app",
|
"name": "playlet-app",
|
||||||
"version": "0.48.2",
|
"version": "0.48.4",
|
||||||
"description": "Unofficial YouTube client for Roku",
|
"description": "Unofficial YouTube client for Roku",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"prebuild": "node ../tools/rm.js ../build/playlet-app",
|
"prebuild": "node ../tools/rm.js ../build/playlet-app",
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ title=Playlet
|
|||||||
# Do not update version manually, it is auto updated from package.json
|
# Do not update version manually, it is auto updated from package.json
|
||||||
major_version=0
|
major_version=0
|
||||||
minor_version=48
|
minor_version=48
|
||||||
build_version=00002
|
build_version=00004
|
||||||
|
|
||||||
ui_resolutions=hd
|
ui_resolutions=hd
|
||||||
uri_resolution_autosub=$$RES$$,480p,720p,1080p
|
uri_resolution_autosub=$$RES$$,480p,720p,1080p
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ function Main(args as object) as void
|
|||||||
|
|
||||||
Registry.ClearPlayletLibUrlsIfNeeded(args)
|
Registry.ClearPlayletLibUrlsIfNeeded(args)
|
||||||
Registry.ClearRegistryIfNeeded(args)
|
Registry.ClearRegistryIfNeeded(args)
|
||||||
|
Registry.ClearUnsupportedPlayletLibUrls()
|
||||||
|
|
||||||
scene = screen.CreateScene("BootstrapScene")
|
scene = screen.CreateScene("BootstrapScene")
|
||||||
screen.show()
|
screen.show()
|
||||||
|
|||||||
@@ -0,0 +1,37 @@
|
|||||||
|
namespace PlayletLibUrls
|
||||||
|
|
||||||
|
const RELEASE_URL_PATTERN = "^https://github\.com/iBicha/playlet/releases/download/v(\d+\.\d+\.\d+)/"
|
||||||
|
|
||||||
|
' v0.11.0 is the first release without HomeGridScreen, which still crashes on the devices
|
||||||
|
' pinned to v0.7.0 - v0.10.3.
|
||||||
|
const MIN_VERSION = "0.11.0"
|
||||||
|
|
||||||
|
function IsUnsupported(entry as object) as boolean
|
||||||
|
matches = CreateObject("roRegex", RELEASE_URL_PATTERN, "").Match(entry.link)
|
||||||
|
if matches.Count() <> 2
|
||||||
|
return false
|
||||||
|
end if
|
||||||
|
|
||||||
|
return CompareVersions(matches[1], MIN_VERSION) < 0
|
||||||
|
end function
|
||||||
|
|
||||||
|
function CompareVersions(left as string, right as string) as integer
|
||||||
|
leftParts = left.Tokenize(".")
|
||||||
|
rightParts = right.Tokenize(".")
|
||||||
|
|
||||||
|
for i = 0 to leftParts.Count() - 1
|
||||||
|
leftPart = leftParts[i].ToInt()
|
||||||
|
rightPart = rightParts[i].ToInt()
|
||||||
|
|
||||||
|
if leftPart < rightPart
|
||||||
|
return -1
|
||||||
|
end if
|
||||||
|
if leftPart > rightPart
|
||||||
|
return 1
|
||||||
|
end if
|
||||||
|
end for
|
||||||
|
|
||||||
|
return 0
|
||||||
|
end function
|
||||||
|
|
||||||
|
end namespace
|
||||||
@@ -0,0 +1,61 @@
|
|||||||
|
namespace Tests
|
||||||
|
|
||||||
|
@suite
|
||||||
|
class PlayletLibUrlsTests extends Rooibos.BaseTestSuite
|
||||||
|
|
||||||
|
@describe("PlayletLibUrls.IsUnsupported")
|
||||||
|
|
||||||
|
@it("reports a tagged release below the minimum version")
|
||||||
|
@params("https://github.com/iBicha/playlet/releases/download/v0.7.0/playlet-lib.zip")
|
||||||
|
@params("https://github.com/iBicha/playlet/releases/download/v0.9.0/playlet-lib.zip")
|
||||||
|
@params("https://github.com/iBicha/playlet/releases/download/v0.10.3/playlet-lib.zip")
|
||||||
|
@params("https://github.com/iBicha/playlet/releases/download/v0.10.3/playlet-lib.squashfs.pkg")
|
||||||
|
function _(link as string)
|
||||||
|
m.assertTrue(PlayletLibUrls.IsUnsupported({ type: "custom", link: link }))
|
||||||
|
end function
|
||||||
|
|
||||||
|
@it("reports nothing for a tagged release at or above the minimum version")
|
||||||
|
@params("https://github.com/iBicha/playlet/releases/download/v0.11.0/playlet-lib.zip")
|
||||||
|
@params("https://github.com/iBicha/playlet/releases/download/v0.11.1/playlet-lib.zip")
|
||||||
|
@params("https://github.com/iBicha/playlet/releases/download/v0.48.3/playlet-lib.squashfs.pkg")
|
||||||
|
@params("https://github.com/iBicha/playlet/releases/download/v1.0.0/playlet-lib.zip")
|
||||||
|
function _(link as string)
|
||||||
|
m.assertFalse(PlayletLibUrls.IsUnsupported({ type: "custom", link: link }))
|
||||||
|
end function
|
||||||
|
|
||||||
|
@it("reports nothing for a url that carries no version")
|
||||||
|
@params("https://github.com/iBicha/playlet/releases/latest/download/playlet-lib.zip")
|
||||||
|
@params("https://github.com/iBicha/playlet/releases/download/canary/playlet-lib.zip")
|
||||||
|
@params("https://github.com/iBicha/playlet/releases/download/0.10.3/playlet-lib.zip")
|
||||||
|
@params("http://192.168.1.10:8888/playlet-lib.zip")
|
||||||
|
@params("pkg:/lib/playlet-lib.zip")
|
||||||
|
@params("")
|
||||||
|
function _(link as string)
|
||||||
|
m.assertFalse(PlayletLibUrls.IsUnsupported({ type: "custom", link: link }))
|
||||||
|
end function
|
||||||
|
|
||||||
|
@describe("PlayletLibUrls.CompareVersions")
|
||||||
|
|
||||||
|
@it("reports the same version as equal")
|
||||||
|
function _()
|
||||||
|
m.assertEqual(PlayletLibUrls.CompareVersions("0.11.0", "0.11.0"), 0)
|
||||||
|
end function
|
||||||
|
|
||||||
|
@it("orders by the first part that differs")
|
||||||
|
@params("0.10.3", "0.11.0")
|
||||||
|
@params("0.11.0", "0.11.1")
|
||||||
|
@params("0.11.0", "1.0.0")
|
||||||
|
function _(older as string, newer as string)
|
||||||
|
m.assertEqual(PlayletLibUrls.CompareVersions(older, newer), -1)
|
||||||
|
m.assertEqual(PlayletLibUrls.CompareVersions(newer, older), 1)
|
||||||
|
end function
|
||||||
|
|
||||||
|
@it("compares parts as numbers, not text")
|
||||||
|
function _()
|
||||||
|
m.assertEqual(PlayletLibUrls.CompareVersions("0.9.0", "0.11.0"), -1)
|
||||||
|
m.assertEqual(PlayletLibUrls.CompareVersions("0.11.0", "0.9.0"), 1)
|
||||||
|
end function
|
||||||
|
|
||||||
|
end class
|
||||||
|
|
||||||
|
end namespace
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
|
import "pkg:/source/PlayletLibUrls.bs"
|
||||||
|
|
||||||
namespace Registry
|
namespace Registry
|
||||||
|
|
||||||
function ReadKey(key as string, section as string) as dynamic
|
function ReadKey(key as string, section as string) as dynamic
|
||||||
@@ -41,6 +43,23 @@ namespace Registry
|
|||||||
Logger.Log("Cleared key playlet_lib_urls from registry")
|
Logger.Log("Cleared key playlet_lib_urls from registry")
|
||||||
end function
|
end function
|
||||||
|
|
||||||
|
' BootstrapScene's load-failure fallback never reaches a pinned lib that loads and then
|
||||||
|
' crashes, so the device stays on it across every channel update.
|
||||||
|
function ClearUnsupportedPlayletLibUrls() as void
|
||||||
|
urls = GetPlayletLibUrlsFromRegistry()
|
||||||
|
if urls = invalid
|
||||||
|
return
|
||||||
|
end if
|
||||||
|
|
||||||
|
for each entry in urls
|
||||||
|
if PlayletLibUrls.IsUnsupported(entry)
|
||||||
|
DeleteKey("playlet_lib_urls", "Playlet")
|
||||||
|
Logger.Log(`Cleared key playlet_lib_urls from registry: ${entry.link} is no longer supported`)
|
||||||
|
return
|
||||||
|
end if
|
||||||
|
end for
|
||||||
|
end function
|
||||||
|
|
||||||
function ClearRegistryIfNeeded(launchArgs as object) as void
|
function ClearRegistryIfNeeded(launchArgs as object) as void
|
||||||
if launchArgs = invalid or launchArgs.clearRegistry = invalid
|
if launchArgs = invalid or launchArgs.clearRegistry = invalid
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "playlet-lib",
|
"name": "playlet-lib",
|
||||||
"version": "0.48.2",
|
"version": "0.48.4",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "playlet-lib",
|
"name": "playlet-lib",
|
||||||
"version": "0.48.2"
|
"version": "0.48.4"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "playlet-lib",
|
"name": "playlet-lib",
|
||||||
"version": "0.48.2",
|
"version": "0.48.4",
|
||||||
"description": "Unofficial YouTube client for Roku",
|
"description": "Unofficial YouTube client for Roku",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"prebuild": "node ../tools/rm.js ../build/playlet-lib",
|
"prebuild": "node ../tools/rm.js ../build/playlet-lib",
|
||||||
|
|||||||
@@ -38,7 +38,7 @@
|
|||||||
<Group id="anchor">
|
<Group id="anchor">
|
||||||
<Poster
|
<Poster
|
||||||
id="background"
|
id="background"
|
||||||
uri="pkg:/images/button-ex.9.png">
|
uri="pkg:/images/button-ex.$$RES$$.9.png">
|
||||||
<Poster id="icon" />
|
<Poster id="icon" />
|
||||||
<Label
|
<Label
|
||||||
id="label"
|
id="label"
|
||||||
|
|||||||
@@ -73,7 +73,7 @@
|
|||||||
showRowLabel="[true]"
|
showRowLabel="[true]"
|
||||||
rowFocusAnimationStyle="floatingfocus"
|
rowFocusAnimationStyle="floatingfocus"
|
||||||
variableWidthItems="true"
|
variableWidthItems="true"
|
||||||
focusBitmapUri="pkg:/images/focus-glow-padding-19.9.png" />
|
focusBitmapUri="pkg:/images/focus-glow-padding-30.$$RES$$.9.png" />
|
||||||
|
|
||||||
<Animation
|
<Animation
|
||||||
id="scrollAnimation"
|
id="scrollAnimation"
|
||||||
|
|||||||
@@ -15,14 +15,14 @@
|
|||||||
height="720"
|
height="720"
|
||||||
color="#242424"
|
color="#242424"
|
||||||
opacity="0.9"
|
opacity="0.9"
|
||||||
translation="[80,0]"
|
translation="[62,0]"
|
||||||
visible="false">
|
visible="false">
|
||||||
</Rectangle>
|
</Rectangle>
|
||||||
|
|
||||||
<Rectangle
|
<Rectangle
|
||||||
id="Background"
|
id="Background"
|
||||||
height="720"
|
height="720"
|
||||||
width="80"
|
width="62"
|
||||||
color="#242424"
|
color="#242424"
|
||||||
opacity="0.9">
|
opacity="0.9">
|
||||||
|
|
||||||
@@ -30,13 +30,13 @@
|
|||||||
id="LogoFav"
|
id="LogoFav"
|
||||||
width="42"
|
width="42"
|
||||||
height="42"
|
height="42"
|
||||||
translation="[20, 48]"
|
translation="[16, 48]"
|
||||||
uri="pkg:/images/logo-fav.png" />
|
uri="pkg:/images/logo-fav.png" />
|
||||||
<Poster
|
<Poster
|
||||||
id="Logo"
|
id="Logo"
|
||||||
width="106"
|
width="106"
|
||||||
height="42"
|
height="42"
|
||||||
translation="[20, 48]"
|
translation="[16, 48]"
|
||||||
opacity="0"
|
opacity="0"
|
||||||
uri="pkg:/images/logo-dark.png">
|
uri="pkg:/images/logo-dark.png">
|
||||||
<AppVersionLabel
|
<AppVersionLabel
|
||||||
@@ -50,13 +50,13 @@
|
|||||||
itemSize="[190,50]"
|
itemSize="[190,50]"
|
||||||
itemComponentName="NavBarComponent"
|
itemComponentName="NavBarComponent"
|
||||||
focusFootprintBitmapUri=""
|
focusFootprintBitmapUri=""
|
||||||
focusBitmapUri="pkg:/images/white.9.png"
|
focusBitmapUri="pkg:/images/white.$$RES$$.9.png"
|
||||||
focusBitmapBlendColor="0xFF1C30FF"
|
focusBitmapBlendColor="0xFF1C30FF"
|
||||||
vertFocusAnimationStyle="floatingFocus"
|
vertFocusAnimationStyle="floatingFocus"
|
||||||
numRows="7"
|
numRows="7"
|
||||||
scrollSpeed="99999"
|
scrollSpeed="99999"
|
||||||
itemSpacing="[0, 16]"
|
itemSpacing="[0, 16]"
|
||||||
translation="[15, 150]">
|
translation="[13, 150]">
|
||||||
</MarkupList>
|
</MarkupList>
|
||||||
</Rectangle>
|
</Rectangle>
|
||||||
|
|
||||||
|
|||||||
@@ -68,7 +68,7 @@
|
|||||||
numRows="5"
|
numRows="5"
|
||||||
vertFocusAnimationStyle="floatingFocus"
|
vertFocusAnimationStyle="floatingFocus"
|
||||||
translation="[620,90]"
|
translation="[620,90]"
|
||||||
focusBitmapUri="pkg:/images/focus-glow-padding-27.9.png" />
|
focusBitmapUri="pkg:/images/focus-glow-padding-42.$$RES$$.9.png" />
|
||||||
</Poster>
|
</Poster>
|
||||||
</children>
|
</children>
|
||||||
</component>
|
</component>
|
||||||
@@ -43,7 +43,7 @@
|
|||||||
showRowLabel="[true]"
|
showRowLabel="[true]"
|
||||||
rowFocusAnimationStyle="floatingfocus"
|
rowFocusAnimationStyle="floatingfocus"
|
||||||
variableWidthItems="true"
|
variableWidthItems="true"
|
||||||
focusBitmapUri="pkg:/images/focus-glow-padding-19.9.png" />
|
focusBitmapUri="pkg:/images/focus-glow-padding-30.$$RES$$.9.png" />
|
||||||
</Group>
|
</Group>
|
||||||
</children>
|
</children>
|
||||||
</component>
|
</component>
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
showRowLabel="[true]"
|
showRowLabel="[true]"
|
||||||
rowFocusAnimationStyle="floatingfocus"
|
rowFocusAnimationStyle="floatingfocus"
|
||||||
variableWidthItems="true"
|
variableWidthItems="true"
|
||||||
focusBitmapUri="pkg:/images/focus-glow-padding-19.9.png"
|
focusBitmapUri="pkg:/images/focus-glow-padding-30.$$RES$$.9.png"
|
||||||
/>
|
/>
|
||||||
</children>
|
</children>
|
||||||
</component>
|
</component>
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
itemSize="[500,500]"
|
itemSize="[500,500]"
|
||||||
itemComponentName="BackendTypeRowListCell"
|
itemComponentName="BackendTypeRowListCell"
|
||||||
rowFocusAnimationStyle="floatingfocus"
|
rowFocusAnimationStyle="floatingfocus"
|
||||||
focusBitmapUri="pkg:/images/focus-glow-padding-19.9.png">
|
focusBitmapUri="pkg:/images/focus-glow-padding-30.$$RES$$.9.png">
|
||||||
<ContentNode role="content">
|
<ContentNode role="content">
|
||||||
<ContentNode>
|
<ContentNode>
|
||||||
<!-- bs:disable-next-line LOCALE_MISSING_TRANSLATIONS -->
|
<!-- bs:disable-next-line LOCALE_MISSING_TRANSLATIONS -->
|
||||||
|
|||||||
@@ -17,6 +17,6 @@
|
|||||||
focusXOffset="[165]"
|
focusXOffset="[165]"
|
||||||
itemComponentName="ProfileRowListCell"
|
itemComponentName="ProfileRowListCell"
|
||||||
rowFocusAnimationStyle="floatingfocus"
|
rowFocusAnimationStyle="floatingfocus"
|
||||||
focusBitmapUri="pkg:/images/focus-glow-padding-19.9.png" />
|
focusBitmapUri="pkg:/images/focus-glow-padding-30.$$RES$$.9.png" />
|
||||||
</children>
|
</children>
|
||||||
</component>
|
</component>
|
||||||
@@ -35,7 +35,7 @@
|
|||||||
numRows="4"
|
numRows="4"
|
||||||
vertFocusAnimationStyle="floatingFocus"
|
vertFocusAnimationStyle="floatingFocus"
|
||||||
translation="[40,120]"
|
translation="[40,120]"
|
||||||
focusBitmapUri="pkg:/images/focus-glow-padding-27.9.png" />
|
focusBitmapUri="pkg:/images/focus-glow-padding-42.$$RES$$.9.png" />
|
||||||
</Rectangle>
|
</Rectangle>
|
||||||
</children>
|
</children>
|
||||||
</component>
|
</component>
|
||||||
@@ -44,7 +44,7 @@
|
|||||||
showRowLabel="[true]"
|
showRowLabel="[true]"
|
||||||
rowFocusAnimationStyle="floatingfocus"
|
rowFocusAnimationStyle="floatingfocus"
|
||||||
variableWidthItems="true"
|
variableWidthItems="true"
|
||||||
focusBitmapUri="pkg:/images/focus-glow-padding-19.9.png" />
|
focusBitmapUri="pkg:/images/focus-glow-padding-30.$$RES$$.9.png" />
|
||||||
<Animation
|
<Animation
|
||||||
id="scrollAnimation"
|
id="scrollAnimation"
|
||||||
duration="0.3">
|
duration="0.3">
|
||||||
|
|||||||
@@ -34,7 +34,7 @@
|
|||||||
numRows="7"
|
numRows="7"
|
||||||
vertFocusAnimationStyle="floatingFocus"
|
vertFocusAnimationStyle="floatingFocus"
|
||||||
translation="[0,46]"
|
translation="[0,46]"
|
||||||
focusBitmapUri="pkg:/images/white-border.9.png" />
|
focusBitmapUri="pkg:/images/white-border.$$RES$$.9.png" />
|
||||||
|
|
||||||
</children>
|
</children>
|
||||||
</component>
|
</component>
|
||||||
@@ -15,11 +15,11 @@
|
|||||||
<children>
|
<children>
|
||||||
<Poster
|
<Poster
|
||||||
id="BackgroundFocused"
|
id="BackgroundFocused"
|
||||||
uri="pkg:/images/white.9.png"
|
uri="pkg:/images/white.$$RES$$.9.png"
|
||||||
visible="false" />
|
visible="false" />
|
||||||
<Poster
|
<Poster
|
||||||
id="Background"
|
id="Background"
|
||||||
uri="pkg:/images/white-border.9.png" />
|
uri="pkg:/images/white-border.$$RES$$.9.png" />
|
||||||
<LayoutGroup id="Container" itemSpacings="[5]">
|
<LayoutGroup id="Container" itemSpacings="[5]">
|
||||||
<Label id="DisplayTextLabel">
|
<Label id="DisplayTextLabel">
|
||||||
<Font role="font" uri="font:SystemFontFile" size="34" />
|
<Font role="font" uri="font:SystemFontFile" size="34" />
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
numRows="10"
|
numRows="10"
|
||||||
vertFocusAnimationStyle="floatingFocus"
|
vertFocusAnimationStyle="floatingFocus"
|
||||||
translation="[40,90]"
|
translation="[40,90]"
|
||||||
focusBitmapUri="pkg:/images/focus-glow-padding-19.9.png" />
|
focusBitmapUri="pkg:/images/focus-glow-padding-30.$$RES$$.9.png" />
|
||||||
|
|
||||||
<ButtonEx
|
<ButtonEx
|
||||||
id="saveButton"
|
id="saveButton"
|
||||||
|
|||||||
@@ -255,6 +255,7 @@ class DashManifest
|
|||||||
xtagsInfo = m.GetXtagsInfo(format)
|
xtagsInfo = m.GetXtagsInfo(format)
|
||||||
format.xtagsInfo = xtagsInfo
|
format.xtagsInfo = xtagsInfo
|
||||||
format.isDrc = xtagsInfo.isDrc
|
format.isDrc = xtagsInfo.isDrc
|
||||||
|
format.isVoiceBoost = xtagsInfo.isVoiceBoost
|
||||||
format.isDubbed = xtagsInfo.isDubbed
|
format.isDubbed = xtagsInfo.isDubbed
|
||||||
format.isAutoDubbed = xtagsInfo.isAutoDubbed
|
format.isAutoDubbed = xtagsInfo.isAutoDubbed
|
||||||
format.isDescriptive = xtagsInfo.isDescriptive
|
format.isDescriptive = xtagsInfo.isDescriptive
|
||||||
@@ -277,12 +278,7 @@ class DashManifest
|
|||||||
audioTrackId = format.audioTrack.id
|
audioTrackId = format.audioTrack.id
|
||||||
end if
|
end if
|
||||||
|
|
||||||
drc = ""
|
groupId = `${mimeType}-${justCodec}-${colorInfo}-${audioTrackId}${m.GetAudioVariantSuffix(format)}`
|
||||||
if format.isDrc = true
|
|
||||||
drc = "drc"
|
|
||||||
end if
|
|
||||||
|
|
||||||
groupId = `${mimeType}-${justCodec}-${colorInfo}-${audioTrackId}-${drc}`
|
|
||||||
|
|
||||||
if groupInfo[groupId] = invalid
|
if groupInfo[groupId] = invalid
|
||||||
groupInfo[groupId] = []
|
groupInfo[groupId] = []
|
||||||
@@ -441,7 +437,7 @@ class DashManifest
|
|||||||
end for
|
end for
|
||||||
end if
|
end if
|
||||||
|
|
||||||
if IsAssociativeArray(firstFormat.audioTrack) or firstFormat.isDrc = true
|
if IsAssociativeArray(firstFormat.audioTrack) or firstFormat.isDrc = true or firstFormat.isVoiceBoost = true
|
||||||
' Roles
|
' Roles
|
||||||
roles = m.GetTrackRoles(firstFormat)
|
roles = m.GetTrackRoles(firstFormat)
|
||||||
for each role in roles
|
for each role in roles
|
||||||
@@ -474,9 +470,7 @@ class DashManifest
|
|||||||
if IsAssociativeArray(stream.audioTrack) and IsString(stream.audioTrack.id)
|
if IsAssociativeArray(stream.audioTrack) and IsString(stream.audioTrack.id)
|
||||||
representationId = `${representationId}-${stream.audioTrack.id}`
|
representationId = `${representationId}-${stream.audioTrack.id}`
|
||||||
end if
|
end if
|
||||||
if stream.isDrc = true
|
representationId = `${representationId}${m.GetAudioVariantSuffix(stream)}`
|
||||||
representationId = `${representationId}-drc`
|
|
||||||
end if
|
|
||||||
|
|
||||||
representationAttributes = {
|
representationAttributes = {
|
||||||
"id": representationId
|
"id": representationId
|
||||||
@@ -739,7 +733,10 @@ class DashManifest
|
|||||||
|
|
||||||
function GetTrackRoles(format as object) as object
|
function GetTrackRoles(format as object) as object
|
||||||
roles = []
|
roles = []
|
||||||
if format.isOriginal = true
|
' Within the preferred language, the device defaults to a "main" track (a set
|
||||||
|
' without a Role counts as main) regardless of bitrate or manifest order.
|
||||||
|
' Stable Volume and Voice Boost are opt-in re-mixes of the original.
|
||||||
|
if format.isOriginal = true and format.isDrc <> true and format.isVoiceBoost <> true
|
||||||
roles.Push("main")
|
roles.Push("main")
|
||||||
else
|
else
|
||||||
roles.Push("alternate")
|
roles.Push("alternate")
|
||||||
@@ -753,13 +750,28 @@ class DashManifest
|
|||||||
roles.Push("description")
|
roles.Push("description")
|
||||||
end if
|
end if
|
||||||
|
|
||||||
if format.isDrc = true
|
' The device's audio menu ignores Label: it lists tracks by language, and this
|
||||||
|
' role is what shows a same-language variant separately, as "Enhanced audio".
|
||||||
|
if format.isVoiceBoost = true
|
||||||
roles.Push("enhanced-audio-intelligibility")
|
roles.Push("enhanced-audio-intelligibility")
|
||||||
end if
|
end if
|
||||||
|
|
||||||
return roles
|
return roles
|
||||||
end function
|
end function
|
||||||
|
|
||||||
|
' Stable Volume and Voice Boost are re-mixes of the same itag: without the suffix
|
||||||
|
' they share an AdaptationSet (and Representation ids) with the regular mix.
|
||||||
|
function GetAudioVariantSuffix(format as object) as string
|
||||||
|
suffix = ""
|
||||||
|
if format.isDrc = true
|
||||||
|
suffix = `${suffix}-drc`
|
||||||
|
end if
|
||||||
|
if format.isVoiceBoost = true
|
||||||
|
suffix = `${suffix}-vb`
|
||||||
|
end if
|
||||||
|
return suffix
|
||||||
|
end function
|
||||||
|
|
||||||
function GenerateImageAdaptationSets(xml as object, storyboards as object, id as integer) as integer
|
function GenerateImageAdaptationSets(xml as object, storyboards as object, id as integer) as integer
|
||||||
' https://developer.roku.com/en-ca/docs/developer-program/media-playback/trick-mode/hls-and-dash.md#dash-standard-thumbnail-tiles
|
' https://developer.roku.com/en-ca/docs/developer-program/media-playback/trick-mode/hls-and-dash.md#dash-standard-thumbnail-tiles
|
||||||
for i = storyboards.Count() - 1 to 0 step -1
|
for i = storyboards.Count() - 1 to 0 step -1
|
||||||
@@ -885,6 +897,7 @@ class DashManifest
|
|||||||
lang: ""
|
lang: ""
|
||||||
acont: ""
|
acont: ""
|
||||||
isDrc: false
|
isDrc: false
|
||||||
|
isVoiceBoost: false
|
||||||
isDubbed: false
|
isDubbed: false
|
||||||
isAutoDubbed: false
|
isAutoDubbed: false
|
||||||
isDescriptive: false
|
isDescriptive: false
|
||||||
@@ -921,6 +934,8 @@ class DashManifest
|
|||||||
result.acont = tags[key]
|
result.acont = tags[key]
|
||||||
else if key = "drc" and tags[key] = "1"
|
else if key = "drc" and tags[key] = "1"
|
||||||
result.isDrc = true
|
result.isDrc = true
|
||||||
|
else if key = "vb" and tags[key] = "1"
|
||||||
|
result.isVoiceBoost = true
|
||||||
end if
|
end if
|
||||||
end for
|
end for
|
||||||
|
|
||||||
|
|||||||
@@ -1,22 +1,17 @@
|
|||||||
import "pkg:/components/JobSystem/Jobs.bs"
|
import "pkg:/components/JobSystem/Jobs.bs"
|
||||||
import "pkg:/components/JobSystem/JobSystem.bs"
|
import "pkg:/components/JobSystem/JobSystem.bs"
|
||||||
import "pkg:/components/Services/Innertube/Constants.bs"
|
import "pkg:/components/Services/Innertube/Constants.bs"
|
||||||
import "pkg:/source/utils/StringUtils.bs"
|
|
||||||
|
|
||||||
function Init()
|
function Init()
|
||||||
m.top.observeField("requestSessionData", FuncName(OnRequestSessionData))
|
|
||||||
end function
|
end function
|
||||||
|
|
||||||
function OnNodeReady()
|
function OnNodeReady()
|
||||||
QueueSessionDataJob()
|
QueueSessionDataJob()
|
||||||
end function
|
end function
|
||||||
|
|
||||||
function OnRequestSessionData() as void
|
function EnsureSessionDataJob(_unused as dynamic) as object
|
||||||
sessionData = m.top.sessionData
|
|
||||||
if IsAssociativeArray(sessionData) and not StringUtils.IsNullOrEmpty(sessionData.visitorData) and not StringUtils.IsNullOrEmpty(sessionData.livingRoomPoTokenId)
|
|
||||||
return
|
|
||||||
end if
|
|
||||||
QueueSessionDataJob()
|
QueueSessionDataJob()
|
||||||
|
return m.innertubeSessionDataJob
|
||||||
end function
|
end function
|
||||||
|
|
||||||
function QueueSessionDataJob() as void
|
function QueueSessionDataJob() as void
|
||||||
@@ -33,6 +28,9 @@ function QueueSessionDataJob() as void
|
|||||||
end function
|
end function
|
||||||
|
|
||||||
function OnInnertubeSessionDataJobDone(event as object) as void
|
function OnInnertubeSessionDataJobDone(event as object) as void
|
||||||
JobSystem.UnobserveCallback(event.getRoSGNode())
|
node = event.getRoSGNode()
|
||||||
m.innertubeSessionDataJob = invalid
|
JobSystem.UnobserveCallback(node)
|
||||||
|
if m.innertubeSessionDataJob <> invalid and m.innertubeSessionDataJob.isSameNode(node)
|
||||||
|
m.innertubeSessionDataJob = invalid
|
||||||
|
end if
|
||||||
end function
|
end function
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
<component name="Innertube" extends="Node" includes="AutoBind">
|
<component name="Innertube" extends="Node" includes="AutoBind">
|
||||||
<interface>
|
<interface>
|
||||||
<field id="sessionData" type="assocarray" alwaysNotify="true" />
|
<field id="sessionData" type="assocarray" alwaysNotify="true" />
|
||||||
<field id="requestSessionData" type="boolean" alwaysNotify="true" />
|
|
||||||
<field id="jobQueue" type="node" />
|
<field id="jobQueue" type="node" />
|
||||||
|
<function name="EnsureSessionDataJob" />
|
||||||
</interface>
|
</interface>
|
||||||
</component>
|
</component>
|
||||||
@@ -1496,6 +1496,12 @@ namespace Innertube
|
|||||||
return invalid
|
return invalid
|
||||||
end if
|
end if
|
||||||
|
|
||||||
|
' "Explore more" tileRenderer, opens a search with a predefined query, like TILE_CONTENT_TYPE_EDU below
|
||||||
|
if TileRendererHasSearchEndpoint(nodeData["onSelectCommand"])
|
||||||
|
LogWarnNoTelemetry("Skipping tileRenderer without contentType for search endpoint")
|
||||||
|
return invalid
|
||||||
|
end if
|
||||||
|
|
||||||
Warning("TileRenderer without contentType", nodeData, context)
|
Warning("TileRenderer without contentType", nodeData, context)
|
||||||
return invalid
|
return invalid
|
||||||
end if
|
end if
|
||||||
@@ -1526,6 +1532,29 @@ namespace Innertube
|
|||||||
return invalid
|
return invalid
|
||||||
end function
|
end function
|
||||||
|
|
||||||
|
function TileRendererHasSearchEndpoint(onSelectCommand as object) as boolean
|
||||||
|
if not IsAssociativeArray(onSelectCommand)
|
||||||
|
return false
|
||||||
|
end if
|
||||||
|
|
||||||
|
if IsAssociativeArray(onSelectCommand["searchEndpoint"])
|
||||||
|
return true
|
||||||
|
end if
|
||||||
|
|
||||||
|
commands = ObjectUtils.Dig(onSelectCommand, ["commandExecutorCommand", "commands"])
|
||||||
|
if not IsArray(commands)
|
||||||
|
return false
|
||||||
|
end if
|
||||||
|
|
||||||
|
for each command in commands
|
||||||
|
if IsAssociativeArray(command) and IsAssociativeArray(command["searchEndpoint"])
|
||||||
|
return true
|
||||||
|
end if
|
||||||
|
end for
|
||||||
|
|
||||||
|
return false
|
||||||
|
end function
|
||||||
|
|
||||||
function TileRendererTypeVideo(nodeData as object, context as object) as object
|
function TileRendererTypeVideo(nodeData as object, context as object) as object
|
||||||
videoId = nodeData["contentId"]
|
videoId = nodeData["contentId"]
|
||||||
if not IsString(videoId)
|
if not IsString(videoId)
|
||||||
|
|||||||
@@ -17,6 +17,9 @@ namespace Innertube
|
|||||||
if sessionData = invalid or not IsInt(sessionData.timestamp)
|
if sessionData = invalid or not IsInt(sessionData.timestamp)
|
||||||
return false
|
return false
|
||||||
end if
|
end if
|
||||||
|
if StringUtils.IsNullOrEmpty(sessionData.visitorData)
|
||||||
|
return false
|
||||||
|
end if
|
||||||
nowSeconds = TimeUtils.Now().AsSeconds()
|
nowSeconds = TimeUtils.Now().AsSeconds()
|
||||||
return nowSeconds - sessionData.timestamp <= INNERTUBE_VISITOR_DATA_LIFESPAN_SECONDS
|
return nowSeconds - sessionData.timestamp <= INNERTUBE_VISITOR_DATA_LIFESPAN_SECONDS
|
||||||
end function
|
end function
|
||||||
|
|||||||
@@ -58,6 +58,7 @@ class LoungeApi
|
|||||||
commandHandlers = {}
|
commandHandlers = {}
|
||||||
commandHandlers[COMMAND_TYPE_NOOP] = m.HandleIgnoreCommand
|
commandHandlers[COMMAND_TYPE_NOOP] = m.HandleIgnoreCommand
|
||||||
commandHandlers[COMMAND_TYPE_GET_VOLUME] = m.HandleIgnoreCommand
|
commandHandlers[COMMAND_TYPE_GET_VOLUME] = m.HandleIgnoreCommand
|
||||||
|
commandHandlers[COMMAND_TYPE_SET_VOLUME] = m.HandleIgnoreCommand
|
||||||
commandHandlers[COMMAND_TYPE_GET_SUBTITLES_TRACK] = m.HandleIgnoreCommand
|
commandHandlers[COMMAND_TYPE_GET_SUBTITLES_TRACK] = m.HandleIgnoreCommand
|
||||||
commandHandlers[COMMAND_TYPE_SET_SUBTITLES] = m.HandleIgnoreCommand
|
commandHandlers[COMMAND_TYPE_SET_SUBTITLES] = m.HandleIgnoreCommand
|
||||||
commandHandlers[COMMAND_TYPE_SET_AUDIO_TRACK] = m.HandleIgnoreCommand
|
commandHandlers[COMMAND_TYPE_SET_AUDIO_TRACK] = m.HandleIgnoreCommand
|
||||||
@@ -78,7 +79,6 @@ class LoungeApi
|
|||||||
commandHandlers[COMMAND_TYPE_G_SESSION_ID] = m.HandleGSessionId
|
commandHandlers[COMMAND_TYPE_G_SESSION_ID] = m.HandleGSessionId
|
||||||
commandHandlers[COMMAND_TYPE_LOUNGE_STATUS] = m.HandleLoungeStatus
|
commandHandlers[COMMAND_TYPE_LOUNGE_STATUS] = m.HandleLoungeStatus
|
||||||
commandHandlers[COMMAND_TYPE_REMOTE_CONNECTED] = m.HandleRemoteConnected
|
commandHandlers[COMMAND_TYPE_REMOTE_CONNECTED] = m.HandleRemoteConnected
|
||||||
commandHandlers[COMMAND_TYPE_SET_VOLUME] = m.HandleSetVolume
|
|
||||||
commandHandlers[COMMAND_TYPE_SET_PLAYLIST] = m.HandleSetPlaylist
|
commandHandlers[COMMAND_TYPE_SET_PLAYLIST] = m.HandleSetPlaylist
|
||||||
commandHandlers[COMMAND_TYPE_UPDATE_PLAYLIST] = m.HandleUpdatePlaylist
|
commandHandlers[COMMAND_TYPE_UPDATE_PLAYLIST] = m.HandleUpdatePlaylist
|
||||||
commandHandlers[COMMAND_TYPE_PAUSE] = m.HandlePause
|
commandHandlers[COMMAND_TYPE_PAUSE] = m.HandlePause
|
||||||
@@ -422,20 +422,6 @@ class LoungeApi
|
|||||||
LoungeDeviceConnected.ShowNotifcation(m.notificationsNode, deviceName, userName, userAvatarUri)
|
LoungeDeviceConnected.ShowNotifcation(m.notificationsNode, deviceName, userName, userAvatarUri)
|
||||||
end function
|
end function
|
||||||
|
|
||||||
function HandleSetVolume(_commandId as integer, _commandType as string, commandArgs as object, _messagesToSend as object) as void
|
|
||||||
player = m.videoQueueNode.player
|
|
||||||
if player = invalid
|
|
||||||
return
|
|
||||||
end if
|
|
||||||
|
|
||||||
volume = Val(commandArgs["volume"])
|
|
||||||
isMute = volume = 0
|
|
||||||
LogInfo("Setting volume is not supported:", volume, "but can mute:", isMute)
|
|
||||||
' TODO:P2 volume should be set to the lounge state.
|
|
||||||
' Also the state needs to be separate from the player, since SponsorBlock can mute sections.
|
|
||||||
player.mute = isMute
|
|
||||||
end function
|
|
||||||
|
|
||||||
function HandleSetPlaylist(_commandId as integer, commandType as string, commandArgs as object, _messagesToSend as object)
|
function HandleSetPlaylist(_commandId as integer, commandType as string, commandArgs as object, _messagesToSend as object)
|
||||||
LogDebug(commandType, commandArgs)
|
LogDebug(commandType, commandArgs)
|
||||||
' TODO:P2 ctt: credentialTransferToken
|
' TODO:P2 ctt: credentialTransferToken
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
' Outgoing commands
|
' Outgoing commands
|
||||||
const COMMAND_NOW_PLAYING = "nowPlaying"
|
const COMMAND_NOW_PLAYING = "nowPlaying"
|
||||||
const COMMAND_ON_STATE_CHANGE = "onStateChange"
|
const COMMAND_ON_STATE_CHANGE = "onStateChange"
|
||||||
const COMMAND_ON_VOLUME_CHANGED = "onVolumeChanged"
|
|
||||||
const COMMAND_ON_PREVIOUS_NEXT_CHANGE = "onHasPreviousNextChanged"
|
const COMMAND_ON_PREVIOUS_NEXT_CHANGE = "onHasPreviousNextChanged"
|
||||||
const COMMAND_ON_PLAYBACK_SPEED_CHANGED = "onPlaybackSpeedChanged"
|
const COMMAND_ON_PLAYBACK_SPEED_CHANGED = "onPlaybackSpeedChanged"
|
||||||
const COMMAND_LOUNGE_SCREEN_DISCONNECTED = "loungeScreenDisconnected"
|
const COMMAND_LOUNGE_SCREEN_DISCONNECTED = "loungeScreenDisconnected"
|
||||||
@@ -58,8 +57,6 @@ const FIELD_LIST_ID = "listId"
|
|||||||
const FIELD_MDX_EXPANDED_RECEIVER_VIDEO_ID_LIST = "mdxExpandedReceiverVideoIdList"
|
const FIELD_MDX_EXPANDED_RECEIVER_VIDEO_ID_LIST = "mdxExpandedReceiverVideoIdList"
|
||||||
const FIELD_CURRENT_TIME = "currentTime"
|
const FIELD_CURRENT_TIME = "currentTime"
|
||||||
const FIELD_DURATION = "duration"
|
const FIELD_DURATION = "duration"
|
||||||
const FIELD_VOLUME = "volume"
|
|
||||||
const FIELD_MUTED = "muted"
|
|
||||||
const FIELD_CPN = "cpn"
|
const FIELD_CPN = "cpn"
|
||||||
const FIELD_CTT = "ctt"
|
const FIELD_CTT = "ctt"
|
||||||
const FIELD_CURRENT_INDEX = "currentIndex"
|
const FIELD_CURRENT_INDEX = "currentIndex"
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
height="100"
|
height="100"
|
||||||
opacity="0.9"
|
opacity="0.9"
|
||||||
blendColor="#414141"
|
blendColor="#414141"
|
||||||
uri="pkg:/images/white.9.png">
|
uri="pkg:/images/white.$$RES$$.9.png">
|
||||||
|
|
||||||
<CirclePoster
|
<CirclePoster
|
||||||
id="thumbnailPoster"
|
id="thumbnailPoster"
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
height="70"
|
height="70"
|
||||||
opacity="0.8"
|
opacity="0.8"
|
||||||
blendColor="#414141"
|
blendColor="#414141"
|
||||||
uri="pkg:/images/white.9.png">
|
uri="pkg:/images/white.$$RES$$.9.png">
|
||||||
<Poster
|
<Poster
|
||||||
uri="libpkg:/images/LogoSponsorBlockSimple256px.png"
|
uri="libpkg:/images/LogoSponsorBlockSimple256px.png"
|
||||||
width="50"
|
width="50"
|
||||||
|
|||||||
@@ -48,13 +48,14 @@ function TelemetryLoop() as void
|
|||||||
m.dist = GetDist(m.tags)
|
m.dist = GetDist(m.tags)
|
||||||
m.userId = GetUserId()
|
m.userId = GetUserId()
|
||||||
|
|
||||||
ReportLastExitCrash()
|
|
||||||
|
|
||||||
m.top.observeField("LogInfo", msgPort)
|
m.top.observeField("LogInfo", msgPort)
|
||||||
m.top.observeField("LogWarn", msgPort)
|
m.top.observeField("LogWarn", msgPort)
|
||||||
m.top.observeField("LogError", msgPort)
|
m.top.observeField("LogError", msgPort)
|
||||||
m.top.observeField("LogEvent", msgPort)
|
m.top.observeField("LogEvent", msgPort)
|
||||||
|
|
||||||
|
ReportSessionStart()
|
||||||
|
ReportLastExitCrash()
|
||||||
|
|
||||||
#if SUPPORTS_BATCHING
|
#if SUPPORTS_BATCHING
|
||||||
debouceMs = 2000
|
debouceMs = 2000
|
||||||
debounceCountLimit = 20
|
debounceCountLimit = 20
|
||||||
@@ -153,6 +154,18 @@ function TelemetryLoop() as void
|
|||||||
end while
|
end while
|
||||||
end function
|
end function
|
||||||
|
|
||||||
|
function ReportSessionStart() as void
|
||||||
|
Sentry.SendEvents([{
|
||||||
|
level: "info"
|
||||||
|
message: "[SESSION] start"
|
||||||
|
fingerprint: ["session start"]
|
||||||
|
release: m.release
|
||||||
|
dist: m.dist
|
||||||
|
tags: m.tags
|
||||||
|
userId: m.userId
|
||||||
|
}])
|
||||||
|
end function
|
||||||
|
|
||||||
function GetTags() as object
|
function GetTags() as object
|
||||||
appInfo = m.applicationInfo
|
appInfo = m.applicationInfo
|
||||||
tags = appInfo@.GetAppInfo()
|
tags = appInfo@.GetAppInfo()
|
||||||
|
|||||||
@@ -33,58 +33,59 @@ function ExecuteJob() as void
|
|||||||
service = new Invidious.InvidiousService(invidiousNode)
|
service = new Invidious.InvidiousService(invidiousNode)
|
||||||
backend = preferencesNode["backend.selected"]
|
backend = preferencesNode["backend.selected"]
|
||||||
|
|
||||||
metadata = contentNode.metadata
|
backendId = ResolveBackendId(backend, service)
|
||||||
if not IsAssociativeArray(metadata)
|
contentNode.addFields({ backend: backendId })
|
||||||
cancellation = JobGetCancellation()
|
contentNode.backend = backendId
|
||||||
if backend = "playlet"
|
|
||||||
|
|
||||||
sessionData = GetSessionData(innertubeNode, cancellation)
|
cancellation = JobGetCancellation()
|
||||||
if sessionData.cancel = true
|
if backend = "playlet"
|
||||||
JobCancel()
|
|
||||||
return
|
|
||||||
end if
|
|
||||||
if sessionData.error <> invalid
|
|
||||||
JobError(sessionData.error)
|
|
||||||
return
|
|
||||||
end if
|
|
||||||
|
|
||||||
accessToken = invalid
|
sessionData = GetSessionData(innertubeNode, cancellation)
|
||||||
onBehalfOfUser = invalid
|
if sessionData.cancel = true
|
||||||
profileNode = invalid
|
JobCancel()
|
||||||
profile = profilesService.currentProfile
|
return
|
||||||
if profile <> invalid and profile.type = "youtube"
|
|
||||||
auth = ProfileContentAuthTokenUtils.EnsureFreshAccessToken(profile)
|
|
||||||
if auth.state = ProfileContentAuthTokenUtils.AccessTokenState.NeedsReauth
|
|
||||||
JobError(Locale.Dialogs.ProfileNeedsReauthMessage)
|
|
||||||
return
|
|
||||||
end if
|
|
||||||
if auth.state = ProfileContentAuthTokenUtils.AccessTokenState.Ok
|
|
||||||
accessToken = auth.token
|
|
||||||
onBehalfOfUser = auth.activeIdentifyToken
|
|
||||||
profileNode = profile
|
|
||||||
end if
|
|
||||||
end if
|
|
||||||
|
|
||||||
metadata = InnertubeService.GetVideoMetadata(contentNode.videoId, {
|
|
||||||
"cancellation": cancellation
|
|
||||||
"credentialTransferToken": loungeServiceNode.credentialTransferToken
|
|
||||||
"visitorData": sessionData.visitorData
|
|
||||||
"livingRoomPoTokenId": sessionData.livingRoomPoTokenId
|
|
||||||
"accessToken": accessToken
|
|
||||||
"onBehalfOfUser": onBehalfOfUser
|
|
||||||
"profileNode": profileNode
|
|
||||||
"profilesService": profilesService
|
|
||||||
})
|
|
||||||
if IsAssociativeArray(metadata)
|
|
||||||
contentNode.addFields({
|
|
||||||
potAttached: ValidBool(metadata.potAttached)
|
|
||||||
potSource: ValidString(metadata.potSource)
|
|
||||||
loggedIn: not StringUtils.IsNullOrEmpty(accessToken)
|
|
||||||
})
|
|
||||||
end if
|
|
||||||
else
|
|
||||||
metadata = service.GetVideoMetadata(contentNode.videoId, { cancellation: m.top.cancellation })
|
|
||||||
end if
|
end if
|
||||||
|
if sessionData.error <> invalid
|
||||||
|
JobError(sessionData.error)
|
||||||
|
return
|
||||||
|
end if
|
||||||
|
|
||||||
|
accessToken = invalid
|
||||||
|
onBehalfOfUser = invalid
|
||||||
|
profileNode = invalid
|
||||||
|
profile = profilesService.currentProfile
|
||||||
|
if profile <> invalid and profile.type = "youtube"
|
||||||
|
auth = ProfileContentAuthTokenUtils.EnsureFreshAccessToken(profile)
|
||||||
|
if auth.state = ProfileContentAuthTokenUtils.AccessTokenState.NeedsReauth
|
||||||
|
JobError(Locale.Dialogs.ProfileNeedsReauthMessage)
|
||||||
|
return
|
||||||
|
end if
|
||||||
|
if auth.state = ProfileContentAuthTokenUtils.AccessTokenState.Ok
|
||||||
|
accessToken = auth.token
|
||||||
|
onBehalfOfUser = auth.activeIdentifyToken
|
||||||
|
profileNode = profile
|
||||||
|
end if
|
||||||
|
end if
|
||||||
|
|
||||||
|
metadata = InnertubeService.GetVideoMetadata(contentNode.videoId, {
|
||||||
|
"cancellation": cancellation
|
||||||
|
"credentialTransferToken": loungeServiceNode.credentialTransferToken
|
||||||
|
"visitorData": sessionData.visitorData
|
||||||
|
"livingRoomPoTokenId": sessionData.livingRoomPoTokenId
|
||||||
|
"accessToken": accessToken
|
||||||
|
"onBehalfOfUser": onBehalfOfUser
|
||||||
|
"profileNode": profileNode
|
||||||
|
"profilesService": profilesService
|
||||||
|
})
|
||||||
|
if IsAssociativeArray(metadata)
|
||||||
|
contentNode.addFields({
|
||||||
|
potAttached: ValidBool(metadata.potAttached)
|
||||||
|
potSource: ValidString(metadata.potSource)
|
||||||
|
loggedIn: not StringUtils.IsNullOrEmpty(accessToken)
|
||||||
|
})
|
||||||
|
end if
|
||||||
|
else
|
||||||
|
metadata = service.GetVideoMetadata(contentNode.videoId, { cancellation: m.top.cancellation })
|
||||||
end if
|
end if
|
||||||
|
|
||||||
if JobIsCancelled()
|
if JobIsCancelled()
|
||||||
@@ -180,17 +181,30 @@ function GetSessionData(innertubeNode as object, cancellation as object) as obje
|
|||||||
return sessionData
|
return sessionData
|
||||||
end if
|
end if
|
||||||
|
|
||||||
|
callback = innertubeNode.callFunc("EnsureSessionDataJob", invalid)
|
||||||
|
|
||||||
port = CreateObject("roMessagePort")
|
port = CreateObject("roMessagePort")
|
||||||
MessagePortUtils.ObserveFieldScopedExSafe(innertubeNode, "sessionData", port)
|
MessagePortUtils.ObserveFieldScopedExSafe(innertubeNode, "sessionData", port)
|
||||||
|
MessagePortUtils.ObserveFieldScopedExSafe(callback, "done", port)
|
||||||
CancellationUtils.ObserveCancellationScoped(cancellation, port)
|
CancellationUtils.ObserveCancellationScoped(cancellation, port)
|
||||||
|
|
||||||
innertubeNode.requestSessionData = true
|
cancelled = false
|
||||||
message = wait(30000, port)
|
while not SessionDataComplete(innertubeNode.sessionData) and callback.done <> true
|
||||||
|
message = wait(30000, port)
|
||||||
|
if message = invalid
|
||||||
|
exit while
|
||||||
|
end if
|
||||||
|
if CancellationUtils.IsCancellationEvent(cancellation, message)
|
||||||
|
cancelled = true
|
||||||
|
exit while
|
||||||
|
end if
|
||||||
|
end while
|
||||||
|
|
||||||
innertubeNode.unobserveFieldScoped("sessionData")
|
innertubeNode.unobserveFieldScoped("sessionData")
|
||||||
|
callback.unobserveFieldScoped("done")
|
||||||
CancellationUtils.UnobserveCancellationScoped(cancellation)
|
CancellationUtils.UnobserveCancellationScoped(cancellation)
|
||||||
|
|
||||||
if message <> invalid and CancellationUtils.IsCancellationEvent(cancellation, message)
|
if cancelled
|
||||||
return {
|
return {
|
||||||
cancel: true
|
cancel: true
|
||||||
}
|
}
|
||||||
@@ -210,6 +224,16 @@ function SessionDataComplete(sessionData as object) as boolean
|
|||||||
return IsAssociativeArray(sessionData) and not StringUtils.IsNullOrEmpty(sessionData.visitorData) and not StringUtils.IsNullOrEmpty(sessionData.livingRoomPoTokenId)
|
return IsAssociativeArray(sessionData) and not StringUtils.IsNullOrEmpty(sessionData.visitorData) and not StringUtils.IsNullOrEmpty(sessionData.livingRoomPoTokenId)
|
||||||
end function
|
end function
|
||||||
|
|
||||||
|
function ResolveBackendId(backend as string, service as Invidious.InvidiousService) as string
|
||||||
|
if backend = "playlet"
|
||||||
|
return "playlet"
|
||||||
|
end if
|
||||||
|
if service.GetInstance() = Invidious.PLAYLET_BUILT_IN_INSTANCE
|
||||||
|
return "built-in"
|
||||||
|
end if
|
||||||
|
return "invidious"
|
||||||
|
end function
|
||||||
|
|
||||||
function CreateStreamUrls(metadata as object, service as Invidious.InvidiousService, preferences as object, backend as string, playletServerPort as integer) as object
|
function CreateStreamUrls(metadata as object, service as Invidious.InvidiousService, preferences as object, backend as string, playletServerPort as integer) as object
|
||||||
instance = service.GetInstance()
|
instance = service.GetInstance()
|
||||||
proxyVideos = preferences["invidious.proxy_videos"]
|
proxyVideos = preferences["invidious.proxy_videos"]
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
# VideoPlayerDev
|
# VideoPlayerDev
|
||||||
|
|
||||||
The custom video player intended to replace `components/VideoPlayer` — a stock-OS-trickplay replica plus a
|
The custom video player that replaced `components/VideoPlayer` — a stock-OS-trickplay replica plus a control
|
||||||
control button row. It is selected at **compile time** by `#const USE_DEV_PLAYER` in `VideoQueue.bs` (default
|
button row. It is selected at **compile time** by `#const USE_DEV_PLAYER` in `VideoQueue.bs`, currently `true`:
|
||||||
`false`). Build with the flag `true` to run it (and the integration suite).
|
this is the player that ships. Build with the flag `false` to fall back to the stock `VideoPlayer` (the
|
||||||
|
integration suite asserts the dev player, so it only passes with the flag on).
|
||||||
|
|
||||||
## Architecture
|
## Architecture
|
||||||
|
|
||||||
|
|||||||
@@ -418,7 +418,7 @@ function TrySponsorBlockSkip() as boolean
|
|||||||
end function
|
end function
|
||||||
|
|
||||||
' OK/Select — the one shared key. Priority (after the SponsorBlock skip, handled in OnKeyEvent): commit (if a
|
' OK/Select — the one shared key. Priority (after the SponsorBlock skip, handled in OnKeyEvent): commit (if a
|
||||||
' transport is active) -> chrome/pause toggle. OK is the VOD pause key (there is no separate ECP Pause). So
|
' transport is active) -> chrome/pause toggle. OK is the VOD pause key. So
|
||||||
' while idle: VOD = play/pause toggle (reveals chrome + LargePause); live = chrome toggle only (no pause).
|
' while idle: VOD = play/pause toggle (reveals chrome + LargePause); live = chrome toggle only (no pause).
|
||||||
function OnOkPress() as boolean
|
function OnOkPress() as boolean
|
||||||
' commit an active transport.
|
' commit an active transport.
|
||||||
@@ -805,7 +805,7 @@ function EnforceTransportFreeze(source as string) as void
|
|||||||
LogErrorNoTelemetry(healInfo)
|
LogErrorNoTelemetry(healInfo)
|
||||||
if m.healCount <= INV_D1_TELEMETRY_CAP
|
if m.healCount <= INV_D1_TELEMETRY_CAP
|
||||||
LogTelemetryEvent({
|
LogTelemetryEvent({
|
||||||
level: "error"
|
level: "warning"
|
||||||
message: healInfo
|
message: healInfo
|
||||||
fingerprint: ["INV-D1 heal", m.transport.transportMode, source]
|
fingerprint: ["INV-D1 heal", m.transport.transportMode, source]
|
||||||
})
|
})
|
||||||
@@ -842,7 +842,7 @@ end function
|
|||||||
function SendHealSummary() as void
|
function SendHealSummary() as void
|
||||||
if m.healCount > INV_D1_TELEMETRY_CAP
|
if m.healCount > INV_D1_TELEMETRY_CAP
|
||||||
LogTelemetryEvent({
|
LogTelemetryEvent({
|
||||||
level: "error"
|
level: "warning"
|
||||||
message: `INV-D1 heal: ${m.healCount} heals over one content (${m.healCount - INV_D1_TELEMETRY_CAP} past the telemetry cap)`
|
message: `INV-D1 heal: ${m.healCount} heals over one content (${m.healCount - INV_D1_TELEMETRY_CAP} past the telemetry cap)`
|
||||||
fingerprint: ["INV-D1 heal suppressed"]
|
fingerprint: ["INV-D1 heal suppressed"]
|
||||||
})
|
})
|
||||||
@@ -1152,7 +1152,7 @@ function OnVideoContentJobDone(event as object) as void
|
|||||||
content = m.top.content
|
content = m.top.content
|
||||||
|
|
||||||
if not info.success
|
if not info.success
|
||||||
LogError("VideoContentJob FAILED:", info.error)
|
LogError(`VideoContentJob FAILED: ${info.error}\nbackend: ${ContentBackend(content)}`)
|
||||||
decision = ErrorDialogController.DecideContentJobFailure(content, info.error)
|
decision = ErrorDialogController.DecideContentJobFailure(content, info.error)
|
||||||
ShowErrorDialog(decision)
|
ShowErrorDialog(decision)
|
||||||
Lounge.SendOnStateChange()
|
Lounge.SendOnStateChange()
|
||||||
@@ -1442,6 +1442,13 @@ function GetPlayerErrorData(videoId as string, errorInfo as object) as object
|
|||||||
return { title: title, body: body, fingerprint: fingerprint }
|
return { title: title, body: body, fingerprint: fingerprint }
|
||||||
end function
|
end function
|
||||||
|
|
||||||
|
function ContentBackend(content as object) as string
|
||||||
|
if content <> invalid and not StringUtils.IsNullOrEmpty(content.backend)
|
||||||
|
return content.backend
|
||||||
|
end if
|
||||||
|
return "unknown"
|
||||||
|
end function
|
||||||
|
|
||||||
' Send a stream error to telemetry. For malformed-data errors, attach the last generated DASH/HLS manifest and
|
' Send a stream error to telemetry. For malformed-data errors, attach the last generated DASH/HLS manifest and
|
||||||
' player response so the failure can be diagnosed from the report.
|
' player response so the failure can be diagnosed from the report.
|
||||||
function ReportVideoError(errorData as object, url as dynamic, urls as object, urlIndex as dynamic, shownInDialog as boolean) as void
|
function ReportVideoError(errorData as object, url as dynamic, urls as object, urlIndex as dynamic, shownInDialog as boolean) as void
|
||||||
@@ -1464,21 +1471,19 @@ function ReportVideoError(errorData as object, url as dynamic, urls as object, u
|
|||||||
data: ValidString(ReadAsciiFile("cachefs:/last_player_response.json"))
|
data: ValidString(ReadAsciiFile("cachefs:/last_player_response.json"))
|
||||||
}]
|
}]
|
||||||
end if
|
end if
|
||||||
potAttached = "false"
|
potAttached = false
|
||||||
potSource = "none"
|
potSource = "none"
|
||||||
loggedIn = "false"
|
loggedIn = false
|
||||||
content = m.top.content
|
content = m.top.content
|
||||||
if content <> invalid
|
if content <> invalid
|
||||||
if ValidBool(content.potAttached)
|
potAttached = ValidBool(content.potAttached)
|
||||||
potAttached = "true"
|
loggedIn = ValidBool(content.loggedIn)
|
||||||
end if
|
|
||||||
if not StringUtils.IsNullOrEmpty(content.potSource)
|
if not StringUtils.IsNullOrEmpty(content.potSource)
|
||||||
potSource = content.potSource
|
potSource = content.potSource
|
||||||
end if
|
end if
|
||||||
if ValidBool(content.loggedIn)
|
|
||||||
loggedIn = "true"
|
|
||||||
end if
|
|
||||||
end if
|
end if
|
||||||
|
backend = ContentBackend(content)
|
||||||
|
isLive = m.transport.isLive
|
||||||
message = [
|
message = [
|
||||||
errorData.title
|
errorData.title
|
||||||
errorData.body
|
errorData.body
|
||||||
@@ -1491,11 +1496,15 @@ function ReportVideoError(errorData as object, url as dynamic, urls as object, u
|
|||||||
`pot_attached: ${potAttached}`
|
`pot_attached: ${potAttached}`
|
||||||
`pot_source: ${potSource}`
|
`pot_source: ${potSource}`
|
||||||
`logged_in: ${loggedIn}`
|
`logged_in: ${loggedIn}`
|
||||||
|
`backend: ${backend}`
|
||||||
|
`is_live: ${isLive}`
|
||||||
].Join(Chr(10))
|
].Join(Chr(10))
|
||||||
errorData.fingerprint.Push(shownInDialog)
|
errorData.fingerprint.Push(shownInDialog)
|
||||||
errorData.fingerprint.Push(potAttached)
|
errorData.fingerprint.Push(potAttached)
|
||||||
errorData.fingerprint.Push(potSource)
|
errorData.fingerprint.Push(potSource)
|
||||||
errorData.fingerprint.Push(loggedIn)
|
errorData.fingerprint.Push(loggedIn)
|
||||||
|
errorData.fingerprint.Push(backend)
|
||||||
|
errorData.fingerprint.Push(isLive)
|
||||||
if shownInDialog
|
if shownInDialog
|
||||||
level = "error"
|
level = "error"
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -84,6 +84,14 @@ function TestSetup() as void
|
|||||||
m.top.unobserveField(deviceField)
|
m.top.unobserveField(deviceField)
|
||||||
end for
|
end for
|
||||||
|
|
||||||
|
' The mock node is shared across tests and `duration` is not alwaysNotify, so a leftover duration=100
|
||||||
|
' swallows the next test's identical write and OnDuration never fires. Reset with the observers off.
|
||||||
|
m.top.state = VideoState.None
|
||||||
|
m.top.control = VideoControl.None
|
||||||
|
m.top.position = 0
|
||||||
|
m.top.duration = 0
|
||||||
|
m.top.seek = 0
|
||||||
|
|
||||||
OnNodeReady()
|
OnNodeReady()
|
||||||
end function
|
end function
|
||||||
|
|
||||||
@@ -118,6 +126,13 @@ function TestSetLive(edgeMs as integer) as void
|
|||||||
m.transport.OnPosition(edgeMs)
|
m.transport.OnPosition(edgeMs)
|
||||||
end function
|
end function
|
||||||
|
|
||||||
|
' TestSeedSponsorBlock — the segments job's result, minus the job. Writing m.top.position afterwards runs the
|
||||||
|
' REAL OnPosition, which is what arms the manual notice.
|
||||||
|
function TestSeedSponsorBlock(segments as object) as void
|
||||||
|
m.sponsorblock.enabled = true
|
||||||
|
m.sponsorblock.segments = segments
|
||||||
|
end function
|
||||||
|
|
||||||
' TestFireLiveBadgeHold — fire the liveBadgeHold timer's handler now (the spec can't wait out the real timer).
|
' TestFireLiveBadgeHold — fire the liveBadgeHold timer's handler now (the spec can't wait out the real timer).
|
||||||
function TestFireLiveBadgeHold() as void
|
function TestFireLiveBadgeHold() as void
|
||||||
OnLiveBadgeHoldFire()
|
OnLiveBadgeHoldFire()
|
||||||
@@ -151,6 +166,10 @@ function TestPlaybackErrorDialog(errorFields as object) as object
|
|||||||
playletStreamUrls: []
|
playletStreamUrls: []
|
||||||
playletStreamUrlIndex: 0
|
playletStreamUrlIndex: 0
|
||||||
})
|
})
|
||||||
|
if errorFields.backend <> invalid
|
||||||
|
content.addField("backend", "string", false)
|
||||||
|
content.backend = errorFields.backend
|
||||||
|
end if
|
||||||
m.top.content = content
|
m.top.content = content
|
||||||
|
|
||||||
m.top.errorMsg = errorFields.errorMsg
|
m.top.errorMsg = errorFields.errorMsg
|
||||||
@@ -210,6 +229,7 @@ function TestSnapshot() as object
|
|||||||
focusTarget: m.focusTarget
|
focusTarget: m.focusTarget
|
||||||
focusedButton: m.focusedButton
|
focusedButton: m.focusedButton
|
||||||
nudgeCount: m.top.nudgeCount
|
nudgeCount: m.top.nudgeCount
|
||||||
|
sponsorNoticeShown: SponsorBlock.GetCurrentNotification(m.notifications) <> invalid
|
||||||
forceLiveBadge: m.trickPlayBar.forceLiveBadge
|
forceLiveBadge: m.trickPlayBar.forceLiveBadge
|
||||||
liveBadgeShown: m.trickPlayBar.findNode("liveLabel").visible
|
liveBadgeShown: m.trickPlayBar.findNode("liveLabel").visible
|
||||||
barRemainingText: m.trickPlayBar.findNode("remainingLabel").text
|
barRemainingText: m.trickPlayBar.findNode("remainingLabel").text
|
||||||
|
|||||||
@@ -52,6 +52,7 @@
|
|||||||
<function name="TestWireQueueClose" />
|
<function name="TestWireQueueClose" />
|
||||||
<function name="TestSetControl" />
|
<function name="TestSetControl" />
|
||||||
<function name="TestSetLive" />
|
<function name="TestSetLive" />
|
||||||
|
<function name="TestSeedSponsorBlock" />
|
||||||
<function name="TestFireLiveBadgeHold" />
|
<function name="TestFireLiveBadgeHold" />
|
||||||
<function name="TestKillAutoHide" />
|
<function name="TestKillAutoHide" />
|
||||||
<function name="TestFinishChromeFadeOut" />
|
<function name="TestFinishChromeFadeOut" />
|
||||||
|
|||||||
@@ -183,12 +183,51 @@ namespace Tests
|
|||||||
m.assertTrue(snap.title.Instr("dQw4w9WgXcQ") >= 0, "dialog title dropped the videoId")
|
m.assertTrue(snap.title.Instr("dQw4w9WgXcQ") >= 0, "dialog title dropped the videoId")
|
||||||
end function
|
end function
|
||||||
|
|
||||||
|
@it("the reported playback error carries the serving backend and the live flag")
|
||||||
|
function _()
|
||||||
|
m.top.callFunc("TestPlaybackErrorDialog", {
|
||||||
|
videoId: "dQw4w9WgXcQ"
|
||||||
|
errorMsg: "no valid bitrates"
|
||||||
|
errorCode: -5
|
||||||
|
errorStr: "buffer:loop:demux:Errors seen on all bitrates:last_err:503"
|
||||||
|
errorInfo: { category: "mediaerror", source: "buffer:loop:demux", ignored: false }
|
||||||
|
backend: "built-in"
|
||||||
|
})
|
||||||
|
|
||||||
|
reported = m.global.telemetry.LogEvent
|
||||||
|
m.assertTrue(reported.message.Instr("backend: built-in") > 0, "got: " + reported.message)
|
||||||
|
m.assertTrue(reported.message.Instr("is_live: false") > 0, "got: " + reported.message)
|
||||||
|
m.assertTrue(reported.message.Instr("pot_attached: false") > 0, "got: " + reported.message)
|
||||||
|
m.assertArrayContains(reported.fingerprint, "built-in")
|
||||||
|
end function
|
||||||
|
|
||||||
|
@it("a playback error on a content node with no backend reports it as unknown")
|
||||||
|
function _()
|
||||||
|
m.top.callFunc("TestPlaybackErrorDialog", {
|
||||||
|
videoId: "dQw4w9WgXcQ"
|
||||||
|
errorMsg: "no valid bitrates"
|
||||||
|
errorCode: -5
|
||||||
|
errorStr: "buffer:loop:demux:Errors seen on all bitrates:last_err:403"
|
||||||
|
errorInfo: { category: "mediaerror", source: "buffer:loop:demux", ignored: false }
|
||||||
|
})
|
||||||
|
|
||||||
|
reported = m.global.telemetry.LogEvent
|
||||||
|
m.assertTrue(reported.message.Instr("backend: unknown") > 0, "got: " + reported.message)
|
||||||
|
end function
|
||||||
|
|
||||||
' Up/Down reveal the chrome when it is hidden in idle (they otherwise do nothing).
|
' Up/Down reveal the chrome when it is hidden in idle (they otherwise do nothing).
|
||||||
@it("Up reveals the chrome when it is hidden in idle")
|
@it("Up and Down each reveal the chrome when it is hidden in idle")
|
||||||
function _()
|
function _()
|
||||||
m.assertFalse(m.Snap().chromeShown) ' starts hidden after setup
|
m.assertFalse(m.Snap().chromeShown) ' starts hidden after setup
|
||||||
m.top.callFunc("TestKey", RemoteKeys.Up, true)
|
m.top.callFunc("TestKey", RemoteKeys.Up, true)
|
||||||
m.assertTrue(m.Snap().chromeShown, "Up revealed the chrome")
|
m.assertTrue(m.Snap().chromeShown, "Up revealed the chrome")
|
||||||
|
|
||||||
|
' back to fully hidden: the reveal only fires from Hidden, not mid fade-out.
|
||||||
|
m.top.callFunc("TestKey", RemoteKeys.Back, true)
|
||||||
|
m.top.callFunc("TestFinishChromeFadeOut")
|
||||||
|
m.assertFalse(m.Snap().chromeShown)
|
||||||
|
m.top.callFunc("TestKey", RemoteKeys.Down, true)
|
||||||
|
m.assertTrue(m.Snap().chromeShown, "Down revealed the chrome")
|
||||||
end function
|
end function
|
||||||
|
|
||||||
' =========================================================================================
|
' =========================================================================================
|
||||||
@@ -317,6 +356,121 @@ namespace Tests
|
|||||||
m.assertTrue(m.top.videoQueue.closePlayer, "rung 4: Back closes")
|
m.assertTrue(m.top.videoQueue.closePlayer, "rung 4: Back closes")
|
||||||
end function
|
end function
|
||||||
|
|
||||||
|
' =========================================================================================
|
||||||
|
' Key router — the branches that decide WHICH handler runs.
|
||||||
|
' =========================================================================================
|
||||||
|
|
||||||
|
' The segment shape SponsorBlockSegmentsJob returns.
|
||||||
|
function ManualSegment(startS as float, endS as float) as object
|
||||||
|
return [{ start: startS, end: endS, option: "manual_skip", title: "Sponsor", shortTitle: "Sponsor", actionText: "Press OK to skip", showNotification: true, UUID: "seg-manual", category: "sponsor" }]
|
||||||
|
end function
|
||||||
|
|
||||||
|
' Minimize is the discriminator: activating it would have hidden the chrome.
|
||||||
|
@it("an armed SponsorBlock notice outranks the buttons tier: OK skips instead of activating the button")
|
||||||
|
function _()
|
||||||
|
m.top.duration = 100
|
||||||
|
m.top.callFunc("TestSeedSponsorBlock", m.ManualSegment(10.0, 40.0))
|
||||||
|
m.top.position = 12.0 ' the REAL OnPosition arms the manual notice
|
||||||
|
m.assertTrue(m.Snap().sponsorNoticeShown, "the notice is up")
|
||||||
|
|
||||||
|
m.top.callFunc("TestKey", RemoteKeys.Up, true) ' reveal -> bar tier
|
||||||
|
m.top.callFunc("TestKey", RemoteKeys.Up, true) ' bar -> buttons tier
|
||||||
|
m.top.callFunc("TestKey", RemoteKeys.Right, true) ' highlight minimize
|
||||||
|
m.assertEqual(m.Snap().focusedButton, 1)
|
||||||
|
|
||||||
|
m.top.callFunc("TestKey", RemoteKeys.Ok, true)
|
||||||
|
after = m.Snap()
|
||||||
|
m.assertEqual(Int(m.top.seek * 1000), 40000, "OK skipped to the segment end, not into the focused button")
|
||||||
|
m.assertFalse(after.sponsorNoticeShown, "the skip took the notice down")
|
||||||
|
m.assertTrue(after.chromeShown, "minimize never ran -- it would have hidden the chrome")
|
||||||
|
end function
|
||||||
|
|
||||||
|
@it("an armed SponsorBlock notice outranks the Back ladder: Back dismisses the notice, not the player")
|
||||||
|
function _()
|
||||||
|
m.top.duration = 100
|
||||||
|
m.top.callFunc("TestSeedSponsorBlock", m.ManualSegment(10.0, 40.0))
|
||||||
|
m.top.position = 12.0
|
||||||
|
m.assertTrue(m.Snap().sponsorNoticeShown)
|
||||||
|
m.assertFalse(m.Snap().chromeShown, "chrome hidden: an unrouted Back here would CLOSE the player")
|
||||||
|
seekBefore = m.top.seek
|
||||||
|
|
||||||
|
m.top.callFunc("TestKey", RemoteKeys.Back, true)
|
||||||
|
after = m.Snap()
|
||||||
|
m.assertFalse(after.sponsorNoticeShown, "Back took the notice down")
|
||||||
|
m.assertFalse(m.top.videoQueue.closePlayer, "Back acted on the notice, NOT on the player")
|
||||||
|
m.assertEqual(m.top.seek, seekBefore, "dismissing is not skipping")
|
||||||
|
|
||||||
|
' one-shot: with the notice gone the next Back is the ordinary ladder again (rung 4 -> close).
|
||||||
|
m.top.callFunc("TestKey", RemoteKeys.Back, true)
|
||||||
|
m.assertTrue(m.top.videoQueue.closePlayer, "the notice consumed one Back, not every Back")
|
||||||
|
end function
|
||||||
|
|
||||||
|
@it("an armed notice on a segment at the video end finishes playback instead of seeking")
|
||||||
|
function _()
|
||||||
|
m.top.duration = 100
|
||||||
|
m.top.callFunc("TestSeedSponsorBlock", m.ManualSegment(90.0, 99.5)) ' ends within 2s of duration
|
||||||
|
m.top.position = 92.0
|
||||||
|
m.assertTrue(m.Snap().sponsorNoticeShown)
|
||||||
|
seekBefore = m.top.seek
|
||||||
|
|
||||||
|
m.top.callFunc("TestKey", RemoteKeys.Ok, true)
|
||||||
|
m.assertEqual(m.top.seek, seekBefore, "no seek was issued: the skip resolved to finish")
|
||||||
|
m.assertTrue(m.top.videoQueue.closePlayer, "no next video -> the finish closed the player")
|
||||||
|
end function
|
||||||
|
|
||||||
|
@it("the non-transport keys act on the key-DOWN edge only")
|
||||||
|
function _()
|
||||||
|
' Back goes first: only from the start state does its DOWN edge close the player.
|
||||||
|
m.assertFalse(m.top.callFunc("TestKey", RemoteKeys.Back, false), "the Back key-up is not consumed")
|
||||||
|
m.assertFalse(m.top.videoQueue.closePlayer, "the Back key-up must not close the player")
|
||||||
|
|
||||||
|
m.top.callFunc("TestKey", RemoteKeys.Ok, true) ' reveal
|
||||||
|
m.top.callFunc("TestKey", RemoteKeys.Ok, true) ' pause
|
||||||
|
m.top.callFunc("TestSetState", VideoState.Paused)
|
||||||
|
m.assertEqual(m.Snap().control, VideoControl.Pause)
|
||||||
|
|
||||||
|
m.assertFalse(m.top.callFunc("TestKey", RemoteKeys.Ok, false), "the OK key-up is not consumed")
|
||||||
|
m.assertFalse(m.top.callFunc("TestKey", RemoteKeys.Play, false), "the Play key-up is not consumed")
|
||||||
|
m.assertFalse(m.top.callFunc("TestKey", RemoteKeys.PlayOnly, false), "the PlayOnly key-up is not consumed")
|
||||||
|
m.assertFalse(m.top.callFunc("TestKey", RemoteKeys.Pause, false), "the Pause key-up is not consumed")
|
||||||
|
m.assertEqual(m.Snap().control, VideoControl.Pause, "no key-up toggled the pause back to playing")
|
||||||
|
end function
|
||||||
|
|
||||||
|
@it("Play commits an active transport, like OK")
|
||||||
|
function _()
|
||||||
|
m.top.callFunc("TestKey", RemoteKeys.Left, true)
|
||||||
|
m.top.callFunc("TestKey", RemoteKeys.Left, false)
|
||||||
|
m.assertEqual(m.Snap().transportMode, TransportController.Mode.Scrub)
|
||||||
|
|
||||||
|
m.top.callFunc("TestKey", RemoteKeys.Play, true)
|
||||||
|
after = m.Snap()
|
||||||
|
m.assertEqual(after.transportMode, TransportController.Mode.Idle, "Play committed the scrub")
|
||||||
|
m.assertTrue(after.seekSettling, "the commit emitted a play-through seek, not a play/pause toggle")
|
||||||
|
end function
|
||||||
|
|
||||||
|
@it("PlayOnly toggles play/pause, like Play")
|
||||||
|
function _()
|
||||||
|
m.top.callFunc("TestKey", RemoteKeys.PlayOnly, true)
|
||||||
|
m.assertEqual(m.Snap().control, VideoControl.Pause, "PlayOnly paused the playing video")
|
||||||
|
m.top.callFunc("TestSetState", VideoState.Paused)
|
||||||
|
m.top.callFunc("TestKey", RemoteKeys.PlayOnly, true)
|
||||||
|
m.assertEqual(m.Snap().control, VideoControl.Resume, "PlayOnly resumed the paused video")
|
||||||
|
end function
|
||||||
|
|
||||||
|
@it("the transport keys fall through the buttons tier to the transport")
|
||||||
|
function _()
|
||||||
|
m.top.callFunc("TestKey", RemoteKeys.Up, true) ' reveal -> bar tier
|
||||||
|
m.top.callFunc("TestKey", RemoteKeys.Up, true) ' bar -> buttons tier
|
||||||
|
m.assertEqual(m.Snap().focusTarget, PlayerCoordinatorLogic.FocusTarget.Buttons)
|
||||||
|
|
||||||
|
m.top.callFunc("TestKey", RemoteKeys.Rewind, true)
|
||||||
|
m.top.callFunc("TestKey", RemoteKeys.Rewind, false)
|
||||||
|
after = m.Snap()
|
||||||
|
m.assertEqual(after.transportMode, TransportController.Mode.Scan, "Rev started the scan from the buttons tier")
|
||||||
|
m.assertEqual(after.focusTarget, PlayerCoordinatorLogic.FocusTarget.Bar, "a transport key moves focus to the bar")
|
||||||
|
m.assertEqual(after.nudgeCount, 0, "the row did not treat it as one of its own keys")
|
||||||
|
end function
|
||||||
|
|
||||||
' The point of the bar-default: Left/Right seek and OK pauses with no navigation at all, straight off a
|
' The point of the bar-default: Left/Right seek and OK pauses with no navigation at all, straight off a
|
||||||
' fresh reveal. Pinned as its own test rather than left as a side effect of the tier round-trip tests.
|
' fresh reveal. Pinned as its own test rather than left as a side effect of the tier round-trip tests.
|
||||||
@it("a fresh idle reveal defaults focus to the bar: Left/Right seek and OK pauses with no navigation")
|
@it("a fresh idle reveal defaults focus to the bar: Left/Right seek and OK pauses with no navigation")
|
||||||
@@ -523,6 +677,61 @@ namespace Tests
|
|||||||
m.assertEqual(snap.focusedButton, 1, "the highlight is untouched")
|
m.assertEqual(snap.focusedButton, 1, "the highlight is untouched")
|
||||||
end function
|
end function
|
||||||
|
|
||||||
|
' Each arm is asserted: a state that silently failed to arm makes every row that follows vacuous.
|
||||||
|
function ArmRouterState(state as string) as void
|
||||||
|
m.top.callFunc("TestSetup")
|
||||||
|
m.top.callFunc("TestSetState", VideoState.Playing) ' opens the brain's ready-gate, as beforeEach does
|
||||||
|
if state = "idle hidden"
|
||||||
|
m.assertFalse(m.Snap().chromeShown, "armed: " + state)
|
||||||
|
else if state = "chrome/bar"
|
||||||
|
m.top.callFunc("TestKey", RemoteKeys.Up, true)
|
||||||
|
snap = m.Snap()
|
||||||
|
m.assertTrue(snap.chromeShown, "armed: " + state)
|
||||||
|
m.assertEqual(snap.focusTarget, PlayerCoordinatorLogic.FocusTarget.Bar, "armed: " + state)
|
||||||
|
else if state = "chrome/buttons"
|
||||||
|
m.top.callFunc("TestKey", RemoteKeys.Up, true)
|
||||||
|
m.top.callFunc("TestKey", RemoteKeys.Up, true)
|
||||||
|
snap = m.Snap()
|
||||||
|
m.assertTrue(snap.chromeShown, "armed: " + state)
|
||||||
|
m.assertEqual(snap.focusTarget, PlayerCoordinatorLogic.FocusTarget.Buttons, "armed: " + state)
|
||||||
|
else if state = "transport"
|
||||||
|
m.top.callFunc("TestKey", RemoteKeys.Left, true)
|
||||||
|
m.top.callFunc("TestKey", RemoteKeys.Left, false)
|
||||||
|
m.assertEqual(m.Snap().transportMode, TransportController.Mode.Scrub, "armed: " + state)
|
||||||
|
end if
|
||||||
|
end function
|
||||||
|
|
||||||
|
' BrighterScript enums are compile-time constants with no runtime form, so a new RemoteKeys member
|
||||||
|
' cannot fail this until someone lists it below — these lists are the decision record, not reflection.
|
||||||
|
@it("every remote key's disposition is pinned in every router state")
|
||||||
|
function _()
|
||||||
|
ownedEverywhere = [RemoteKeys.Left, RemoteKeys.Right, RemoteKeys.Rewind, RemoteKeys.FastForward, RemoteKeys.Replay, RemoteKeys.Ok, RemoteKeys.Back, RemoteKeys.Play, RemoteKeys.PlayOnly]
|
||||||
|
' AppController's, not the player's.
|
||||||
|
passedEverywhere = [RemoteKeys.Options, RemoteKeys.Pause, RemoteKeys.OkLongPress, RemoteKeys.OptionsLongPress]
|
||||||
|
' the tier keys are owned only while there is a tier to move through or a chrome to reveal.
|
||||||
|
tierKeys = [RemoteKeys.Up, RemoteKeys.Down]
|
||||||
|
|
||||||
|
for each state in ["idle hidden", "chrome/bar", "chrome/buttons", "transport"]
|
||||||
|
for each key in ownedEverywhere
|
||||||
|
m.ArmRouterState(state)
|
||||||
|
m.assertTrue(m.top.callFunc("TestKey", key, true), "'" + key + "' must be consumed in state " + state)
|
||||||
|
end for
|
||||||
|
for each key in passedEverywhere
|
||||||
|
m.ArmRouterState(state)
|
||||||
|
m.assertFalse(m.top.callFunc("TestKey", key, true), "'" + key + "' must pass to the parent in state " + state)
|
||||||
|
end for
|
||||||
|
for each key in tierKeys
|
||||||
|
m.ArmRouterState(state)
|
||||||
|
consumed = m.top.callFunc("TestKey", key, true)
|
||||||
|
if state = "transport"
|
||||||
|
m.assertFalse(consumed, "'" + key + "' has nothing to do under a transport -- it passes to the parent")
|
||||||
|
else
|
||||||
|
m.assertTrue(consumed, "'" + key + "' moves focus or reveals the chrome in state " + state)
|
||||||
|
end if
|
||||||
|
end for
|
||||||
|
end for
|
||||||
|
end function
|
||||||
|
|
||||||
' The coordinator twin of the brain's unmodeled-axis meta-test: every m.* field on the coordinator must
|
' The coordinator twin of the brain's unmodeled-axis meta-test: every m.* field on the coordinator must
|
||||||
' be consciously classified here. A NEW coordinator field fails this until someone decides what it is —
|
' be consciously classified here. A NEW coordinator field fails this until someone decides what it is —
|
||||||
' a state axis needs transition coverage, a flag needs its consuming path tested.
|
' a state axis needs transition coverage, a flag needs its consuming path tested.
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
width="500"
|
width="500"
|
||||||
height="144"
|
height="144"
|
||||||
opacity="0.9"
|
opacity="0.9"
|
||||||
uri="pkg:/images/white.9.png">
|
uri="pkg:/images/white.$$RES$$.9.png">
|
||||||
|
|
||||||
<Poster
|
<Poster
|
||||||
id="thumbnailPoster"
|
id="thumbnailPoster"
|
||||||
|
|||||||
@@ -50,7 +50,7 @@
|
|||||||
numRows="6"
|
numRows="6"
|
||||||
vertFocusAnimationStyle="floatingFocus"
|
vertFocusAnimationStyle="floatingFocus"
|
||||||
translation="[20,90]"
|
translation="[20,90]"
|
||||||
focusBitmapUri="pkg:/images/focus-glow-padding-27.9.png" />
|
focusBitmapUri="pkg:/images/focus-glow-padding-42.$$RES$$.9.png" />
|
||||||
</Rectangle>
|
</Rectangle>
|
||||||
|
|
||||||
<Animation id="showAnimation"
|
<Animation id="showAnimation"
|
||||||
|
|||||||
@@ -36,7 +36,7 @@
|
|||||||
<Poster
|
<Poster
|
||||||
id="highlightPoster"
|
id="highlightPoster"
|
||||||
blendColor="0xFF1C30"
|
blendColor="0xFF1C30"
|
||||||
uri="pkg:/images/queue-highlight.9.png"
|
uri="pkg:/images/queue-highlight.$$RES$$.9.png"
|
||||||
width="164"
|
width="164"
|
||||||
height="94" />
|
height="94" />
|
||||||
<Label
|
<Label
|
||||||
|
|||||||
@@ -91,9 +91,6 @@ namespace Http
|
|||||||
instance = m.invidiousService.GetInstance()
|
instance = m.invidiousService.GetInstance()
|
||||||
|
|
||||||
contentNode = InvidiousContent.ToRowCellContentNode(payload, instance)
|
contentNode = InvidiousContent.ToRowCellContentNode(payload, instance)
|
||||||
if IsAssociativeArray(payload.metadata)
|
|
||||||
contentNode.addFields({ metadata: payload.metadata })
|
|
||||||
end if
|
|
||||||
|
|
||||||
nodeType = contentNode.type
|
nodeType = contentNode.type
|
||||||
|
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 873 B |
|
After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 7.3 KiB |
|
Before Width: | Height: | Size: 7.3 KiB |
|
After Width: | Height: | Size: 2.3 KiB |
|
After Width: | Height: | Size: 861 B |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 2.3 KiB |
|
After Width: | Height: | Size: 897 B |
|
After Width: | Height: | Size: 1.4 KiB |
@@ -1,4 +1,3 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
|
||||||
<!--! Font Awesome Pro 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc.-->
|
|
||||||
<path fill="#EBEBEB" d="M416 208c0 45.9-14.9 88.3-40 122.7l126.6 126.7c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376c-34.4 25.2-76.8 40-122.7 40C93.1 416 0 322.9 0 208S93.1 0 208 0s208 93.1 208 208M208 352c79.5 0 144-64.5 144-144S287.5 64 208 64 64 128.5 64 208s64.5 144 144 144"/>
|
<path fill="#EBEBEB" d="M416 208c0 45.9-14.9 88.3-40 122.7l126.6 126.7c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376c-34.4 25.2-76.8 40-122.7 40C93.1 416 0 322.9 0 208S93.1 0 208 0s208 93.1 208 208M208 352c79.5 0 144-64.5 144-144S287.5 64 208 64 64 128.5 64 208s64.5 144 144 144"/>
|
||||||
</svg>
|
</svg>
|
||||||
|
Before Width: | Height: | Size: 533 B After Width: | Height: | Size: 365 B |
|
Before Width: | Height: | Size: 292 B After Width: | Height: | Size: 292 B |
|
After Width: | Height: | Size: 518 B |
|
After Width: | Height: | Size: 665 B |
|
Before Width: | Height: | Size: 1017 B After Width: | Height: | Size: 1017 B |
|
After Width: | Height: | Size: 496 B |
|
After Width: | Height: | Size: 722 B |
|
Before Width: | Height: | Size: 985 B After Width: | Height: | Size: 985 B |
|
After Width: | Height: | Size: 488 B |
|
After Width: | Height: | Size: 721 B |
@@ -3,7 +3,7 @@ title=PlayletLib
|
|||||||
# Do not update version manually, it is auto updated from package.json
|
# Do not update version manually, it is auto updated from package.json
|
||||||
major_version=0
|
major_version=0
|
||||||
minor_version=48
|
minor_version=48
|
||||||
build_version=00002
|
build_version=00004
|
||||||
|
|
||||||
ui_resolutions=hd
|
ui_resolutions=hd
|
||||||
uri_resolution_autosub=$$RES$$,480p,720p,1080p
|
uri_resolution_autosub=$$RES$$,480p,720p,1080p
|
||||||
|
|||||||
@@ -1,4 +1,27 @@
|
|||||||
' Credits to https://github.com/kazuhikoarase/qrcode-generator/pull/110
|
' QR code generation ported from https://github.com/kazuhikoarase/qrcode-generator
|
||||||
|
' (PR #110).
|
||||||
|
'
|
||||||
|
' Original work: Copyright (c) 2009 Kazuhiko Arase - MIT License (full text below).
|
||||||
|
' Modifications: Copyright (c) Playlet contributors - AGPL-3.0, as part of this project.
|
||||||
|
'
|
||||||
|
' Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
' of this software and associated documentation files (the "Software"), to deal
|
||||||
|
' in the Software without restriction, including without limitation the rights
|
||||||
|
' to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
' copies of the Software, and to permit persons to whom the Software is
|
||||||
|
' furnished to do so, subject to the following conditions:
|
||||||
|
'
|
||||||
|
' The above copyright notice and this permission notice shall be included in all
|
||||||
|
' copies or substantial portions of the Software.
|
||||||
|
'
|
||||||
|
' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
' IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
' FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
' AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
' LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
' OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
' SOFTWARE.
|
||||||
|
'
|
||||||
' Main changes:
|
' Main changes:
|
||||||
' - Removed Kanji, because it added a significant amount of size, while the use
|
' - Removed Kanji, because it added a significant amount of size, while the use
|
||||||
' cases of this app does not include Kanji
|
' cases of this app does not include Kanji
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ namespace Tests
|
|||||||
msg = wait(1000, messagePort)
|
msg = wait(1000, messagePort)
|
||||||
|
|
||||||
if msg = invalid
|
if msg = invalid
|
||||||
m.testSuite.fail("Waiting for job messages timed out after 1000ms")
|
m.fail("Waiting for job messages timed out after 1000ms")
|
||||||
exit while
|
exit while
|
||||||
end if
|
end if
|
||||||
|
|
||||||
@@ -85,7 +85,7 @@ namespace Tests
|
|||||||
msg = wait(1000, messagePort)
|
msg = wait(1000, messagePort)
|
||||||
|
|
||||||
if msg = invalid
|
if msg = invalid
|
||||||
m.testSuite.fail("Waiting for job messages timed out after 1000ms")
|
m.fail("Waiting for job messages timed out after 1000ms")
|
||||||
exit while
|
exit while
|
||||||
end if
|
end if
|
||||||
|
|
||||||
@@ -95,7 +95,7 @@ namespace Tests
|
|||||||
if info.cancel and not info.success
|
if info.cancel and not info.success
|
||||||
cancelCalls += 1
|
cancelCalls += 1
|
||||||
else if info.success
|
else if info.success
|
||||||
m.testSuite.fail("Job should not have succeeded after cancellation")
|
m.fail("Job should not have succeeded after cancellation")
|
||||||
exit while
|
exit while
|
||||||
end if
|
end if
|
||||||
end if
|
end if
|
||||||
@@ -126,7 +126,7 @@ namespace Tests
|
|||||||
msg = wait(1000, messagePort)
|
msg = wait(1000, messagePort)
|
||||||
|
|
||||||
if msg = invalid
|
if msg = invalid
|
||||||
m.testSuite.fail("Waiting for job messages timed out after 1000ms")
|
m.fail("Waiting for job messages timed out after 1000ms")
|
||||||
exit while
|
exit while
|
||||||
end if
|
end if
|
||||||
|
|
||||||
@@ -136,7 +136,7 @@ namespace Tests
|
|||||||
if info.cancel and not info.success
|
if info.cancel and not info.success
|
||||||
cancelCalls += 1
|
cancelCalls += 1
|
||||||
else if info.success
|
else if info.success
|
||||||
m.testSuite.fail("Job should not have succeeded after cancellation")
|
m.fail("Job should not have succeeded after cancellation")
|
||||||
exit while
|
exit while
|
||||||
end if
|
end if
|
||||||
end if
|
end if
|
||||||
@@ -161,11 +161,11 @@ namespace Tests
|
|||||||
msg = wait(1000, messagePort)
|
msg = wait(1000, messagePort)
|
||||||
|
|
||||||
if msg = invalid
|
if msg = invalid
|
||||||
m.testSuite.fail("Waiting for job error message timed out after 1000ms")
|
m.fail("Waiting for job error message timed out after 1000ms")
|
||||||
end if
|
end if
|
||||||
|
|
||||||
if type(msg) <> "roSGNodeEvent" or msg.getField() <> "done"
|
if type(msg) <> "roSGNodeEvent" or msg.getField() <> "done"
|
||||||
m.testSuite.fail("Expected a done event for the job error")
|
m.fail("Expected a done event for the job error")
|
||||||
end if
|
end if
|
||||||
|
|
||||||
done = msg.getData()
|
done = msg.getData()
|
||||||
|
|||||||
@@ -471,7 +471,15 @@ namespace HttpClient
|
|||||||
backoffMs = 1000 + Rnd(2000)
|
backoffMs = 1000 + Rnd(2000)
|
||||||
tryNumber = m._tryCount - triesLeft + 1
|
tryNumber = m._tryCount - triesLeft + 1
|
||||||
LogWarnNoTelemetry("Request failed ID:", m.urlTransfer.GetIdentity(), "ErrorMessage:", response.ErrorMessage(), `\nRetrying: (`, tryNumber, "/", m._tryCount, ") in", backoffMs, "ms")
|
LogWarnNoTelemetry("Request failed ID:", m.urlTransfer.GetIdentity(), "ErrorMessage:", response.ErrorMessage(), `\nRetrying: (`, tryNumber, "/", m._tryCount, ") in", backoffMs, "ms")
|
||||||
LogWarnTelemetry(response.ErrorMessage() + `\n` + m.ToCurlCommand())
|
LogTelemetryEvent({
|
||||||
|
level: "warning"
|
||||||
|
message: response.ErrorMessage()
|
||||||
|
attachments: [{
|
||||||
|
filename: "request.txt"
|
||||||
|
content_type: "text/plain"
|
||||||
|
data: m.ToCurlCommand()
|
||||||
|
}]
|
||||||
|
})
|
||||||
|
|
||||||
if IsFunction(m._retryCallback)
|
if IsFunction(m._retryCallback)
|
||||||
try
|
try
|
||||||
|
|||||||
@@ -35,6 +35,12 @@ namespace Tests
|
|||||||
m.assertEqual(PlayerCoordinatorLogic.KeyToCommand(RemoteKeys.Ok), TransportController.Command.None)
|
m.assertEqual(PlayerCoordinatorLogic.KeyToCommand(RemoteKeys.Ok), TransportController.Command.None)
|
||||||
m.assertEqual(PlayerCoordinatorLogic.KeyToCommand(RemoteKeys.Back), TransportController.Command.None)
|
m.assertEqual(PlayerCoordinatorLogic.KeyToCommand(RemoteKeys.Back), TransportController.Command.None)
|
||||||
m.assertEqual(PlayerCoordinatorLogic.KeyToCommand(RemoteKeys.Down), TransportController.Command.None)
|
m.assertEqual(PlayerCoordinatorLogic.KeyToCommand(RemoteKeys.Down), TransportController.Command.None)
|
||||||
|
m.assertEqual(PlayerCoordinatorLogic.KeyToCommand(RemoteKeys.Up), TransportController.Command.None)
|
||||||
|
m.assertEqual(PlayerCoordinatorLogic.KeyToCommand(RemoteKeys.Options), TransportController.Command.None)
|
||||||
|
' the play cluster: play-state keys, and a transport command here would make them seek instead.
|
||||||
|
m.assertEqual(PlayerCoordinatorLogic.KeyToCommand(RemoteKeys.Play), TransportController.Command.None)
|
||||||
|
m.assertEqual(PlayerCoordinatorLogic.KeyToCommand(RemoteKeys.PlayOnly), TransportController.Command.None)
|
||||||
|
m.assertEqual(PlayerCoordinatorLogic.KeyToCommand(RemoteKeys.Pause), TransportController.Command.None)
|
||||||
m.assertEqual(PlayerCoordinatorLogic.KeyToCommand("bogus"), TransportController.Command.None)
|
m.assertEqual(PlayerCoordinatorLogic.KeyToCommand("bogus"), TransportController.Command.None)
|
||||||
end function
|
end function
|
||||||
|
|
||||||
|
|||||||
@@ -33,10 +33,6 @@ function LogTelemetryEvent(event as object)
|
|||||||
m.global.telemetry.LogEvent = event
|
m.global.telemetry.LogEvent = event
|
||||||
end function
|
end function
|
||||||
|
|
||||||
function LogWarnTelemetry(message as string)
|
|
||||||
m.global.telemetry.LogWarn = message
|
|
||||||
end function
|
|
||||||
|
|
||||||
function ToString(value as dynamic) as string
|
function ToString(value as dynamic) as string
|
||||||
if getInterface(value, "ifString") <> invalid
|
if getInterface(value, "ifString") <> invalid
|
||||||
return value
|
return value
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "playlet-web",
|
"name": "playlet-web",
|
||||||
"version": "0.48.2",
|
"version": "0.48.4",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
@@ -9,27 +9,27 @@
|
|||||||
"lint": "svelte-check --tsconfig ./tsconfig.json --fail-on-warnings"
|
"lint": "svelte-check --tsconfig ./tsconfig.json --fail-on-warnings"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@sveltejs/vite-plugin-svelte": "^7.2.0",
|
"@sveltejs/vite-plugin-svelte": "^7.3.0",
|
||||||
"@tailwindcss/postcss": "^4.3.2",
|
"@tailwindcss/postcss": "^4.3.3",
|
||||||
"@tailwindcss/typography": "^0.5.20",
|
"@tailwindcss/typography": "^0.5.20",
|
||||||
"@tsconfig/svelte": "^5.0.8",
|
"@tsconfig/svelte": "^5.0.8",
|
||||||
"@vitejs/plugin-legacy": "^8.2.0",
|
"@vitejs/plugin-legacy": "^8.2.3",
|
||||||
"autoprefixer": "^10.5.2",
|
"autoprefixer": "^10.5.5",
|
||||||
"bgutils-js": "^3.2.0",
|
"bgutils-js": "^4.0.3",
|
||||||
"daisyui": "^5.6.16",
|
"daisyui": "^5.7.28",
|
||||||
"dotenv": "^17.4.2",
|
"dotenv": "^17.4.2",
|
||||||
"ip": "^2.0.1",
|
"ip": "^2.0.1",
|
||||||
"jszip": "^3.10.1",
|
"jszip": "^3.10.1",
|
||||||
"postcss": "^8.5.16",
|
"postcss": "^8.5.28",
|
||||||
"rollup-plugin-visualizer": "^7.0.1",
|
"rollup-plugin-visualizer": "^7.1.1",
|
||||||
"svelte": "^5.56.4",
|
"svelte": "^5.57.0",
|
||||||
"svelte-check": "^4.7.2",
|
"svelte-check": "^4.7.6",
|
||||||
"svelte-preprocess": "6.0.3",
|
"svelte-preprocess": "^6.0.5",
|
||||||
"tailwindcss": "^4.3.2",
|
"tailwindcss": "^4.3.3",
|
||||||
"terser": "^5.49.0",
|
"terser": "^5.51.2",
|
||||||
"tslib": "^2.8.1",
|
"tslib": "^2.8.1",
|
||||||
"typescript": "^5.9.3",
|
"typescript": "^5.9.3",
|
||||||
"vite": "^8.1.4",
|
"vite": "^8.2.2",
|
||||||
"vite-plugin-compression": "^0.5.1"
|
"vite-plugin-compression": "^0.5.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,9 @@
|
|||||||
import { getHost } from "lib/Api/Host";
|
import { getHost } from "lib/Api/Host";
|
||||||
import { PlayletApi } from "lib/Api/PlayletApi";
|
import { PlayletApi } from "lib/Api/PlayletApi";
|
||||||
import { BG, buildURL, GOOG_API_KEY, type WebPoSignalOutput, type BgConfig } from "bgutils-js";
|
import { BotGuardClient, getChallenge } from "bgutils-js/botguard";
|
||||||
|
import { WebPoMinter } from "bgutils-js/webpo";
|
||||||
|
import { buildURL, getHeaders } from "bgutils-js/utils";
|
||||||
|
import type { WebPoSignalOutput } from "bgutils-js/shared-types";
|
||||||
|
|
||||||
// Fallback lifetime when GenerateIT reports no TTL.
|
// Fallback lifetime when GenerateIT reports no TTL.
|
||||||
const DEFAULT_POTOKEN_TTL_SECONDS = 60 * 60 * 6;
|
const DEFAULT_POTOKEN_TTL_SECONDS = 60 * 60 * 6;
|
||||||
@@ -23,7 +26,7 @@ interface DevicePoToken {
|
|||||||
|
|
||||||
// Mints a GVS poToken in the browser (BotGuard) and hands it to the Roku.
|
// Mints a GVS poToken in the browser (BotGuard) and hands it to the Roku.
|
||||||
export class PoTokenMinter {
|
export class PoTokenMinter {
|
||||||
static webPoMinter: BG.WebPoMinter;
|
static webPoMinter: WebPoMinter;
|
||||||
static webPoMinterPromise: Promise<void>;
|
static webPoMinterPromise: Promise<void>;
|
||||||
static integrityTokenExpiresAtMs = 0;
|
static integrityTokenExpiresAtMs = 0;
|
||||||
|
|
||||||
@@ -93,41 +96,30 @@ export class PoTokenMinter {
|
|||||||
try {
|
try {
|
||||||
const requestKey = 'O43z0dpjhgX20SCx4KAo';
|
const requestKey = 'O43z0dpjhgX20SCx4KAo';
|
||||||
|
|
||||||
const bgConfig: BgConfig = {
|
const bgChallenge = await getChallenge({
|
||||||
fetch: (input: string | URL | globalThis.Request, init?: RequestInit) => PoTokenMinter.fetch(input, init),
|
|
||||||
globalObj: globalThis,
|
|
||||||
requestKey,
|
requestKey,
|
||||||
identifier: ''
|
fetchFunction: PoTokenMinter.fetch
|
||||||
};
|
});
|
||||||
|
|
||||||
const bgChallenge = await BG.Challenge.create(bgConfig);
|
const interpreterJavascript = bgChallenge.interpreterJavascript?.privateDoNotAccessOrElseSafeScriptWrappedValue;
|
||||||
if (!bgChallenge) {
|
|
||||||
throw new Error('Could not get challenge');
|
|
||||||
}
|
|
||||||
|
|
||||||
const interpreterJavascript = bgChallenge.interpreterJavascript.privateDoNotAccessOrElseSafeScriptWrappedValue;
|
|
||||||
if (interpreterJavascript) {
|
if (interpreterJavascript) {
|
||||||
new Function(interpreterJavascript)();
|
new Function(interpreterJavascript)();
|
||||||
} else {
|
} else {
|
||||||
throw new Error('Could not load VM');
|
throw new Error('Could not load VM');
|
||||||
}
|
}
|
||||||
|
|
||||||
const botguard = await BG.BotGuardClient.create({
|
const botguard = await BotGuardClient.create({
|
||||||
globalName: bgChallenge.globalName,
|
globalName: bgChallenge.globalName,
|
||||||
globalObj: globalThis,
|
globalObject: globalThis,
|
||||||
program: bgChallenge.program
|
program: bgChallenge.program
|
||||||
});
|
});
|
||||||
|
|
||||||
const webPoSignalOutput: WebPoSignalOutput = [];
|
const webPoSignalOutput: WebPoSignalOutput = [];
|
||||||
const botguardResponse = await botguard.snapshot({ webPoSignalOutput });
|
const botguardResponse = await botguard.snapshot({ webPoSignalOutput });
|
||||||
|
|
||||||
const integrityTokenResponse = await bgConfig.fetch(buildURL('GenerateIT', true), {
|
const integrityTokenResponse = await PoTokenMinter.fetch(buildURL('GenerateIT', true), {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: getHeaders(),
|
||||||
'content-type': 'application/json+protobuf',
|
|
||||||
'x-goog-api-key': GOOG_API_KEY,
|
|
||||||
'x-user-agent': 'grpc-web-javascript/0.1'
|
|
||||||
},
|
|
||||||
body: JSON.stringify([requestKey, botguardResponse])
|
body: JSON.stringify([requestKey, botguardResponse])
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -142,7 +134,7 @@ export class PoTokenMinter {
|
|||||||
: DEFAULT_POTOKEN_TTL_SECONDS;
|
: DEFAULT_POTOKEN_TTL_SECONDS;
|
||||||
PoTokenMinter.integrityTokenExpiresAtMs = Date.now() + ttlSeconds * 1000;
|
PoTokenMinter.integrityTokenExpiresAtMs = Date.now() + ttlSeconds * 1000;
|
||||||
|
|
||||||
PoTokenMinter.webPoMinter = await BG.WebPoMinter.create({ integrityToken: response[0] }, webPoSignalOutput);
|
PoTokenMinter.webPoMinter = await WebPoMinter.create({ integrityToken: response[0] }, webPoSignalOutput);
|
||||||
PoTokenMinter.webPoMinterPromise = null;
|
PoTokenMinter.webPoMinterPromise = null;
|
||||||
resolve();
|
resolve();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
@@ -12,6 +12,17 @@
|
|||||||
let libUrlType;
|
let libUrlType;
|
||||||
let appId = "693751";
|
let appId = "693751";
|
||||||
|
|
||||||
|
// Kept in step with PlayletLibUrls.MIN_VERSION in playlet-app, which drops anything older at boot.
|
||||||
|
const MIN_LIB_VERSION = "0.11.0";
|
||||||
|
|
||||||
|
function isSupported(tag) {
|
||||||
|
const version = /^v(\d+\.\d+\.\d+)$/.exec(tag ?? "")?.[1];
|
||||||
|
return (
|
||||||
|
!version ||
|
||||||
|
version.localeCompare(MIN_LIB_VERSION, undefined, { numeric: true }) >= 0
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
onMount(async () => {
|
onMount(async () => {
|
||||||
releases = await fetchReleaseTags();
|
releases = await fetchReleaseTags();
|
||||||
setCurrentlyUsedRelease();
|
setCurrentlyUsedRelease();
|
||||||
@@ -62,17 +73,19 @@
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return releases.map((release) => {
|
return releases
|
||||||
return {
|
.filter((release) => isSupported(release.tag_name))
|
||||||
name: release.tag_name,
|
.map((release) => {
|
||||||
enabled:
|
return {
|
||||||
release.assets.filter(
|
name: release.tag_name,
|
||||||
(asset) =>
|
enabled:
|
||||||
asset.name === "playlet-lib.zip" ||
|
release.assets.filter(
|
||||||
asset.name === "playlet-lib.squashfs.pkg"
|
(asset) =>
|
||||||
).length > 0,
|
asset.name === "playlet-lib.zip" ||
|
||||||
};
|
asset.name === "playlet-lib.squashfs.pkg"
|
||||||
});
|
).length > 0,
|
||||||
|
};
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async function apply() {
|
async function apply() {
|
||||||
|
|||||||
@@ -34,23 +34,27 @@ This page was automatically generated on ${formattedDate}.
|
|||||||
fs.writeFileSync(markdownFile, markdownContent);
|
fs.writeFileSync(markdownFile, markdownContent);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function deleteExistingAttachments() {
|
function deleteExistingAttachments() {
|
||||||
try {
|
const files = fs.readdirSync(attachmentDestination);
|
||||||
const files = fs.readdirSync(attachmentDestination);
|
|
||||||
|
|
||||||
for (const file of files) {
|
for (const file of files) {
|
||||||
if (path.extname(file) === '.png') {
|
if (path.extname(file) === '.png') {
|
||||||
fs.unlinkSync(path.join(attachmentDestination, file));
|
fs.unlinkSync(path.join(attachmentDestination, file));
|
||||||
console.log(`Deleted ${file}`);
|
console.log(`Deleted ${file}`);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} catch (error) {
|
|
||||||
console.error(error);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const config = getEnvVars(['EMAIL', 'EMAIL_APP_PASSWORD']);
|
const config = getEnvVars(['EMAIL', 'EMAIL_APP_PASSWORD']);
|
||||||
|
|
||||||
|
// Gmail can take 15s or more to answer LOGIN, well past node-imap's 5s default,
|
||||||
|
// and throttles an account that reconnects right after a failed attempt.
|
||||||
|
const AUTH_TIMEOUT_MS = 60 * 1000;
|
||||||
|
const CONNECT_TIMEOUT_MS = 30 * 1000;
|
||||||
|
const CONNECT_ATTEMPTS = 3;
|
||||||
|
const RETRY_DELAY_MS = 30 * 1000;
|
||||||
|
const RUN_TIMEOUT_MS = 10 * 60 * 1000;
|
||||||
|
|
||||||
const imap = new Imap({
|
const imap = new Imap({
|
||||||
user: config.EMAIL,
|
user: config.EMAIL,
|
||||||
password: config.EMAIL_APP_PASSWORD,
|
password: config.EMAIL_APP_PASSWORD,
|
||||||
@@ -59,7 +63,9 @@ const imap = new Imap({
|
|||||||
tls: true,
|
tls: true,
|
||||||
tlsOptions: {
|
tlsOptions: {
|
||||||
rejectUnauthorized: false
|
rejectUnauthorized: false
|
||||||
}
|
},
|
||||||
|
connTimeout: CONNECT_TIMEOUT_MS,
|
||||||
|
authTimeout: AUTH_TIMEOUT_MS
|
||||||
});
|
});
|
||||||
|
|
||||||
const searchAsync = promisify(imap.search).bind(imap);
|
const searchAsync = promisify(imap.search).bind(imap);
|
||||||
@@ -129,59 +135,91 @@ async function moveToTrash(from, subject, since) {
|
|||||||
console.log('Moved %d message(s) to Trash for subject "%s"', uids.length, subject);
|
console.log('Moved %d message(s) to Trash for subject "%s"', uids.length, subject);
|
||||||
}
|
}
|
||||||
|
|
||||||
const timeout = setTimeout(() => {
|
function sleep(ms) {
|
||||||
console.log('Timeout');
|
return new Promise(resolve => setTimeout(resolve, ms));
|
||||||
|
}
|
||||||
|
|
||||||
|
function fail(error) {
|
||||||
|
console.error('Error:', error);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}, 10 * 60 * 1000);
|
}
|
||||||
|
|
||||||
imap.once('ready', async () => {
|
function connectAsync() {
|
||||||
try {
|
return new Promise((resolve, reject) => {
|
||||||
await openBoxAsync('INBOX');
|
const onReady = () => {
|
||||||
|
imap.removeListener('error', onError);
|
||||||
|
imap.on('error', fail);
|
||||||
|
resolve();
|
||||||
|
};
|
||||||
|
const onError = error => {
|
||||||
|
imap.removeListener('ready', onReady);
|
||||||
|
reject(error);
|
||||||
|
};
|
||||||
|
imap.once('ready', onReady);
|
||||||
|
imap.once('error', onError);
|
||||||
|
imap.connect();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
const now = new Date();
|
async function connectWithRetryAsync() {
|
||||||
const yesterday = new Date(now - 24 * 60 * 60 * 1000);
|
for (let attempt = 1; ; attempt++) {
|
||||||
const yesterdayString = yesterday.toISOString().slice(0, 19).replace('T', ' ');
|
try {
|
||||||
|
await connectAsync();
|
||||||
deleteExistingAttachments();
|
return;
|
||||||
|
} catch (error) {
|
||||||
const images = []
|
if (attempt === CONNECT_ATTEMPTS) {
|
||||||
images.push({
|
throw error;
|
||||||
title: 'App Health',
|
}
|
||||||
filename: await getAttachementAsync('bdp_noreply@data.roku.com', 'App Health', yesterdayString)
|
console.error('Connection attempt %d/%d failed: %s', attempt, CONNECT_ATTEMPTS, error.message);
|
||||||
})
|
await sleep(RETRY_DELAY_MS);
|
||||||
images.push({
|
}
|
||||||
title: 'App Engagement',
|
|
||||||
filename: await getAttachementAsync('bdp_noreply@data.roku.com', 'App Engagement', yesterdayString)
|
|
||||||
})
|
|
||||||
images.push({
|
|
||||||
title: 'Viewership Summary',
|
|
||||||
filename: await getAttachementAsync('bdp_noreply@data.roku.com', 'Viewership Summary', yesterdayString)
|
|
||||||
})
|
|
||||||
images.push({
|
|
||||||
title: 'App Stability',
|
|
||||||
filename: await getAttachementAsync('bdp_noreply@data.roku.com', 'App Stability', yesterdayString)
|
|
||||||
})
|
|
||||||
|
|
||||||
writeMarkDownFile(images);
|
|
||||||
|
|
||||||
await moveToTrash('bdp_noreply@data.roku.com', 'App Health', yesterdayString);
|
|
||||||
await moveToTrash('bdp_noreply@data.roku.com', 'App Engagement', yesterdayString);
|
|
||||||
await moveToTrash('bdp_noreply@data.roku.com', 'Viewership Summary', yesterdayString);
|
|
||||||
await moveToTrash('bdp_noreply@data.roku.com', 'App Stability', yesterdayString);
|
|
||||||
|
|
||||||
imap.end();
|
|
||||||
} catch (error) {
|
|
||||||
console.error('Error:', error);
|
|
||||||
}
|
}
|
||||||
clearTimeout(timeout);
|
}
|
||||||
});
|
|
||||||
|
|
||||||
imap.once('error', err => {
|
async function downloadStats() {
|
||||||
console.error(err);
|
await connectWithRetryAsync();
|
||||||
});
|
await openBoxAsync('INBOX');
|
||||||
|
|
||||||
imap.once('end', () => {
|
const now = new Date();
|
||||||
|
const yesterday = new Date(now - 24 * 60 * 60 * 1000);
|
||||||
|
const yesterdayString = yesterday.toISOString().slice(0, 19).replace('T', ' ');
|
||||||
|
|
||||||
|
deleteExistingAttachments();
|
||||||
|
|
||||||
|
const images = []
|
||||||
|
images.push({
|
||||||
|
title: 'App Health',
|
||||||
|
filename: await getAttachementAsync('bdp_noreply@data.roku.com', 'App Health', yesterdayString)
|
||||||
|
})
|
||||||
|
images.push({
|
||||||
|
title: 'App Engagement',
|
||||||
|
filename: await getAttachementAsync('bdp_noreply@data.roku.com', 'App Engagement', yesterdayString)
|
||||||
|
})
|
||||||
|
images.push({
|
||||||
|
title: 'Viewership Summary',
|
||||||
|
filename: await getAttachementAsync('bdp_noreply@data.roku.com', 'Viewership Summary', yesterdayString)
|
||||||
|
})
|
||||||
|
images.push({
|
||||||
|
title: 'App Stability',
|
||||||
|
filename: await getAttachementAsync('bdp_noreply@data.roku.com', 'App Stability', yesterdayString)
|
||||||
|
})
|
||||||
|
|
||||||
|
writeMarkDownFile(images);
|
||||||
|
|
||||||
|
await moveToTrash('bdp_noreply@data.roku.com', 'App Health', yesterdayString);
|
||||||
|
await moveToTrash('bdp_noreply@data.roku.com', 'App Engagement', yesterdayString);
|
||||||
|
await moveToTrash('bdp_noreply@data.roku.com', 'Viewership Summary', yesterdayString);
|
||||||
|
await moveToTrash('bdp_noreply@data.roku.com', 'App Stability', yesterdayString);
|
||||||
|
|
||||||
|
imap.end();
|
||||||
|
}
|
||||||
|
|
||||||
|
imap.on('end', () => {
|
||||||
console.log('Connection ended');
|
console.log('Connection ended');
|
||||||
});
|
});
|
||||||
|
|
||||||
imap.connect();
|
setTimeout(() => fail(new Error(`Gave up after ${RUN_TIMEOUT_MS / 1000}s`)), RUN_TIMEOUT_MS);
|
||||||
|
|
||||||
|
downloadStats().then(() => {
|
||||||
|
process.exit(0);
|
||||||
|
}).catch(fail);
|
||||||