Compare commits

...
16 Commits
65 changed files with 721 additions and 281 deletions

No files matched your search

+6
View File
@@ -8,4 +8,10 @@
"editor.formatOnSave": true,
"xml.format.maxLineWidth": 0,
"svelte.enable-ts-plugin": true,
"brightscript.projects": [
"playlet-app/bsconfig.json",
"playlet-app/bsconfig.tests.json",
"playlet-lib/bsconfig.json",
"playlet-lib/bsconfig.tests.json"
]
}
+24
View File
@@ -5,6 +5,30 @@ 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/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [0.47.1] - 2026-06-18
### Fixed
- Subtitles no longer stop displaying after shrinking the video to picture-in-picture and restoring it
- Fixed a video player crash that could occur near the end of a video
- Fixed a startup crash caused by corrupted saved-profiles data in the registry
- Fixed a crash that could occur when the video player failed to start playback
## [0.47.0] - 2026-06-18
### Added
- Support for 4K video
- Playlet already supported 4K videos. This adds a support check, and quality selectors in the settings, for the devices that support it.
- Not all 4k supporting devices - only with AV1 support (usually newer devices)
- Not all 4k videos are playable, only AV1 encoded videos
- SponsorBlock "Hook/Greetings" category
### Fixed
- Missing video durations in channel pages, when using Playlet backend
- Captions on some videos (from TV broadcasts) displaying vertically instead of horizontally
## [0.46.0] - 2026-06-12
### Added
+3 -1
View File
@@ -98,7 +98,9 @@
"../tools/bs-plugins/logger-plugin.ts",
"../tools/bs-plugins/web-server-plugin.ts",
"../tools/bs-plugins/locale-validation-plugin.ts",
"../tools/bs-plugins/proto-gen-plugin.ts"
"../tools/bs-plugins/proto-gen-plugin.ts",
// Must be last: fails the command if any plugin above failed to load
"../tools/bs-plugins/critical-exit-guard-plugin.ts"
],
"retainStagingDir": true,
"require": [
+3 -1
View File
@@ -28,7 +28,9 @@
"../tools/bs-plugins/logger-plugin.ts",
"../tools/bs-plugins/web-server-plugin.ts",
"../tools/bs-plugins/locale-validation-plugin.ts",
"../tools/bs-plugins/proto-gen-plugin.ts"
"../tools/bs-plugins/proto-gen-plugin.ts",
// Must be last: fails the command if any plugin above failed to load
"../tools/bs-plugins/critical-exit-guard-plugin.ts"
],
"rooibos": {
"logLevel": 2,
+1
View File
@@ -2,6 +2,7 @@
"globals": [],
"ignores": [
"**/roku_modules/**/*",
"**/components/rooibos/**/*",
"**/bslib.brs"
],
"rules": {
+44 -44
View File
@@ -1,22 +1,22 @@
{
"name": "playlet",
"version": "0.46.0",
"version": "0.47.1",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "playlet",
"version": "0.46.0",
"version": "0.47.1",
"hasInstallScript": true,
"devDependencies": {
"@rokucommunity/bslint": "^0.8.43",
"@rokucommunity/bslint": "^0.8.44",
"@types/crypto-js": "^4.2.2",
"@types/fs-extra": "^11.0.4",
"@types/node": "^25.9.2",
"@types/node": "^25.9.3",
"@types/xml2js": "^0.4.14",
"argparse": "^2.0.1",
"brighterscript": "0.72.4",
"brighterscript-formatter": "^1.7.26",
"brighterscript": "0.72.5",
"brighterscript-formatter": "^1.7.27",
"convert-svg-to-png": "^0.7.1",
"crypto-js": "^4.2.0",
"dotenv": "^17.4.2",
@@ -30,9 +30,9 @@
"puppeteer": "^25.1.0",
"roku-deploy": "^3.17.6",
"roku-test-automation": "^2.2.2",
"rooibos-roku": "5.16.3",
"rooibos-roku": "5.16.4",
"rounded-rect-9patch": "^1.1.2",
"semver": "^7.8.2",
"semver": "^7.8.4",
"shelljs": "^0.10.0",
"telnet-client": "^2.2.13",
"ts-node": "^10.9.2",
@@ -72,9 +72,9 @@
}
},
"node_modules/@babel/runtime": {
"version": "7.29.2",
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.29.2.tgz",
"integrity": "sha512-JiDShH45zKHWyGe4ZNVRrCjBz8Nh9TMmZG1kh4QTK8hCBTWBi8Da+i7s1fJw7/lYpM4ccepSNfqzZ/QvABBi5g==",
"version": "7.29.7",
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.29.7.tgz",
"integrity": "sha512-Nq8OhGWiZIZGV6hLHoyAKLLcJihP/xFeBMGJoUrxTX2psI8dCifzLhZISFb+VWS3wFMRDmCGw5R+dOySCqPLhw==",
"dev": true,
"license": "MIT",
"engines": {
@@ -290,9 +290,9 @@
"dev": true
},
"node_modules/@rokucommunity/bslint": {
"version": "0.8.43",
"resolved": "https://registry.npmjs.org/@rokucommunity/bslint/-/bslint-0.8.43.tgz",
"integrity": "sha512-B0XB+IPHr26Lci6Wn5iHSdOLTxnSNQKpWvGAM8NovMOPIVXoy/1UPicPu2Lvy6qkbtZQS0ZWZdGicCMubR+pjg==",
"version": "0.8.44",
"resolved": "https://registry.npmjs.org/@rokucommunity/bslint/-/bslint-0.8.44.tgz",
"integrity": "sha512-IGKlXT/4GIXirI9ssWGGxCMComRIYisrf8OjdvpyxrMke4hC8bMnPJUk8e1RbikFFLwQjiufidnbvApqTeq7mQ==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -323,9 +323,9 @@
}
},
"node_modules/@rokucommunity/logger": {
"version": "0.3.12",
"resolved": "https://registry.npmjs.org/@rokucommunity/logger/-/logger-0.3.12.tgz",
"integrity": "sha512-opavck0zTav3scRXth2VTvUU7a7VjEF/OYBF8J75PCPTTMf9TJpUL5rzNgvDGW3WnYPInmI1j6JS+EsCpbDDQA==",
"version": "0.3.13",
"resolved": "https://registry.npmjs.org/@rokucommunity/logger/-/logger-0.3.13.tgz",
"integrity": "sha512-lbpHoYn6HmWY7aXPyFebHh/9J6aBYCafTz6CFWz/ssrlqQgs9QLPqypna/Jdp7lABY+OvToYx5QfK2Y7Jll+DA==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -626,9 +626,9 @@
"license": "MIT"
},
"node_modules/@types/node": {
"version": "25.9.2",
"resolved": "https://registry.npmjs.org/@types/node/-/node-25.9.2.tgz",
"integrity": "sha512-G05zqtJhcDLb8uslf5EjCxXg9G1KQxiV8OS0R26IC//Eoyitzqe8z37I7cqvnZlrlSfgocQRfSn/AHBZJJFyGw==",
"version": "25.9.3",
"resolved": "https://registry.npmjs.org/@types/node/-/node-25.9.3.tgz",
"integrity": "sha512-603BddQMv3pUcr4U2dhujk83N2tTDVr/34wII2B6bJy6g+8WD6yUb11jszNs0gdi4PesVWl7ABt8nYMVpnLUcg==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -1198,14 +1198,14 @@
}
},
"node_modules/brighterscript": {
"version": "0.72.4",
"resolved": "https://registry.npmjs.org/brighterscript/-/brighterscript-0.72.4.tgz",
"integrity": "sha512-WFim0n9pUgFZorZ81eIy2jF09XsFNxlLtllXYkH7d36Pq/3AH6M31YfIHkKSDltnXwrnCCjGXa+m0Jw3NnQIeQ==",
"version": "0.72.5",
"resolved": "https://registry.npmjs.org/brighterscript/-/brighterscript-0.72.5.tgz",
"integrity": "sha512-Wod6+FuAqzus4A9JcXyl5+h1n2D7A4sSgfRP3wqSZdnv2xogQYBoY4E1IaXPTSjWomsmdhblv8PmySkm4M0A+g==",
"dev": true,
"license": "MIT",
"dependencies": {
"@rokucommunity/bslib": "^0.1.1",
"@rokucommunity/logger": "^0.3.12",
"@rokucommunity/logger": "^0.3.13",
"@xml-tools/parser": "^1.0.7",
"array-flat-polyfill": "^1.0.1",
"chalk": "^2.4.2",
@@ -1230,7 +1230,7 @@
"parse-ms": "^2.1.0",
"readline": "^1.3.0",
"require-relative": "^0.8.7",
"roku-deploy": "^3.17.5",
"roku-deploy": "^3.17.6",
"safe-json-stringify": "^1.2.0",
"semver": "^7.7.3",
"serialize-error": "^7.0.1",
@@ -1250,13 +1250,13 @@
}
},
"node_modules/brighterscript-formatter": {
"version": "1.7.26",
"resolved": "https://registry.npmjs.org/brighterscript-formatter/-/brighterscript-formatter-1.7.26.tgz",
"integrity": "sha512-hXu1tqzOvjgVy84NvS0rAhyIAOKp5Yvp32If73BuwWXjIt6NC0NeQSgmm5libgPcSOcDhpBuPXmcH+huA8Xmow==",
"version": "1.7.27",
"resolved": "https://registry.npmjs.org/brighterscript-formatter/-/brighterscript-formatter-1.7.27.tgz",
"integrity": "sha512-OLM98hMXIsHMR6vWvmwq9x8K8qyMZj6h3UscKns6TLSHKD28rpRwC0FciEMhPmxCeHei8w2bK++BbLUDAYzsmQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"brighterscript": "^0.72.2",
"brighterscript": "^0.72.5",
"glob-all": "^3.3.0",
"jsonc-parser": "^3.0.0",
"source-map": "0.7.4",
@@ -5662,17 +5662,17 @@
}
},
"node_modules/roku-debug": {
"version": "0.23.8",
"resolved": "https://registry.npmjs.org/roku-debug/-/roku-debug-0.23.8.tgz",
"integrity": "sha512-XiTT6a8yCbU+aTMuuVMdhbj+OTQLJ/dxfyxavLQTrFfiDTU75KwQRJ9DA6juf7VS1PARdPFljhEhzGfBDFhJ+g==",
"version": "0.23.13",
"resolved": "https://registry.npmjs.org/roku-debug/-/roku-debug-0.23.13.tgz",
"integrity": "sha512-J9cxuEvuVRtGhke+x54icpFt1VE2FIJMvPJ3VSR8CJJmAVXIe78mJ0QuV+GguV/D4q6apLeCoTjdaY4F/3MO9g==",
"dev": true,
"license": "MIT",
"dependencies": {
"@rokucommunity/logger": "^0.3.12",
"@rokucommunity/logger": "^0.3.13",
"@types/request": "^2.48.8",
"@vscode/debugadapter": "^1.68.0",
"@vscode/debugprotocol": "^1.68.0",
"brighterscript": "^0.72.2",
"brighterscript": "^0.72.5",
"dateformat": "^4.6.3",
"debounce": "^1.2.1",
"eol": "^0.9.1",
@@ -5686,7 +5686,7 @@
"postman-request": "^2.88.1-postman.48",
"replace-in-file": "^6.3.2",
"replace-last": "^1.2.6",
"roku-deploy": "^3.17.4",
"roku-deploy": "^3.17.6",
"semver": "^7.5.4",
"serialize-error": "^8.1.0",
"smart-buffer": "^4.2.0",
@@ -6000,18 +6000,18 @@
"license": "MIT"
},
"node_modules/rooibos-roku": {
"version": "5.16.3",
"resolved": "https://registry.npmjs.org/rooibos-roku/-/rooibos-roku-5.16.3.tgz",
"integrity": "sha512-dI7hV+OdpC9VtH82+EQY8rOfzQrD7N73ntMjsKmGjqV9O5DRpapB0E0VAJqaUaqeJ3bR7TmAY7LKKEO/QVLpqQ==",
"version": "5.16.4",
"resolved": "https://registry.npmjs.org/rooibos-roku/-/rooibos-roku-5.16.4.tgz",
"integrity": "sha512-XpK+RXxrKpjBdFJa42VfIDuPKfi5G1RqLPl/slvOfLhD7zUjS0xov3bTu00fa0Mzb+jb3FUJ/wkt1vxljNZaDQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"brighterscript": "^0.72.2",
"brighterscript": "^0.72.5",
"fast-glob": "^3.2.12",
"fs-extra": "^10.1.0",
"minimatch": "^3.0.4",
"roku-debug": "^0.23.8",
"roku-deploy": "^3.17.4",
"roku-debug": "^0.23.11",
"roku-deploy": "^3.17.6",
"rooibos_promises": "npm:@rokucommunity/promises@^0.5.0",
"source-map": "^0.7.3",
"undent": "^1.0.1",
@@ -6190,9 +6190,9 @@
}
},
"node_modules/semver": {
"version": "7.8.2",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.8.2.tgz",
"integrity": "sha512-c8jsqUZm3omBOI66G90z1Dyw5z622G8oLG+omfsHBJf3CWQTlOcwOjvOG6wtiNfW6anKm/eA39LMwMtMez2TiQ==",
"version": "7.8.4",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.8.4.tgz",
"integrity": "sha512-rUCObTnP32Q08R2uuIrt7r9PlEonuTmtuXYcW6s5kjdlj3xbnwe+21yXptAUYcMAABLkYYTtnmzb3w3EDZfueA==",
"dev": true,
"license": "ISC",
"bin": {
+11 -7
View File
@@ -1,16 +1,16 @@
{
"name": "playlet",
"version": "0.46.0",
"version": "0.47.1",
"description": "Unofficial YouTube client for Roku",
"devDependencies": {
"@rokucommunity/bslint": "^0.8.43",
"@rokucommunity/bslint": "^0.8.44",
"@types/crypto-js": "^4.2.2",
"@types/fs-extra": "^11.0.4",
"@types/node": "^25.9.2",
"@types/node": "^25.9.3",
"@types/xml2js": "^0.4.14",
"argparse": "^2.0.1",
"brighterscript": "0.72.4",
"brighterscript-formatter": "^1.7.26",
"brighterscript": "0.72.5",
"brighterscript-formatter": "^1.7.27",
"convert-svg-to-png": "^0.7.1",
"crypto-js": "^4.2.0",
"dotenv": "^17.4.2",
@@ -24,9 +24,9 @@
"puppeteer": "^25.1.0",
"roku-deploy": "^3.17.6",
"roku-test-automation": "^2.2.2",
"rooibos-roku": "5.16.3",
"rooibos-roku": "5.16.4",
"rounded-rect-9patch": "^1.1.2",
"semver": "^7.8.2",
"semver": "^7.8.4",
"shelljs": "^0.10.0",
"telnet-client": "^2.2.13",
"ts-node": "^10.9.2",
@@ -42,6 +42,7 @@
"dev:web": "cd playlet-web && npm run dev",
"prebuild": "node tools/rm.js dist",
"build:dev": "npm run prebuild && npm run build:web && npm run build:lib:dev && npm run build:app:dev",
"build:dev:v2": "PLAYLET_DEVTOOLS=1 npm run build:dev",
"build:prod": "npm run prebuild && npm run build:web && npm run build:lib:prod && npm run build:app:prod",
"build:release": "npm run prebuild && npm run format:fix && npm run lint:fix && npm run version-sync && npm run manifest-git-hash && npm run build:prod",
"build:app:dev": "cd playlet-app && npm run build:dev",
@@ -55,6 +56,9 @@
"format": "cd playlet-lib && npm run format && cd ../playlet-app && npm run format",
"format:fix": "cd playlet-lib && npm run format:fix && cd ../playlet-app && npm run format:fix",
"test": "npm run test:lib && npm run test:app",
"test:v2": "npm run test:v2:lib && npm run test:v2:app",
"test:v2:lib": "cd playlet-lib && npm run test:v2",
"test:v2:app": "cd playlet-app && npm run test:v2",
"test:build": "npm run test:build:lib && npm run test:build:app",
"test:app": "cd playlet-app && npm run test",
"test:build:app": "cd playlet-app && npm run test:build",
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "playlet-app",
"version": "0.46.0",
"version": "0.47.1",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "playlet-app",
"version": "0.46.0"
"version": "0.47.1"
}
}
}
+5 -2
View File
@@ -1,6 +1,6 @@
{
"name": "playlet-app",
"version": "0.46.0",
"version": "0.47.1",
"description": "Unofficial YouTube client for Roku",
"scripts": {
"prebuild": "node ../tools/rm.js ../build/playlet-app",
@@ -18,6 +18,9 @@
"format:fix": "npm run format:base -- --write",
"test": "npm run test:build && npm run test:run",
"test:build": "bsc --project bsconfig.tests.json --create-package --sourceMap=true --debug --test-mode --lintConfig ../config/bslint.jsonc",
"test:run": "node ../tools/run-test-app.js --package ../build/playlet-app-tests.zip"
"test:run": "node ../tools/run-test-app.js --package ../build/playlet-app-tests.zip",
"test:v2": "npm run test:build && npm run test:run:v2",
"pretest:run:v2": "../../../dev-tools/bin/ensure-service.sh",
"test:run:v2": "../../../dev-tools/bin/test-app.sh --package ../build/playlet-app-tests.zip --output ../build/playlet-app-tests.txt"
}
}
+2 -2
View File
@@ -2,8 +2,8 @@ title=Playlet
# Do not update version manually, it is auto updated from package.json
major_version=0
minor_version=46
build_version=00000
minor_version=47
build_version=00001
ui_resolutions=hd
uri_resolution_autosub=$$RES$$,480p,720p,1080p
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "playlet-lib",
"version": "0.46.0",
"version": "0.47.1",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "playlet-lib",
"version": "0.46.0"
"version": "0.47.1"
}
}
}
+5 -2
View File
@@ -1,6 +1,6 @@
{
"name": "playlet-lib",
"version": "0.46.0",
"version": "0.47.1",
"description": "Unofficial YouTube client for Roku",
"scripts": {
"prebuild": "node ../tools/rm.js ../build/playlet-lib",
@@ -20,6 +20,9 @@
"format:fix": "npm run format:base -- --write",
"test": "npm run test:build && npm run test:run",
"test:build": "bsc --project bsconfig.tests.json --create-package --sourceMap=true --debug --test-mode --lintConfig ../config/bslint.jsonc",
"test:run": "node ../tools/run-test-app.js --package ../build/playlet-lib-tests.zip"
"test:run": "node ../tools/run-test-app.js --package ../build/playlet-lib-tests.zip",
"test:v2": "npm run test:build && npm run test:run:v2",
"pretest:run:v2": "../../../dev-tools/bin/ensure-service.sh",
"test:run:v2": "../../../dev-tools/bin/test-app.sh --package ../build/playlet-lib-tests.zip --output ../build/playlet-lib-tests.txt"
}
}
@@ -1,5 +1,6 @@
import "pkg:/components/Navigation/Navigation.bs"
import "pkg:/components/parts/AutoBind/OnNodeReadyNoOp.bs"
import "pkg:/source/utils/CodecCapabilities.bs"
import "pkg:/source/utils/Logging.bs"
import "pkg:/source/utils/MathUtils.bs"
import "pkg:/source/utils/RemoteKeys.bs"
@@ -19,12 +20,48 @@ function Init()
m.saveButton.observeField("buttonSelected", FuncName(OnSaveButtonSelected))
m.closeButton.observeField("buttonSelected", FuncName(Close))
m.lastCheckedState = [false, false, false, false, false, false, false]
AddHighQualityOptions()
m.lastCheckedState = NewCheckedState(false, false)
m.checkList.observeField("checkedState", FuncName(OnCheckedStateChange))
SetButtonPositions()
end function
' 1440p/2160p exist on YouTube only as AV1 (mp4) and VP9 (webm) streams, and the
' player only plays fragmented MP4 in DASH, so the options only work with an AV1 decoder.
function AddHighQualityOptions() as void
if not CodecCapabilities.CanDecodeAv1()
return
end if
content = m.checkList.content
for each quality in ["1440p", "2160p"]
node = CreateObject("roSGNode", "ContentNode")
node.id = quality
node.title = quality
content.insertChild(node, 1)
end for
end function
function NewCheckedState(autoChecked as boolean, othersChecked as boolean) as object
checkedState = [autoChecked]
count = m.checkList.content.getChildCount()
for i = 1 to count - 1
checkedState.push(othersChecked)
end for
return checkedState
end function
function AllQualitiesValue() as string
values = []
checkboxes = m.checkList.content.getChildren(-1, 0)
for i = 1 to checkboxes.Count() - 1
values.push(checkboxes[i].id)
end for
return values.Join(",")
end function
function SetButtonPositions()
saveButtonWidth = m.saveButton.width
closeButtonWidth = m.closeButton.width
@@ -99,16 +136,16 @@ function OnCheckedStateChange() as void
if autoChanged
if hasAuto
checkedState = [true, false, false, false, false, false, false]
checkedState = NewCheckedState(true, false)
m.lastCheckedState = checkedState
m.checkList.checkedState = checkedState
m.top.value = "auto"
return
else
checkedState = [false, true, true, true, true, true, true]
checkedState = NewCheckedState(false, true)
m.lastCheckedState = checkedState
m.checkList.checkedState = checkedState
m.top.value = "1080p,720p,480p,360p,240p,144p"
m.top.value = AllQualitiesValue()
return
end if
end if
@@ -128,7 +165,7 @@ function OnCheckedStateChange() as void
end for
if values.Count() = 0
checkedState = [true, false, false, false, false, false, false]
checkedState = NewCheckedState(true, false)
m.lastCheckedState = checkedState
m.checkList.checkedState = checkedState
m.top.value = "auto"
@@ -13,8 +13,8 @@
</Rectangle>
<Rectangle
width="780"
height="600"
translation="[250,60]"
height="640"
translation="[250,40]"
color="#242424">
<CheckList
id="checkList"
@@ -43,13 +43,13 @@
iconVisible="false"
text="Save"
padding="[30,30]"
translation="[340,500]" />
translation="[340,555]" />
<ButtonEx
id="closeButton"
iconVisible="false"
text="Close"
padding="[30,30]"
translation="[496,500]" />
translation="[496,555]" />
</Rectangle>
</children>
</component>
@@ -32,7 +32,7 @@
numColumns="1"
numRows="10"
vertFocusAnimationStyle="floatingFocus"
translation="[40,100]"
translation="[40,90]"
focusBitmapUri="pkg:/images/focus-glow-padding-19.9.png" />
<ButtonEx
@@ -40,13 +40,13 @@
iconVisible="false"
text="Save"
padding="[30,30]"
translation="[340,500]" />
translation="[340,520]" />
<ButtonEx
id="closeButton"
iconVisible="false"
text="Close"
padding="[30,30]"
translation="[496,500]" />
translation="[496,520]" />
</Rectangle>
</children>
</component>
@@ -1,5 +1,6 @@
import "pkg:/components/Web/WebServer/Http/HttpUtils.bs"
import "pkg:/source/services/XmlObject.bs"
import "pkg:/source/utils/CodecCapabilities.bs"
import "pkg:/source/utils/Logging.bs"
import "pkg:/source/utils/StringUtils.bs"
import "pkg:/source/utils/UrlUtils.bs"
@@ -14,6 +15,7 @@ class DashManifest
' Backend the metadata came from, echoed onto every live-seg URL so the
' DashRouter cache keys on it without reading the prefs node. Set by DashRouter.
public liveBackend as string = ""
private canDecodeAv1Cache as dynamic
function new(invidiousInstance as string, disableAutoDubbed = false as boolean)
m.invidiousInstance = invidiousInstance
@@ -64,8 +66,11 @@ class DashManifest
videoGroups = groupings.video
filteredVideoGroups = m.FilterVideoGroups(videoGroups, qualityFilter)
if filteredVideoGroups.Count() = 0 and videoGroups.Count() > 0
LogWarnNoTelemetry("No video streams found using quality filter:", qualityFilter, "Falling back to all video streams")
' The player skips video sets it can't play (webm container, undecodable codec).
' A filter that leaves only such sets - e.g. 2160p-only when the 4K streams are
' VP9/webm - would play audio with no video, so fall back to all streams.
if not m.HasPlayableVideoGroup(filteredVideoGroups) and videoGroups.Count() > 0
LogWarnNoTelemetry("No playable video streams using quality filter:", qualityFilter, "Falling back to all video streams")
filteredVideoGroups = videoGroups
end if
@@ -331,6 +336,30 @@ class DashManifest
return filteredGroups
end function
function HasPlayableVideoGroup(videoGroups as object) as boolean
for each group in videoGroups
mimeType = ValidString(group[0].type)
' DASH chunks must be fragmented MP4: the player never picks webm sets.
if not mimeType.startsWith("video/mp4")
continue for
end if
if mimeType.inStr("avc1") <> -1
return true
end if
if mimeType.inStr("av01") <> -1 and m.CanDecodeAv1()
return true
end if
end for
return false
end function
function CanDecodeAv1() as boolean
if m.canDecodeAv1Cache = invalid
m.canDecodeAv1Cache = CodecCapabilities.CanDecodeAv1()
end if
return m.canDecodeAv1Cache
end function
function IsVideoFormatIncluded(stream as object, qualityFilter as object) as boolean
if qualityFilter.Count() = 0
return true
@@ -11,13 +11,13 @@ const INNERTUBE_IOS_USER_AGENT = "com.google.ios.youtube/21.16.2 (iPhone16,2; U;
const INNERTUBE_WEB_BROWSER_NAME = "Chrome"
const INNERTUBE_WEB_BROWSER_VERSION = "147.0.0.0"
const INNERTUBE_WEB_CLIENT_NAME = "1"
const INNERTUBE_WEB_CLIENT_VERSION = "2.20260424.01.00"
const INNERTUBE_WEB_CLIENT_VERSION = "2.20260612.01.00"
const INNERTUBE_WEB_USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36"
const INNERTUBE_TV_BROWSER_NAME = "SamsungBrowser"
const INNERTUBE_TV_BROWSER_VERSION = "9.2"
const INNERTUBE_TV_CLIENT_NAME = "2"
const INNERTUBE_TV_CLIENT_VERSION = "7.20260422.12.00"
const INNERTUBE_TV_CLIENT_VERSION = "7.20260611.00.00"
const INNERTUBE_TV_DEVICE_MAKE = "Samsung"
const INNERTUBE_TV_DEVICE_MODEL = "SmartTV"
const INNERTUBE_TV_OS_NAME = "Tizen"
@@ -1103,6 +1103,32 @@ namespace Innertube
return invalid
end function
' The badge overlay has two shapes: thumbnailOverlayBadgeViewModel.thumbnailBadges (older, still
' used on playlist/podcast/album lockups) and thumbnailBottomOverlayViewModel.badges (video lockups)
function GetThumbnailBadgeText(thumbnailViewModel as object) as string
overlays = ObjectUtils.Dig(thumbnailViewModel, ["overlays"])
if not IsArray(overlays)
return ""
end if
for each overlay in overlays
badges = ObjectUtils.Dig(overlay, ["thumbnailBottomOverlayViewModel", "badges"])
if not IsArray(badges)
badges = ObjectUtils.Dig(overlay, ["thumbnailOverlayBadgeViewModel", "thumbnailBadges"])
end if
if IsArray(badges)
for each badge in badges
text = ValidString(ObjectUtils.Dig(badge, ["thumbnailBadgeViewModel", "text"]))
if text <> ""
return text
end if
end for
end if
end for
return ""
end function
function LockupViewModelTypeVideo(nodeData as object, context as object) as object
videoId = nodeData["contentId"]
if not IsString(videoId)
@@ -1124,7 +1150,7 @@ namespace Innertube
end if
end if
lengthText = ValidString(ObjectUtils.Dig(thumbnailViewModel, ["overlays", 0, "thumbnailOverlayBadgeViewModel", "thumbnailBadges", 0, "thumbnailBadgeViewModel", "text"]))
lengthText = GetThumbnailBadgeText(thumbnailViewModel)
authorId = ObjectUtils.Dig(metadata, ["image", "decoratedAvatarViewModel", "rendererContext", "commandContext", "onTap", "innertubeCommand", "browseEndpoint", "browseId"])
@@ -1155,7 +1181,7 @@ namespace Innertube
"authorId": authorId
"lines": lines
"videoThumbnails": videoThumbnails
"videoCountText": lengthText
"lengthText": lengthText
}
PushFeedItem(video, context)
@@ -1234,7 +1260,7 @@ namespace Innertube
title = ObjectUtils.Dig(metadata, ["title", "content"])
thumbnailViewModel = ObjectUtils.Dig(nodeData, ["contentImage", "collectionThumbnailViewModel", "primaryThumbnail", "thumbnailViewModel"])
thumbnail = ObjectUtils.Dig(thumbnailViewModel, ["image", "sources", 0, "url"])
videoCountText = ObjectUtils.Dig(thumbnailViewModel, ["overlays", 0, "thumbnailOverlayBadgeViewModel", "thumbnailBadges", 0, "thumbnailBadgeViewModel", "text"])
videoCountText = GetThumbnailBadgeText(thumbnailViewModel)
author = invalid
authorId = invalid
@@ -1283,7 +1309,7 @@ namespace Innertube
title = ObjectUtils.Dig(metadata, ["title", "content"])
thumbnailViewModel = ObjectUtils.Dig(nodeData, ["contentImage", "collectionThumbnailViewModel", "primaryThumbnail", "thumbnailViewModel"])
thumbnail = ObjectUtils.Dig(thumbnailViewModel, ["image", "sources", 0, "url"])
videoCountText = ObjectUtils.Dig(thumbnailViewModel, ["overlays", 0, "thumbnailOverlayBadgeViewModel", "thumbnailBadges", 0, "thumbnailBadgeViewModel", "text"])
videoCountText = GetThumbnailBadgeText(thumbnailViewModel)
author = invalid
authorId = invalid
@@ -1318,7 +1344,7 @@ namespace Innertube
title = ObjectUtils.Dig(metadata, ["title", "content"])
thumbnailViewModel = ObjectUtils.Dig(nodeData, ["contentImage", "collectionThumbnailViewModel", "primaryThumbnail", "thumbnailViewModel"])
thumbnail = ObjectUtils.Dig(thumbnailViewModel, ["image", "sources", 0, "url"])
videoCountText = ObjectUtils.Dig(thumbnailViewModel, ["overlays", 0, "thumbnailOverlayBadgeViewModel", "thumbnailBadges", 0, "thumbnailBadgeViewModel", "text"])
videoCountText = GetThumbnailBadgeText(thumbnailViewModel)
author = invalid
authorId = invalid
@@ -336,7 +336,15 @@ namespace Innertube
' vtt has "align:start position:0%" on auto-generated captions
' srt has large spacing between lines on auto-generated captions
' ttml has default styling, with smaller font than the default size
queryComponents["fmt"] = "ttml"
' CEA-608 broadcast channels (CC1-CC4) encode their paint-on reveal as
' per-segment timed spans; Roku's ttml renderer stacks each span on its own
' line (vertical text). vtt expresses the same timing inline, so it wraps.
captionName = queryComponents["name"]
if captionName = "CC1" or captionName = "CC2" or captionName = "CC3" or captionName = "CC4"
queryComponents["fmt"] = "vtt"
else
queryComponents["fmt"] = "ttml"
end if
baseUrl = UrlUtils.SetQueryParams(baseUrl, queryComponents)
languageCode = track["languageCode"]
@@ -1,5 +1,5 @@
' Auto-generated file - do not modify manually
' md5:1dc03998a561a4b1270454e10a4d7ead
' md5:6966cee321cfa827e09c0f49b10a3fa8
import "pkg:/source/Protobuf/BinaryReader.bs"
import "pkg:/source/Protobuf/BinaryWriter.bs"
@@ -178,6 +178,16 @@ function MigrateExistingPreferences(userPrefs as object) as boolean
isDirty = true
end if
if userPrefs.__version = 6
' Hook was split out of Preview. Existing users inherit their Preview setting.
categories = userPrefs["sponsorblock.categories"]
if IsAssociativeArray(categories) and not categories.DoesExist("hook") and IsAssociativeArray(categories["preview"])
categories["hook"] = { option: categories["preview"].option }
end if
userPrefs.__version = 7
isDirty = true
end if
' TODO:P2 handle case where saved preferences version is higher than current version (e.g. user downgraded)
#if DEBUG
@@ -5,7 +5,7 @@
user prefs saved need to be migrated. If the version is less than the
current version, a migration is needed.
-->
<field id="__version" type="integer" value="6" />
<field id="__version" type="integer" value="7" />
<field id="prefsModel" type="array" />
<field id="preferenceFields" type="assocarray" />
<function name="GetUserPreferences" />
@@ -24,14 +24,18 @@ function LoadProfilesFromRegistry()
' Step 1: Load user profiles from registry
userProfiles = RegistryUtils.Read(RegistryUtils.USER_PROFILES)
if userProfiles <> invalid
userProfiles = StringUtils.ParseJsonSafe(userProfiles)
if userProfiles = invalid
LogError("user_profiles registry value is corrupt (unparseable); resetting to empty")
end if
end if
if userProfiles = invalid
userProfiles = {
profiles: []
currentProfile: invalid
}
else
userProfiles = StringUtils.ParseJsonSafe(userProfiles)
end if
' Step 2: Migrate existing profiles to new format (if needed)
@@ -92,7 +92,7 @@ end function
function GetOptionForSegment(segment as object, categories as object) as string
category = categories[segment.category]
if not IsAssociativeArray(category)
return false
return SponsorBlock.SegmentAction.Disable
end if
option = category.option
@@ -74,8 +74,8 @@ namespace SponsorBlock
return invalid
end if
' categories = ["sponsor", "selfpromo", "interaction", "intro", "outro", "preview", "music_offtopic", "poi_highlight", "filler", "exclusive_access"]
categories = ["sponsor", "selfpromo", "interaction", "intro", "outro", "preview", "music_offtopic", "poi_highlight", "filler"]
' categories = ["sponsor", "selfpromo", "interaction", "intro", "outro", "preview", "hook", "music_offtopic", "poi_highlight", "filler", "exclusive_access"]
categories = ["sponsor", "selfpromo", "interaction", "intro", "outro", "preview", "hook", "music_offtopic", "poi_highlight", "filler"]
' actionTypes = ["skip", "mute", "chapter", "full", "poi"]
actionTypes = ["skip", "mute", "poi"]
@@ -69,6 +69,19 @@ namespace Tests
m.assertEqual(anim.control, "start")
end function
@it("a nudge with an out-of-range focusedIndex is a safe no-op")
function _()
m.top.rowFocused = true
m.top.focusedIndex = 5
playAnim = m.top.findNode("PlayPauseButton").findNode("nudgeAnim")
minimizeAnim = m.top.findNode("MinimizeButton").findNode("nudgeAnim")
playAnim.control = "stop"
minimizeAnim.control = "stop"
m.top.nudge = true
m.assertEqual(playAnim.control, "stop")
m.assertEqual(minimizeAnim.control, "stop")
end function
@describe("play/pause icon tracks the play state")
@it("shows the pause icon while playing, the play icon while paused")
@@ -18,7 +18,8 @@
<field id="focusedIndex" type="integer" value="0" />
<field id="playing" type="boolean" value="true" /> <!-- selects the play vs pause icon -->
<field id="buttonCount" type="integer" value="0" /> <!-- read-only: set in Init from m.buttons -->
<!-- pulse the focused button's scale nudge (a Left/Right that couldn't move focus). -->
<!-- pulse the focused button's scale nudge (a press that couldn't move focus: Left/Right clamped at
the row's ends, Up at the top tier). -->
<field id="nudge" type="boolean" alwaysNotify="true" />
</interface>
<children>
@@ -2,6 +2,7 @@
' INPUT fields, and asserts the rendered child fields: fill clip width, playhead translation, M:SS labels,
' the raised handle while a transport is active, the glyph swap, and the live layout (Rewind live TV / offset
' / ● LIVE swap). clippingRect reads back as {x,y,width,height} on the render thread.
import "pkg:/source/utils/Locale.bs"
namespace Tests
@@ -198,7 +199,7 @@ namespace Tests
m.assertEqual(m.top.findNode("remainingLabel").text, "")
' the badge styling: red bullet + bold size-30 LIVE. blendColor reads back as a signed 32-bit int.
m.AssertBlend(m.top.findNode("bullet").blendColor, &hD53E5AFF)
m.assertEqual(m.top.findNode("liveLabel").text, Tr("LIVE"))
m.assertEqual(m.top.findNode("liveLabel").text, Tr(Locale.RowCell.Live))
' the badge is right-aligned to the track end whatever the language ("EN DIRECT" >> "LIVE").
lbl = m.top.findNode("liveLabel")
m.assertTrue(Abs((lbl.translation[0] + lbl.boundingRect().width) - 1144) < 2, "badge right edge pinned to the track end")
@@ -13,7 +13,8 @@
<field id="focusedIconColor" type="color" value="#262626" />
<field id="focused" type="boolean" value="false" />
<!-- pulse the scale nudge: confirms a press that didn't move focus (Left/Right at the row's end). -->
<!-- pulse the scale nudge: confirms a press that didn't move focus (Left/Right at the row's end,
Up at the top tier). -->
<field id="nudge" type="boolean" alwaysNotify="true" />
</interface>
<children>
@@ -337,11 +337,15 @@ function OnKeyEvent(key as string, press as boolean) as boolean
' BAR tier takes Up (back to the buttons) and lets the transport keys through. Rev/Fwd/Replay are not owned
' by the buttons, so they fall through to the transport and move focus to the bar.
if press and CanFocusInteract()
' Up/Down move between the two tiers; a no-op at the ends is still consumed.
' Up/Down move between the two tiers; a no-op at the ends is still consumed — Up at the top tier
' (the buttons) pulses the focused button so the press visibly lands somewhere.
if key = RemoteKeys.Up or key = RemoteKeys.Down
newTarget = PlayerCoordinatorLogic.NextFocusTarget(m.focusTarget, key)
if newTarget <> m.focusTarget
SetFocusTarget(newTarget)
else if m.focusTarget = PlayerCoordinatorLogic.FocusTarget.Buttons
m.buttonRow.nudge = true
ArmAutoHide()
end if
return true
end if
@@ -833,6 +837,12 @@ function OnPosition(event as object) as void
ApplyTransport()
EnforceTransportFreeze() ' OnPosition only fires while playing, so it catches a transport auto-resumed with no state-change edge.
' EnforceTransportFreeze can finish playback (FinishEof at the end of content under a transport), which
' synchronously closes the player and drops m.sponsorblock. A closed player must run no more of the tick.
if m.onCloseCalled = true
return
end if
' SponsorBlock auto-skip off the real position (the controller decides; we apply the seek / finish).
sb = m.sponsorblock.OnPosition(posMs)
if sb <> invalid
@@ -933,6 +943,8 @@ function OnFullScreenChange() as void
LogDebug("fullscreen ->", fullscreen)
' the SponsorBlock notification rides with the player: hidden while minimized, shown when full.
m.sponsorblock.SetVisible(fullscreen)
' after a PiP restore the OS leaves captions blank while enableUI=false (resizing alone doesn't); suppress on minimize, release on restore to re-engage them.
m.top.suppressCaptions = not fullscreen
' minimized: no player UI at all. Reset any active transport (the bif/glyph clear; the underlying play/pause
' stays as-is) and hide chrome/spinner/pause now. Fires for the minimize button, external minimize, and a
' video that starts minimized.
@@ -11,7 +11,7 @@ end function
' getHttpAgent — Initialize does `m.top.getHttpAgent().AddHeader(...)`; a Group has no such method. No-op stub.
function getHttpAgent() as object
return {
AddHeader: function(name as string, value as string)
AddHeader: function(_name as string, _value as string)
end function
}
end function
@@ -37,6 +37,13 @@ function TestSetup() as void
Initialize() ' the real coordinator init body (m.transport, findNode children, timer observers, getHttpAgent)
' count ButtonRow nudge pulses (the field is a sticky alwaysNotify boolean, so the count — not the value —
' is what tells the spec whether a given press pulsed). Scoped + unobserve-first: the suite node is shared
' across tests, so a plain ObserveField here would stack one counter observer per TestSetup call.
m.top.nudgeCount = 0
m.buttonRow.unobserveFieldScoped("nudge")
m.buttonRow.observeFieldScoped("nudge", FuncName(OnTestNudge))
container = createObject("roSGNode", "Node")
container.addField("fullscreen", "boolean", false)
container.fullscreen = true
@@ -72,6 +79,10 @@ function TestSetup() as void
OnNodeReady()
end function
function OnTestNudge() as void
m.top.nudgeCount += 1
end function
' TestKey — drive a remote key through the REAL OnKeyEvent (scrub/scan/commit/etc).
function TestKey(key as string, down as boolean) as boolean
return OnKeyEvent(key, down)
@@ -164,14 +175,30 @@ function TestSnapshot() as object
return {
transportMode: m.transport.transportMode
seekSettling: m.transport.seekSettling
onCloseCalled: m.onCloseCalled = true
control: m.top.control
autoplay: m.top.autoplayAfterSeek
bifVisible: m.bifDisplay.visible
chromeShown: (m.chromeMode = ChromeMode.Shown or m.chromeMode = ChromeMode.FadingIn)
suppressCaptions: m.top.suppressCaptions
focusTarget: m.focusTarget
focusedButton: m.focusedButton
nudgeCount: m.top.nudgeCount
forceLiveBadge: m.trickPlayBar.forceLiveBadge
liveBadgeShown: m.trickPlayBar.findNode("liveLabel").visible
barRemainingText: m.trickPlayBar.findNode("remainingLabel").text
}
end function
' TestWireQueueClose — make the stub videoQueue close the player when ClosePlayer writes closePlayer, mirroring
' the real VideoQueue.OnClosePlayer (which sets player.close = true). Opt-in: only the finish-during-tick
' re-entrancy spec needs the full synchronous teardown chain wired up.
function TestWireQueueClose() as void
m.videoQueue.observeFieldScoped("closePlayer", FuncName(OnTestQueueClose))
end function
function OnTestQueueClose() as void
if m.videoQueue.closePlayer
m.top.close = true
end if
end function
@@ -17,6 +17,7 @@
<field id="thumbnailTiles" type="assocarray" />
<field id="playbackSpeed" type="float" value="1.0" />
<field id="enableUI" type="boolean" value="true" />
<field id="suppressCaptions" type="boolean" />
<field id="asyncStopSemantics" type="boolean" />
<field id="notificationInterval" type="float" />
<field id="width" type="float" />
@@ -40,12 +41,15 @@
<field id="minRect" type="rect2D" value="[834,460,426,240]" />
<field id="maxRect" type="rect2D" value="[0,0,1280,720]" />
<field id="close" type="boolean" alwaysNotify="true" />
<!-- test-only probe: how many times the coordinator pulsed ButtonRow.nudge (TestSetup observes it). -->
<field id="nudgeCount" type="integer" />
<!-- the Video-only method Initialize calls, plus the spec's drivers (callFunc reaches only interface funcs). -->
<function name="getHttpAgent" />
<function name="TestSetup" />
<function name="TestKey" />
<function name="TestSetState" />
<function name="TestSnapshot" />
<function name="TestWireQueueClose" />
<function name="TestSetControl" />
<function name="TestSetLive" />
<function name="TestFireLiveBadgeHold" />
@@ -2,6 +2,7 @@
' inert and spec-driven) through scripted device-state sequences the real Roku Video won't produce on command.
' This is the harness that would have caught the reported wedge: the existing INV-D* are blind to it (during the
' wedge state="buffering", so "transport => state<>playing" was SATISFIED). The NEW property is P-seam.
import "pkg:/components/VideoPlayerDev/PlayerCoordinatorLogic.bs"
import "pkg:/components/VideoPlayerDev/TransportController.bs"
import "pkg:/components/VideoPlayerDev/VideoNode.bs"
import "pkg:/source/utils/RemoteKeys.bs"
@@ -214,6 +215,56 @@ namespace Tests
m.assertEqual(m.Snap().focusedButton, 0, "a fresh reveal resets the highlight")
end function
' Up at the top tier (the buttons) has nowhere to go; the press must still visibly land — it pulses
' (nudges) the focused button instead of being swallowed.
@it("Up at the buttons tier nudges the focused button instead of moving focus")
function _()
m.top.callFunc("TestKey", RemoteKeys.Up, true) ' reveal -> buttons tier
before = m.Snap()
m.assertEqual(before.focusTarget, PlayerCoordinatorLogic.FocusTarget.Buttons)
m.assertEqual(before.nudgeCount, 0, "the reveal itself does not nudge")
m.top.callFunc("TestKey", RemoteKeys.Up, true) ' nowhere to go up
after = m.Snap()
m.assertEqual(after.nudgeCount, 1, "the no-op Up pulsed the focused button")
m.assertEqual(after.focusTarget, PlayerCoordinatorLogic.FocusTarget.Buttons, "focus stays on the buttons")
m.assertEqual(after.focusedButton, before.focusedButton, "the highlight is untouched")
end function
' A press that GOES somewhere must not nudge: Left/Right inside the row, Up/Down between the tiers.
@it("a press that moves focus does not nudge")
function _()
m.top.callFunc("TestKey", RemoteKeys.Up, true) ' reveal -> buttons tier, play/pause
m.top.callFunc("TestKey", RemoteKeys.Right, true) ' play/pause -> minimize
m.top.callFunc("TestKey", RemoteKeys.Down, true) ' buttons -> bar
m.top.callFunc("TestKey", RemoteKeys.Up, true) ' bar -> buttons
m.top.callFunc("TestKey", RemoteKeys.Left, true) ' minimize -> play/pause
m.assertEqual(m.Snap().nudgeCount, 0, "every press moved focus; none may pulse")
end function
' Left/Right clamped at the row's ends pulse the focused button (the original nudge path, at the seam).
@it("Left/Right clamped at the row ends nudge the focused button")
function _()
m.top.callFunc("TestKey", RemoteKeys.Up, true) ' reveal -> play/pause (leftmost)
m.top.callFunc("TestKey", RemoteKeys.Left, true) ' clamped at the left end
m.assertEqual(m.Snap().nudgeCount, 1)
m.top.callFunc("TestKey", RemoteKeys.Right, true) ' -> minimize (rightmost)
m.top.callFunc("TestKey", RemoteKeys.Right, true) ' clamped at the right end
snap = m.Snap()
m.assertEqual(snap.nudgeCount, 2)
m.assertEqual(snap.focusedButton, 1, "the clamp held the highlight at the end")
end function
' Down at the bar tier (the bottom) is also a no-op, but the bar is not a button: consumed, no nudge.
@it("Down at the bar tier is consumed without a nudge")
function _()
m.top.callFunc("TestKey", RemoteKeys.Up, true) ' reveal -> buttons tier
m.top.callFunc("TestKey", RemoteKeys.Down, true) ' buttons -> bar
m.top.callFunc("TestKey", RemoteKeys.Down, true) ' nowhere to go down
snap = m.Snap()
m.assertEqual(snap.focusTarget, PlayerCoordinatorLogic.FocusTarget.Bar, "focus stays on the bar")
m.assertEqual(snap.nudgeCount, 0)
end function
' A keep-playing seek issued while PAUSED must preserve the pause: the device auto-resumes on any seek
' (autoplayAfterSeek only governs rebuffer-resume per the Video docs), so the coordinator re-pauses on
' the playing edge the auto-resume produces.
@@ -322,6 +373,19 @@ namespace Tests
end for
end function
' PiP captions (regression: subtitles stopped after shrink->grow). With enableUI=false the OS leaves
' captions blank after a PiP restore; minimize must suppress and restore must release — the
' suppress->release refresh re-engages OS caption rendering.
@it("PiP minimize suppresses captions; restore releases them")
function _()
container = m.top.container
m.assertFalse(m.Snap().suppressCaptions, "captions shown while fullscreen")
container.fullscreen = false
m.assertTrue(m.Snap().suppressCaptions, "captions suppressed while minimized")
container.fullscreen = true
m.assertFalse(m.Snap().suppressCaptions, "captions released on restore")
end function
' The PiP-toggle-after-close crash (captured on device): OnClose drops m.sponsorblock, so a leaked
' container observer makes the next fullscreen flip crash OnFullScreenChange (&hf3 on SetVisible). The
' fix is unobserve-on-close + the onCloseCalled guard; a regression CRASHES this test. Kept LAST in the
@@ -353,6 +417,35 @@ namespace Tests
m.assertTrue(true, "no crash: the closed player ignored all post-close traffic")
end function
' Crash #1 (store: the dominant OnPosition crash, &hf3 ERR_RO3 "interface not a member"): a finish
' triggered from WITHIN a position tick re-enters teardown synchronously — EnforceTransportFreeze ->
' FinishEof -> OnPlaybackFinished -> ClosePlayer -> the queue sets player.close -> OnClose drops
' m.sponsorblock — then OnPosition continues to `m.sponsorblock.OnPosition()` and derefs the dropped
' controller. (`m.sponsorblock` is a field, so the invalid deref is &hf3, not &hec.) The OLD code crashes
' here; the onCloseCalled re-check after EnforceTransportFreeze bails. Kept LAST: OnClose detaches the node.
@it("a finish during a position tick must not deref the dropped sponsorblock (the OnPosition ERR_RO3 crash)")
function _()
m.top.callFunc("TestWireQueueClose") ' the stub queue now closes the player on closePlayer, as the real one does
m.top.duration = 100
m.top.position = 90
' scrub the cursor to the end (atEof) while the actual position is NOT yet at the end.
for i = 0 to 8
m.top.callFunc("TestKey", RemoteKeys.Right, true)
m.top.callFunc("TestKey", RemoteKeys.Right, false)
end for
m.assertEqual(m.Snap().transportMode, TransportController.Mode.Scrub)
' the device is PLAYING under the active transport (the INV-D1 anomaly EnforceTransportFreeze guards).
' Position is not yet at EOF, so this is a normal re-freeze — NOT a finish.
m.top.callFunc("TestSetState", VideoState.Playing)
m.assertFalse(m.Snap().onCloseCalled, "not finished yet — the position is not at EOF")
' NOW a position tick lands at the end -> OnPosition -> EnforceTransportFreeze -> FinishEof ->
' OnPlaybackFinished -> ClosePlayer -> (re-entrant) OnClose drops m.sponsorblock -> OnPosition then
' derefs the dropped controller. The old code faults here (&hf3); the fix bails first.
m.top.position = 99
' reaching here means OnPosition survived the re-entrant teardown.
m.assertTrue(m.Snap().onCloseCalled, "the finish closed the player from within the position tick")
end function
end class
end namespace
@@ -48,6 +48,10 @@ function OnPlay() as void
end if
player = CreateVideoPlayer()
if player = invalid
m.top.nowPlaying = invalid
return
end if
player@.PlayWithContent(videoNode)
m.top.player = player
m.top.nowPlaying = videoNode
@@ -364,6 +368,10 @@ function CreateVideoPlayer() as object
container = m.top.videoContainer
videoPlayer = container.createChild(playerComponent)
if videoPlayer = invalid
LogError("createChild returned invalid for", playerComponent, "- cannot start playback")
return invalid
end if
videoPlayer.id = "VideoPlayer"
videoPlayer.previousPlayer = m.previousPlayer
' without this, the queue pins every last-closed player for the app's lifetime.
+3
View File
@@ -166,6 +166,9 @@
preview: {
option: "manual_skip",
},
hook: {
option: "manual_skip",
},
filler: {
option: "manual_skip",
},
@@ -8,6 +8,7 @@
"intro",
"outro",
"preview",
"hook",
"filler",
"music_offtopic",
],
@@ -49,11 +50,17 @@
color: "#0202EDB3",
},
preview: {
title: "Preview/Recap/Hook",
title: "Preview/Recap",
short_title: "Preview/Recap",
options: ["auto_skip", "manual_skip", "show_in_seekbar", "disable"],
color: "#008FD6B3",
},
hook: {
title: "Hook/Greetings",
short_title: "Hook/Greetings",
options: ["auto_skip", "manual_skip", "show_in_seekbar", "disable"],
color: "#395699B3",
},
filler: {
title: "Filler Tangent/Jokes",
short_title: "Filler",
+4 -4
View File
@@ -720,14 +720,14 @@
<source>Endcards/Credits</source>
<translation>Endcard/Abspann</translation>
</message>
<message>
<source>Preview/Recap/Hook</source>
<translation>Vorschau/Rückschau/Hook</translation>
</message>
<message>
<source>Preview/Recap</source>
<translation>Vorschau/Rückschau</translation>
</message>
<message>
<source>Hook/Greetings</source>
<translation>Hook/Begrüßungen</translation>
</message>
<message>
<source>Filler</source>
<translation>Füllwörter/ Zeitverschwendung</translation>
+4 -4
View File
@@ -1060,14 +1060,14 @@
<source>Endcards/Credits</source>
<translation>Endcards/Credits</translation>
</message>
<message>
<source>Preview/Recap/Hook</source>
<translation>Preview/Recap/Hook</translation>
</message>
<message>
<source>Preview/Recap</source>
<translation>Preview/Recap</translation>
</message>
<message>
<source>Hook/Greetings</source>
<translation>Hook/Greetings</translation>
</message>
<message>
<source>Filler Tangent/Jokes</source>
<translation>Filler Tangent/Jokes</translation>
+4 -4
View File
@@ -624,6 +624,10 @@
<source>Preview/Recap</source>
<translation>Vista previa/Resumen</translation>
</message>
<message>
<source>Hook/Greetings</source>
<translation>Gancho/Saludos</translation>
</message>
<message>
<source>Added to queue</source>
<translation>Añadir a la cola</translation>
@@ -1128,10 +1132,6 @@
<source>Endcards/Credits</source>
<translation>Tarjeta final/Créditos</translation>
</message>
<message>
<source>Preview/Recap/Hook</source>
<translation>Vista previa/Resumen/Gancho</translation>
</message>
<message>
<source>Press and hold Options (*) to open the queue</source>
<translation>Mantén pulsado Opciones (*) para abrir la cola</translation>
+2 -2
View File
@@ -1201,8 +1201,8 @@
<translation>Avance/Resumen</translation>
</message>
<message>
<source>Preview/Recap/Hook</source>
<translation>Avance/Resumen/Gancho</translation>
<source>Hook/Greetings</source>
<translation>Gancho/Saludos</translation>
</message>
<message>
<source>Sponsor</source>
+4 -4
View File
@@ -912,14 +912,14 @@
<source>Endcards/Credits</source>
<translation>Écrans de fin/Crédits</translation>
</message>
<message>
<source>Preview/Recap/Hook</source>
<translation>Aperçu/Récapitulatif/Accroche</translation>
</message>
<message>
<source>Preview/Recap</source>
<translation>Aperçu/Récapitulatif</translation>
</message>
<message>
<source>Hook/Greetings</source>
<translation>Accroche/Salutations</translation>
</message>
<message>
<source>Filler Tangent/Jokes</source>
<translation>Digressions/Blagues</translation>
+4 -4
View File
@@ -788,10 +788,6 @@
<source>Endcards/Credits</source>
<translation>Cards finais/Créditos</translation>
</message>
<message>
<source>Preview/Recap/Hook</source>
<translation>Pré-visualização/Recapitulação/Gancho</translation>
</message>
<message>
<source>Intermission/Intro Animation</source>
<translation>Intermissão/Animação de introdução</translation>
@@ -800,6 +796,10 @@
<source>Preview/Recap</source>
<translation>Pré-visualização/Recapitulação</translation>
</message>
<message>
<source>Hook/Greetings</source>
<translation>Gancho/Saudações</translation>
</message>
<message>
<source>Filler Tangent/Jokes</source>
<translation>Preenchimento Tangente/Piadas</translation>
+2 -2
View File
@@ -2,8 +2,8 @@ title=PlayletLib
# Do not update version manually, it is auto updated from package.json
major_version=0
minor_version=46
build_version=00000
minor_version=47
build_version=00001
ui_resolutions=hd
uri_resolution_autosub=$$RES$$,480p,720p,1080p
@@ -1,3 +1,4 @@
import "pkg:/source/utils/CodecCapabilities.bs"
import "pkg:/source/utils/StringUtils.bs"
class ApplicationInfo
@@ -80,6 +81,7 @@ class ApplicationInfo
user_country_code: m.roDeviceInfo.GetUserCountryCode()
friendly_name: m.roDeviceInfo.GetFriendlyName()
current_locale: m.roDeviceInfo.GetCurrentLocale()
can_decode_av1: CodecCapabilities.CanDecodeAv1()
}
end if
return m.deviceInfo
@@ -0,0 +1,10 @@
namespace CodecCapabilities
' YouTube serves streams above 1080p only as AV1 (mp4) and VP9 (webm), and the
' player only plays fragmented MP4 in DASH - so AV1 decoding is what decides
' whether the device can play 4K.
function CanDecodeAv1() as boolean
devInfo = CreateObject("roDeviceInfo")
canDecode = devInfo.CanDecodeVideo({ "codec": "av1" })
return canDecode.result = true
end function
end namespace
+2 -2
View File
@@ -353,8 +353,8 @@ namespace Locale
IntroTitle = "Intermission/Intro Animation"
IntroShortTitle = "Intermission"
OutroTitle = "Endcards/Credits"
PreviewTitle = "Preview/Recap/Hook"
PreviewShortTitle = "Preview/Recap"
PreviewTitle = "Preview/Recap"
HookTitle = "Hook/Greetings"
FillerTitle = "Filler Tangent/Jokes"
FillerShortTitle = "Filler"
ChapterTitle = "Chapter"
+91 -91
View File
@@ -1,30 +1,30 @@
{
"name": "playlet-web",
"version": "0.46.0",
"version": "0.47.1",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "playlet-web",
"version": "0.46.0",
"version": "0.47.1",
"devDependencies": {
"@sveltejs/vite-plugin-svelte": "^7.1.2",
"@tailwindcss/postcss": "^4.3.0",
"@tailwindcss/typography": "^0.5.19",
"@tailwindcss/postcss": "^4.3.1",
"@tailwindcss/typography": "^0.5.20",
"@tsconfig/svelte": "^5.0.8",
"@vitejs/plugin-legacy": "^8.0.2",
"autoprefixer": "^10.5.0",
"bgutils-js": "^3.2.0",
"daisyui": "^5.5.20",
"daisyui": "^5.5.23",
"dotenv": "^17.4.2",
"ip": "^2.0.1",
"jszip": "^3.10.1",
"postcss": "^8.5.15",
"rollup-plugin-visualizer": "^7.0.1",
"svelte": "^5.56.2",
"svelte": "^5.56.3",
"svelte-check": "^4.6.0",
"svelte-preprocess": "6.0.3",
"tailwindcss": "^4.3.0",
"tailwindcss": "^4.3.1",
"terser": "^5.48.0",
"tslib": "^2.8.1",
"typescript": "^5.9.3",
@@ -2014,49 +2014,49 @@
}
},
"node_modules/@tailwindcss/node": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/@tailwindcss/node/-/node-4.3.0.tgz",
"integrity": "sha512-aFb4gUhFOgdh9AXo4IzBEOzBkkAxm9VigwDJnMIYv3lcfXCJVesNfbEaBl4BNgVRyid92AmdviqwBUBRKSeY3g==",
"version": "4.3.1",
"resolved": "https://registry.npmjs.org/@tailwindcss/node/-/node-4.3.1.tgz",
"integrity": "sha512-6NDaqRoAMSXD1mr/RXu0HBvNE9a2n5tHPsxu9XHLws8o4Twes5rBM2205SUUiJ9goAtadrN6xTGX0UDEwp/N4A==",
"dev": true,
"license": "MIT",
"dependencies": {
"@jridgewell/remapping": "^2.3.5",
"enhanced-resolve": "^5.21.0",
"jiti": "^2.6.1",
"enhanced-resolve": "5.21.6",
"jiti": "^2.7.0",
"lightningcss": "1.32.0",
"magic-string": "^0.30.21",
"source-map-js": "^1.2.1",
"tailwindcss": "4.3.0"
"tailwindcss": "4.3.1"
}
},
"node_modules/@tailwindcss/oxide": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/@tailwindcss/oxide/-/oxide-4.3.0.tgz",
"integrity": "sha512-F7HZGBeN9I0/AuuJS5PwcD8xayx5ri5GhjYUDBEVYUkexyA/giwbDNjRVrxSezE3T250OU2K/wp/ltWx3UOefg==",
"version": "4.3.1",
"resolved": "https://registry.npmjs.org/@tailwindcss/oxide/-/oxide-4.3.1.tgz",
"integrity": "sha512-yVPyo8RNkabVr3O2EhHEE0Rewu7YKzc1DhIqfL46LKveFrmu9XbDazNOJY7/GRuvw1h6u3utWnR29H/p5JPlgA==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">= 20"
},
"optionalDependencies": {
"@tailwindcss/oxide-android-arm64": "4.3.0",
"@tailwindcss/oxide-darwin-arm64": "4.3.0",
"@tailwindcss/oxide-darwin-x64": "4.3.0",
"@tailwindcss/oxide-freebsd-x64": "4.3.0",
"@tailwindcss/oxide-linux-arm-gnueabihf": "4.3.0",
"@tailwindcss/oxide-linux-arm64-gnu": "4.3.0",
"@tailwindcss/oxide-linux-arm64-musl": "4.3.0",
"@tailwindcss/oxide-linux-x64-gnu": "4.3.0",
"@tailwindcss/oxide-linux-x64-musl": "4.3.0",
"@tailwindcss/oxide-wasm32-wasi": "4.3.0",
"@tailwindcss/oxide-win32-arm64-msvc": "4.3.0",
"@tailwindcss/oxide-win32-x64-msvc": "4.3.0"
"@tailwindcss/oxide-android-arm64": "4.3.1",
"@tailwindcss/oxide-darwin-arm64": "4.3.1",
"@tailwindcss/oxide-darwin-x64": "4.3.1",
"@tailwindcss/oxide-freebsd-x64": "4.3.1",
"@tailwindcss/oxide-linux-arm-gnueabihf": "4.3.1",
"@tailwindcss/oxide-linux-arm64-gnu": "4.3.1",
"@tailwindcss/oxide-linux-arm64-musl": "4.3.1",
"@tailwindcss/oxide-linux-x64-gnu": "4.3.1",
"@tailwindcss/oxide-linux-x64-musl": "4.3.1",
"@tailwindcss/oxide-wasm32-wasi": "4.3.1",
"@tailwindcss/oxide-win32-arm64-msvc": "4.3.1",
"@tailwindcss/oxide-win32-x64-msvc": "4.3.1"
}
},
"node_modules/@tailwindcss/oxide-android-arm64": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/@tailwindcss/oxide-android-arm64/-/oxide-android-arm64-4.3.0.tgz",
"integrity": "sha512-TJPiq67tKlLuObP6RkwvVGDoxCMBVtDgKkLfa/uyj7/FyxvQwHS+UOnVrXXgbEsfUaMgiVvC4KbJnRr26ho4Ng==",
"version": "4.3.1",
"resolved": "https://registry.npmjs.org/@tailwindcss/oxide-android-arm64/-/oxide-android-arm64-4.3.1.tgz",
"integrity": "sha512-SVlyf61g374l5cHyg8x9kf5xmLcOaxvOTsbsqDnSsDJaKOEFZ7GCvi84VAVGpxojYOs1+3K6M0UjXfqPU8vmOQ==",
"cpu": [
"arm64"
],
@@ -2071,9 +2071,9 @@
}
},
"node_modules/@tailwindcss/oxide-darwin-arm64": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/@tailwindcss/oxide-darwin-arm64/-/oxide-darwin-arm64-4.3.0.tgz",
"integrity": "sha512-oMN/WZRb+SO37BmUElEgeEWuU8E/HXRkiODxJxLe1UTHVXLrdVSgfaJV7pSlhRGMSOiXLuxTIjfsF3wYvz8cgQ==",
"version": "4.3.1",
"resolved": "https://registry.npmjs.org/@tailwindcss/oxide-darwin-arm64/-/oxide-darwin-arm64-4.3.1.tgz",
"integrity": "sha512-hVnWLwv+e/l7c4WKyVtHVrIPvYdqWHjRB3MDIqARynzFtnQg85kmQEFCbV9Ja0VVx4xXTIiDWY60Y7iz/iNoDA==",
"cpu": [
"arm64"
],
@@ -2088,9 +2088,9 @@
}
},
"node_modules/@tailwindcss/oxide-darwin-x64": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/@tailwindcss/oxide-darwin-x64/-/oxide-darwin-x64-4.3.0.tgz",
"integrity": "sha512-N6CUmu4a6bKVADfw77p+iw6Yd9Q3OBhe0veaDX+QazfuVYlQsHfDgxBrsjQ/IW+zywL8mTrNd0SdJT/zgtvMdA==",
"version": "4.3.1",
"resolved": "https://registry.npmjs.org/@tailwindcss/oxide-darwin-x64/-/oxide-darwin-x64-4.3.1.tgz",
"integrity": "sha512-Cf7abu0WVgbhU7ANgPUnSAvm7nCvMweusHb8FnaHlLfv/Caq4GYaEZg7ZImzzmjx4lIAfuS8q+eLIS7A7IzxIg==",
"cpu": [
"x64"
],
@@ -2105,9 +2105,9 @@
}
},
"node_modules/@tailwindcss/oxide-freebsd-x64": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/@tailwindcss/oxide-freebsd-x64/-/oxide-freebsd-x64-4.3.0.tgz",
"integrity": "sha512-zDL5hBkQdH5C6MpqbK3gQAgP80tsMwSI26vjOzjJtNCMUo0lFgOItzHKBIupOZNQxt3ouPH7RPhvNhiTfCe5CQ==",
"version": "4.3.1",
"resolved": "https://registry.npmjs.org/@tailwindcss/oxide-freebsd-x64/-/oxide-freebsd-x64-4.3.1.tgz",
"integrity": "sha512-ZZqzX2Y+GXtXXfqSfpJhDm60OoZfvLHLCgm+J7NVqgHHJjG/m9ugZI77RwTsVd4fnBJuCFP6Ae6kTJb71UdS8g==",
"cpu": [
"x64"
],
@@ -2122,9 +2122,9 @@
}
},
"node_modules/@tailwindcss/oxide-linux-arm-gnueabihf": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm-gnueabihf/-/oxide-linux-arm-gnueabihf-4.3.0.tgz",
"integrity": "sha512-R06HdNi7A7OEoMsf6d4tjZ71RCWnZQPHj2mnotSFURjNLdBC+cIgXQ7l81CqeoiQftjf6OOblxXMInMgN2VzMA==",
"version": "4.3.1",
"resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm-gnueabihf/-/oxide-linux-arm-gnueabihf-4.3.1.tgz",
"integrity": "sha512-/Ah/xik0LaMYfv9DZ0S/t4pBlBNYOcqtRwusjgovHkvT8ixueWCLyJjsaF5kQIckjb4IT8Q6K6p/iPmZMixYgg==",
"cpu": [
"arm"
],
@@ -2139,9 +2139,9 @@
}
},
"node_modules/@tailwindcss/oxide-linux-arm64-gnu": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm64-gnu/-/oxide-linux-arm64-gnu-4.3.0.tgz",
"integrity": "sha512-qTJHELX8jetjhRQHCLilkVLmybpzNQAtaI/gaoVoidn/ufbNDbAo8KlK2J+yPoc8wQxvDxCmh/5lr8nC1+lTbg==",
"version": "4.3.1",
"resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm64-gnu/-/oxide-linux-arm64-gnu-4.3.1.tgz",
"integrity": "sha512-gqdFoVJlw444GvpnheZLHmvTzSxI/cOUUh2KSNejQjTcYkW062SVD+En0rUgD+QV91bz1XGIGtt1HJd48xUGbQ==",
"cpu": [
"arm64"
],
@@ -2156,9 +2156,9 @@
}
},
"node_modules/@tailwindcss/oxide-linux-arm64-musl": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm64-musl/-/oxide-linux-arm64-musl-4.3.0.tgz",
"integrity": "sha512-Z6sukiQsngnWO+l39X4pPbiWT81IC+PLKF+PHxIlyZbGNb9MODfYlXEVlFvej5BOZInWX01kVyzeLvHsXhfczQ==",
"version": "4.3.1",
"resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm64-musl/-/oxide-linux-arm64-musl-4.3.1.tgz",
"integrity": "sha512-Bwv9KwOvE0VKa86xPFif9b9c3Y1NxOV1P0gLti/IYaWEsQYZXDlxfGEtA8mdDZ7SG3wyNXAWYT5SIn3giL57oA==",
"cpu": [
"arm64"
],
@@ -2173,9 +2173,9 @@
}
},
"node_modules/@tailwindcss/oxide-linux-x64-gnu": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-x64-gnu/-/oxide-linux-x64-gnu-4.3.0.tgz",
"integrity": "sha512-DRNdQRpSGzRGfARVuVkxvM8Q12nh19l4BF/G7zGA1oe+9wcC6saFBHTISrpIcKzhiXtSrlSrluCfvMuledoCTQ==",
"version": "4.3.1",
"resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-x64-gnu/-/oxide-linux-x64-gnu-4.3.1.tgz",
"integrity": "sha512-Ymi8O8T15HYQdOUWUtTI6ldN0neHP85FC+Qz32xTcZ7iJXtem/x8ITev0o1e9e5rkqj4lONZfTRLvkmin1+tKg==",
"cpu": [
"x64"
],
@@ -2190,9 +2190,9 @@
}
},
"node_modules/@tailwindcss/oxide-linux-x64-musl": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-x64-musl/-/oxide-linux-x64-musl-4.3.0.tgz",
"integrity": "sha512-Z0IADbDo8bh6I7h2IQMx601AdXBLfFpEdUotft86evd/8ZPflZe9COPO8Q1vw+pfLWIUo9zN/JGZvwuAJqduqg==",
"version": "4.3.1",
"resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-x64-musl/-/oxide-linux-x64-musl-4.3.1.tgz",
"integrity": "sha512-M+P/91qJ6uILLw4k2G93GMDRAXj61SMvFQYt39AqvUqYgExXpLL5aepfns7sj4HiAQeolirQF9E0lzRvdf4zPQ==",
"cpu": [
"x64"
],
@@ -2207,9 +2207,9 @@
}
},
"node_modules/@tailwindcss/oxide-wasm32-wasi": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/@tailwindcss/oxide-wasm32-wasi/-/oxide-wasm32-wasi-4.3.0.tgz",
"integrity": "sha512-HNZGOUxEmElksYR7S6sC5jTeNGpobAsy9u7Gu0AskJ8/20FR9GqebUyB+HBcU/ax6BHuiuJi+Oda4B+YX6H1yA==",
"version": "4.3.1",
"resolved": "https://registry.npmjs.org/@tailwindcss/oxide-wasm32-wasi/-/oxide-wasm32-wasi-4.3.1.tgz",
"integrity": "sha512-zsM8uOeqvVGHsAXsJxsT28ttosFahLJKCLOTUBqRAtKnVgGSRitds9T432QiT8b77Yga7JIBkulIRRlJPtYhRA==",
"bundleDependencies": [
"@napi-rs/wasm-runtime",
"@emnapi/core",
@@ -2229,7 +2229,7 @@
"@emnapi/runtime": "^1.10.0",
"@emnapi/wasi-threads": "^1.2.1",
"@napi-rs/wasm-runtime": "^1.1.4",
"@tybys/wasm-util": "^0.10.1",
"@tybys/wasm-util": "^0.10.2",
"tslib": "^2.8.1"
},
"engines": {
@@ -2237,9 +2237,9 @@
}
},
"node_modules/@tailwindcss/oxide-win32-arm64-msvc": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/@tailwindcss/oxide-win32-arm64-msvc/-/oxide-win32-arm64-msvc-4.3.0.tgz",
"integrity": "sha512-Pe+RPVTi1T+qymuuRpcdvwSVZjnll/f7n8gBxMMh3xLTctMDKqpdfGimbMyioqtLhUYZxdJ9wGNhV7MKHvgZsQ==",
"version": "4.3.1",
"resolved": "https://registry.npmjs.org/@tailwindcss/oxide-win32-arm64-msvc/-/oxide-win32-arm64-msvc-4.3.1.tgz",
"integrity": "sha512-aiNvSq9BsVk8V513lDKlrCFAgf8qBMPZTpgEhInL+NwQqs97mYmupVMrPrgBBSL8Pv/0zXu9MrMF9rMun1ZeNg==",
"cpu": [
"arm64"
],
@@ -2254,9 +2254,9 @@
}
},
"node_modules/@tailwindcss/oxide-win32-x64-msvc": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/@tailwindcss/oxide-win32-x64-msvc/-/oxide-win32-x64-msvc-4.3.0.tgz",
"integrity": "sha512-Mvrf2kXW/yeW/OTezZlCGOirXRcUuLIBx/5Y12BaPM7wJoryG6dfS/NJL8aBPqtTEx/Vm4T4vKzFUcKDT+TKUA==",
"version": "4.3.1",
"resolved": "https://registry.npmjs.org/@tailwindcss/oxide-win32-x64-msvc/-/oxide-win32-x64-msvc-4.3.1.tgz",
"integrity": "sha512-xDEyu1rg290472FEGaKHnzyDyh5QH+AlWvsU5hMoMtPpzmKlRI0jaYKCgSHDYtaQWZOYbMaduSyCwFwY4n1HmA==",
"cpu": [
"x64"
],
@@ -2271,30 +2271,30 @@
}
},
"node_modules/@tailwindcss/postcss": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/@tailwindcss/postcss/-/postcss-4.3.0.tgz",
"integrity": "sha512-Jm05Tjx+9yCLGv5qw1c+84Psds8MnyrEQYCB+FFk2lgGiUjlRqdxke4mVTuYrj2xnVZqKim2Apr5ySuQRYAw/w==",
"version": "4.3.1",
"resolved": "https://registry.npmjs.org/@tailwindcss/postcss/-/postcss-4.3.1.tgz",
"integrity": "sha512-dNJuNbdEJT/SWRuXTYP1WSamelsz3ztkUsdtWQPjrexysrTpaEPM40P/71knXiXLYEojqPOEGitVLLpPMS5T6A==",
"dev": true,
"license": "MIT",
"dependencies": {
"@alloc/quick-lru": "^5.2.0",
"@tailwindcss/node": "4.3.0",
"@tailwindcss/oxide": "4.3.0",
"postcss": "^8.5.10",
"tailwindcss": "4.3.0"
"@tailwindcss/node": "4.3.1",
"@tailwindcss/oxide": "4.3.1",
"postcss": "8.5.15",
"tailwindcss": "4.3.1"
}
},
"node_modules/@tailwindcss/typography": {
"version": "0.5.19",
"resolved": "https://registry.npmjs.org/@tailwindcss/typography/-/typography-0.5.19.tgz",
"integrity": "sha512-w31dd8HOx3k9vPtcQh5QHP9GwKcgbMp87j58qi6xgiBnFFtKEAgCWnDw4qUT8aHwkCp8bKvb/KGKWWHedP0AAg==",
"version": "0.5.20",
"resolved": "https://registry.npmjs.org/@tailwindcss/typography/-/typography-0.5.20.tgz",
"integrity": "sha512-hwbzQuNUfcPvbegQFatVPl/MY/tcM9KLl963hQ5laJKPh81TEZ1+dNG9PirGvcaDBkp+BCshExAyKVPW91dozw==",
"dev": true,
"license": "MIT",
"dependencies": {
"postcss-selector-parser": "6.0.10"
},
"peerDependencies": {
"tailwindcss": ">=3.0.0 || insiders || >=4.0.0-alpha.20 || >=4.0.0-beta.1"
"tailwindcss": ">=3.0.0 || >=4.0.0 || insiders"
}
},
"node_modules/@tsconfig/svelte": {
@@ -2760,9 +2760,9 @@
}
},
"node_modules/daisyui": {
"version": "5.5.20",
"resolved": "https://registry.npmjs.org/daisyui/-/daisyui-5.5.20.tgz",
"integrity": "sha512-HemJcjl0Gk9rQ8BcgofN6p+EURrqftQG9wK1Hkxs98i49xe68+QxpNvry+PyxwkIUgrbMpNmZ5ZWjmtffAjfhQ==",
"version": "5.5.23",
"resolved": "https://registry.npmjs.org/daisyui/-/daisyui-5.5.23.tgz",
"integrity": "sha512-xuheNUSL4T6ZVtWXoioqcNkjoyGX85QTDz4HTw2aBPfqk4fuMjax5HDo8qCmpV6M1YN8bGvfx5BpYCoDeRlt+A==",
"dev": true,
"license": "MIT",
"funding": {
@@ -2885,9 +2885,9 @@
"license": "MIT"
},
"node_modules/enhanced-resolve": {
"version": "5.21.2",
"resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.21.2.tgz",
"integrity": "sha512-xe9vQb5kReirPUxgQrXA3ihgbCqssmTiM7cOZ+Gzu+VeGWgpV98lLZvp0dl4yriyAePcewxGUs9UpKD8PET9KQ==",
"version": "5.21.6",
"resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.21.6.tgz",
"integrity": "sha512-aNnGCvbJ/RIyWo1IuhNdVjnNF+EjH9wpzpNHt+ci/m9He9LJvUN8wrCcXjp9cWsGNAuvSpVFTx/vraAFQ8qGjQ==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -3207,9 +3207,9 @@
"license": "MIT"
},
"node_modules/jiti": {
"version": "2.6.1",
"resolved": "https://registry.npmjs.org/jiti/-/jiti-2.6.1.tgz",
"integrity": "sha512-ekilCSN1jwRvIbgeg/57YFh8qQDNbwDb9xT/qu2DAHbFFZUicIl4ygVaAvzveMhMVr3LnpSKTNnwt8PoOfmKhQ==",
"version": "2.7.0",
"resolved": "https://registry.npmjs.org/jiti/-/jiti-2.7.0.tgz",
"integrity": "sha512-AC/7JofJvZGrrneWNaEnJeOLUx+JlGt7tNa0wZiRPT4MY1wmfKjt2+6O2p2uz2+skll8OZZmJMNqeke7kKbNgQ==",
"dev": true,
"license": "MIT",
"bin": {
@@ -4126,9 +4126,9 @@
}
},
"node_modules/svelte": {
"version": "5.56.2",
"resolved": "https://registry.npmjs.org/svelte/-/svelte-5.56.2.tgz",
"integrity": "sha512-1lDf8TLqpxyAt3xgybfytWPJQbaUD6TiDgpiCLH0BKrKEwzecB9pjuNVnEJMpzH018xUzo6oxheK2HT0oa2RoQ==",
"version": "5.56.3",
"resolved": "https://registry.npmjs.org/svelte/-/svelte-5.56.3.tgz",
"integrity": "sha512-w7JvrM5IFl5cmfbY0TLik9o7mjRUJmRMhOR51tBPu708Gr/MjbGs7VnJnr/B0CaXeI4vtnOh7RKxDr0cwhMdDA==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -4242,9 +4242,9 @@
"license": "MIT"
},
"node_modules/tailwindcss": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-4.3.0.tgz",
"integrity": "sha512-y6nxMGB1nMW9R6k96e5gdIFzcfL/gTJRNaqGes1YvkLnPVXzWgbqFF2yLC0T8G774n24cx3Pe8XrKoniCOAH+Q==",
"version": "4.3.1",
"resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-4.3.1.tgz",
"integrity": "sha512-hk+TB1m+K8CYNrP6rjQaq/Y+4Zylwpa87mLYBKCunwnnQ9p+fHb7kmSfGqyEJoxF/O6CDyABWVFEafNSYKll+Q==",
"dev": true,
"license": "MIT"
},
+6 -6
View File
@@ -1,6 +1,6 @@
{
"name": "playlet-web",
"version": "0.46.0",
"version": "0.47.1",
"type": "module",
"scripts": {
"dev": "vite",
@@ -10,22 +10,22 @@
},
"devDependencies": {
"@sveltejs/vite-plugin-svelte": "^7.1.2",
"@tailwindcss/postcss": "^4.3.0",
"@tailwindcss/typography": "^0.5.19",
"@tailwindcss/postcss": "^4.3.1",
"@tailwindcss/typography": "^0.5.20",
"@tsconfig/svelte": "^5.0.8",
"@vitejs/plugin-legacy": "^8.0.2",
"autoprefixer": "^10.5.0",
"bgutils-js": "^3.2.0",
"daisyui": "^5.5.20",
"daisyui": "^5.5.23",
"dotenv": "^17.4.2",
"ip": "^2.0.1",
"jszip": "^3.10.1",
"postcss": "^8.5.15",
"rollup-plugin-visualizer": "^7.0.1",
"svelte": "^5.56.2",
"svelte": "^5.56.3",
"svelte-check": "^4.6.0",
"svelte-preprocess": "6.0.3",
"tailwindcss": "^4.3.0",
"tailwindcss": "^4.3.1",
"terser": "^5.48.0",
"tslib": "^2.8.1",
"typescript": "^5.9.3",
@@ -1,17 +1,29 @@
<script lang="ts">
import { PlayletApi } from "lib/Api/PlayletApi";
import { translate, userPreferencesStore } from "lib/Stores";
import { playletStateStore, translate, userPreferencesStore } from "lib/Stores";
const textSizes = ["text-2xl", "text-lg", "text-base", "text-sm", "text-xs"];
const qualityLabels = {
auto: "Auto",
"1080p": "1080p",
"720p": "720p",
"480p": "480p",
"360p": "360p",
"240p": "240p",
"144p": "144p",
};
function makeQualityLabels(canDecodeAv1: boolean) {
return {
auto: "Auto",
...(canDecodeAv1 ? { "2160p": "2160p", "1440p": "1440p" } : {}),
"1080p": "1080p",
"720p": "720p",
"480p": "480p",
"360p": "360p",
"240p": "240p",
"144p": "144p",
};
}
let qualityLabels = makeQualityLabels(false);
playletStateStore.subscribe((state) => {
qualityLabels = makeQualityLabels(
(state.device || {})["can_decode_av1"] === true
);
});
export let displayText: string = "";
export let key: string = "";
+2 -1
View File
@@ -13,6 +13,7 @@ import {
import path from "path";
import { SGNode, SGScript } from "brighterscript/dist/parser/SGTypes";
import { RawCodeStatement } from "./Classes/RawCodeStatement";
import { exitOnCriticalErrors } from './critical-exit';
const bindings_function_name = 'InitializeBindings';
@@ -198,5 +199,5 @@ export class BindingsPlugin implements CompilerPlugin {
}
export default () => {
return new BindingsPlugin();
return exitOnCriticalErrors(new BindingsPlugin());
};
@@ -13,6 +13,7 @@ import { SGChildren, SGComponent, SGInterface, SGScript } from 'brighterscript/d
import { globSync } from 'glob';
import fs from 'fs-extra'
import path from 'path';
import { exitOnCriticalErrors } from './critical-exit';
export class ComponentIncludesPlugin implements CompilerPlugin {
public name = 'ComponentIncludesPlugin';
@@ -160,5 +161,5 @@ export class ComponentIncludesPlugin implements CompilerPlugin {
}
export default () => {
return new ComponentIncludesPlugin();
return exitOnCriticalErrors(new ComponentIncludesPlugin());
};
@@ -0,0 +1,28 @@
import { CompilerPlugin, ProgramBuilder } from 'brighterscript';
// A plugin that fails to load (e.g. a TypeScript error in its file) is only logged
// by bsc and the build continues without it, exiting 0 (rokucommunity/brighterscript#1675).
// Listed last in the plugins array, this guard fails the command when any configured
// plugin is missing from the loaded set. It deliberately imports nothing from the
// other plugin files, so it still loads when one of them is broken.
const exitOnError = !!process.env.npm_lifecycle_event && !process.argv.includes('--lsp');
export class CriticalExitGuardPlugin implements CompilerPlugin {
public name = 'CriticalExitGuardPlugin';
beforeProgramCreate(builder: ProgramBuilder) {
if (!exitOnError) {
return;
}
const configured = (builder as any)?.options?.plugins?.length ?? 0;
const loaded = (builder as any)?.plugins?.plugins?.length ?? 0;
if (loaded < configured) {
console.error(`${configured - loaded} of ${configured} configured plugins failed to load (see "Error when loading plugin" above)`);
process.exit(1);
}
}
}
export default () => {
return new CriticalExitGuardPlugin();
};
+37
View File
@@ -0,0 +1,37 @@
import { Plugin } from 'brighterscript';
// bsc catches plugin exceptions and only logs them (rokucommunity/brighterscript#1675),
// so a crashing plugin still yields a passing build/lint. When running under an npm
// script (build, lint, test) an uncaught plugin error must fail the command, so every
// hook is wrapped to exit non-zero. Long-lived hosts (LSP) keep log-and-continue.
const exitOnError = !!process.env.npm_lifecycle_event && !process.argv.includes('--lsp');
export function exitOnCriticalErrors<T extends Plugin>(plugin: T): T {
if (!exitOnError) {
return plugin;
}
return new Proxy(plugin, {
get(target, prop) {
const value = (target as any)[prop];
if (typeof value !== 'function') {
return value;
}
return (...args: unknown[]) => {
try {
const result = value.apply(target, args);
if (result instanceof Promise) {
return result.catch((err: unknown) => exitCritically(target.name, prop, err));
}
return result;
} catch (err) {
exitCritically(target.name, prop, err);
}
};
},
});
}
function exitCritically(pluginName: string, hook: PropertyKey, err: unknown): never {
console.error(`Plugin ${pluginName} failed in ${String(hook)}:`, err instanceof Error ? (err.stack || err.message) : err);
process.exit(1);
}
+2 -1
View File
@@ -11,6 +11,7 @@ import {
} from 'brighterscript';
import { existsSync } from 'fs-extra';
import path from 'path';
import { exitOnCriticalErrors } from './critical-exit';
export class ImportValidationPlugin implements CompilerPlugin {
public name = 'ImportValidationPlugin';
@@ -45,5 +46,5 @@ export class ImportValidationPlugin implements CompilerPlugin {
}
export default () => {
return new ImportValidationPlugin();
return exitOnCriticalErrors(new ImportValidationPlugin());
};
+2 -1
View File
@@ -11,6 +11,7 @@ import {
DiagnosticSeverity,
} from 'brighterscript';
import path from 'path';
import { exitOnCriticalErrors } from './critical-exit';
export class JobSystemPlugin implements CompilerPlugin {
public name = 'JobSystemPlugin';
@@ -115,5 +116,5 @@ export class JobSystemPlugin implements CompilerPlugin {
}
export default () => {
return new JobSystemPlugin();
return exitOnCriticalErrors(new JobSystemPlugin());
};
+2 -1
View File
@@ -7,6 +7,7 @@ import path from 'path';
import fs from 'fs-extra'
import json5 from 'json5';
import YAML from "yaml";
import { exitOnCriticalErrors } from './critical-exit';
const jsonExtensions = ['.json', '.jsonc', '.json5'];
const yamlExtensions = ['.yaml', '.yml'];
@@ -40,5 +41,5 @@ export class JsonYamlPlugin implements CompilerPlugin {
}
export default () => {
return new JsonYamlPlugin();
return exitOnCriticalErrors(new JsonYamlPlugin());
};
+2 -1
View File
@@ -27,6 +27,7 @@ import { globSync } from 'glob';
import { SGNode } from "brighterscript/dist/parser/SGTypes";
import json5 from 'json5';
import YAML from "yaml";
import { exitOnCriticalErrors } from './critical-exit';
const translatableXmlAttributes = ["text", "title", "short_title", "primaryTitle", "displayText", "description"];
@@ -417,5 +418,5 @@ export class LocaleValidationPlugin implements CompilerPlugin {
}
export default () => {
return new LocaleValidationPlugin();
return exitOnCriticalErrors(new LocaleValidationPlugin());
};
+2 -1
View File
@@ -16,6 +16,7 @@ import {
isBrsFile,
} from 'brighterscript';
import path from 'path';
import { exitOnCriticalErrors } from './critical-exit';
const loggingFilePath = path.join('source', 'utils', 'Logging.bs');
const logFunctions = {
@@ -250,5 +251,5 @@ function ${newFunctionName}(${args.join(', ')}) as void
}
export default () => {
return new LoggerPlugin();
return exitOnCriticalErrors(new LoggerPlugin());
};
+33 -3
View File
@@ -6,6 +6,10 @@
// - DEBUG_HOST_IP_ADDRESS would be replaced with the host IP address in the manifest file
// - This is to playlet app to pull playlet lib from the locally hosted server
// - This is only done when --debug is set
// - PLAYLET_DEVTOOLS (env) instead points playlet_lib_zip_debug_url at the dev-tools service:
// the freshly-built lib zip is registered with it and its URL baked in, so rebuilding the lib
// and relaunching hot-reloads it with no app redeploy. Opt-in; only the app manifest has the
// key, so the lib build and every normal build keep the :8086 host the VSCode launch serves.
import {
BeforeProgramDisposeEvent,
@@ -15,6 +19,8 @@ import {
} from 'brighterscript';
import path from 'path';
import fs from 'fs';
import { execFileSync } from 'child_process';
import { exitOnCriticalErrors } from './critical-exit';
const ip = require('ip');
export class ManifestEditPlugin implements CompilerPlugin {
@@ -23,6 +29,15 @@ export class ManifestEditPlugin implements CompilerPlugin {
private originalManifestContent?: string;
beforeProgramCreate(builder: ProgramBuilder) {
// The language server loads this plugin too (VS Code + bsc-lsp), and its revalidate cycle would
// restore a stale cached copy of the manifest over genuine build edits. The LSP builds no-emit
// with showDiagnosticsInConsole off (it reports over the protocol); builds and bslint leave it
// on. So that flag marks the analysis-only editor pass — skip the manifest rewrite there.
// @ts-ignore
if (builder.options.showDiagnosticsInConsole === false) {
return;
}
const manifestPath = path.join(builder.options.rootDir!, "manifest")
let originalManifestContent = fs.readFileSync(manifestPath, { encoding: 'utf8', flag: 'r' })
@@ -35,8 +50,23 @@ export class ManifestEditPlugin implements CompilerPlugin {
manifestContent = manifestContent.replace(/DEBUG=(true|false)/i, `DEBUG=${debug}`);
if (debug) {
// Host IP address
manifestContent = manifestContent.replace(/DEBUG_HOST_IP_ADDRESS/i, `${ip.address()}`)
// dev-tools service hosts the lib (opt-in via PLAYLET_DEVTOOLS); the key lives only in
// the app manifest, so the lib build and normal builds fall through to the :8086 host.
if (process.env.PLAYLET_DEVTOOLS && /playlet_lib_zip_debug_url=/.test(manifestContent)) {
const serveScript = path.resolve(builder.options.rootDir!, '../../../../dev-tools/bin/serve.sh')
const libZip = path.resolve(builder.options.rootDir!, '../../dist/playlet-lib.zip')
let url: string
try {
url = execFileSync(serveScript, ['add', libZip], { encoding: 'utf8' }).trim()
} catch (err: any) {
throw new Error(`Could not host ${libZip} via the dev-tools service (is it running? cd dev-tools && npm start): ${err?.message ?? err}`)
}
builder.logger.log(`Hosting playlet-lib.zip via dev-tools service: ${url}`)
manifestContent = manifestContent.replace(/playlet_lib_zip_debug_url=.*/i, `playlet_lib_zip_debug_url=${url}`)
} else {
// Host IP address
manifestContent = manifestContent.replace(/DEBUG_HOST_IP_ADDRESS/i, `${ip.address()}`)
}
}
// Test flag
@@ -76,5 +106,5 @@ export class ManifestEditPlugin implements CompilerPlugin {
}
export default () => {
return new ManifestEditPlugin();
return exitOnCriticalErrors(new ManifestEditPlugin());
};
+2 -1
View File
@@ -18,6 +18,7 @@ import {
} from 'brighterscript';
import path from 'path';
import fs from 'fs';
import { exitOnCriticalErrors } from './critical-exit';
function copyDirSync(src: string, dest: string): void {
fs.mkdirSync(dest, { recursive: true });
@@ -82,5 +83,5 @@ export class OdcPlugin implements CompilerPlugin {
}
export default () => {
return new OdcPlugin();
return exitOnCriticalErrors(new OdcPlugin());
};
+2 -1
View File
@@ -17,6 +17,7 @@ import {
} from 'brighterscript';
import { RawCodeStatement } from './Classes/RawCodeStatement';
import { exitOnCriticalErrors } from './critical-exit';
// The plugin processes the file that includes the Init function, not the file that includes the @oninit functions
// This is because the modifications will be made to the Init function.
@@ -209,5 +210,5 @@ export class OnInitPlugin implements CompilerPlugin {
}
export default () => {
return new OnInitPlugin();
return exitOnCriticalErrors(new OnInitPlugin());
};
+2 -1
View File
@@ -9,6 +9,7 @@ import { globSync } from 'glob';
import path from 'path';
import md5 from 'crypto-js/md5';
import { Formatter, Runner } from 'brighterscript-formatter';
import { exitOnCriticalErrors } from './critical-exit';
const protobufSchema = require('protocol-buffers-schema')
export class ProtoGenPlugin implements CompilerPlugin {
@@ -275,5 +276,5 @@ end function`;
}
export default () => {
return new ProtoGenPlugin();
return exitOnCriticalErrors(new ProtoGenPlugin());
};
+2 -1
View File
@@ -9,6 +9,7 @@ import {
Range,
isBrsFile
} from 'brighterscript';
import { exitOnCriticalErrors } from './critical-exit';
type Validation = {
code: number | string | undefined;
@@ -76,5 +77,5 @@ export class ValidationPlugin implements CompilerPlugin {
}
export default () => {
return new ValidationPlugin();
return exitOnCriticalErrors(new ValidationPlugin());
};
+2 -1
View File
@@ -16,6 +16,7 @@ import {
isBrsFile
} from "brighterscript";
import { RawCodeStatement } from "./Classes/RawCodeStatement";
import { exitOnCriticalErrors } from './critical-exit';
const annotationNames = ['all', 'get', 'post', 'put', 'delete', 'patch', 'head', 'options'];
const httpRouterBaseClass = 'HttpRouter';
@@ -155,5 +156,5 @@ export class WebServerPlugin implements CompilerPlugin {
}
export default () => {
return new WebServerPlugin();
return exitOnCriticalErrors(new WebServerPlugin());
};
+15 -35
View File
@@ -64,6 +64,7 @@ const imap = new Imap({
const searchAsync = promisify(imap.search).bind(imap);
const openBoxAsync = promisify(imap.openBox).bind(imap);
const moveAsync = promisify(imap.move).bind(imap);
async function getAttachementAsync(from, subject, since) {
return new Promise(async (resolve, reject) => {
@@ -116,36 +117,16 @@ async function getAttachementAsync(from, subject, since) {
}
async function moveToTrash(from, subject, since) {
return new Promise(async (resolve, reject) => {
const results = await searchAsync([['FROM', from], ['SUBJECT', subject], ['SINCE', since]]);
const fetch = imap.fetch(results, { bodies: '' });
fetch.on('message', function (msg, seqno) {
console.log('Processing message #%d', seqno);
msg.on('attributes', attributes => {
imap.move([attributes.uid], '[Gmail]/Trash', function (err) {
if (err) {
console.error(err);
reject(err);
} else {
console.log('Moved message #%d to Trash', seqno);
}
});
});
msg.once('error', err => reject(err));
msg.once('end', function () {
console.log('Finished processing message #%d', seqno);
});
});
fetch.once('end', function () {
console.log('All messages processed');
resolve();
});
});
// imap.search returns UIDs (UID SEARCH), so move them directly with a single
// UID MOVE command. Moving inside an active imap.fetch loop expunges messages
// from INBOX mid-fetch, which desyncs sequence numbers and hangs the connection.
const uids = await searchAsync([['FROM', from], ['SUBJECT', subject], ['SINCE', since]]);
if (uids.length === 0) {
console.log('No messages to move to Trash for subject "%s"', subject);
return;
}
await moveAsync(uids, '[Gmail]/Trash');
console.log('Moved %d message(s) to Trash for subject "%s"', uids.length, subject);
}
const timeout = setTimeout(() => {
@@ -183,11 +164,10 @@ imap.once('ready', async () => {
writeMarkDownFile(images);
// TODO:P0 deleting emails hangs the process, so it's disabled for now
// 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);
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) {