Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e93f9a02c2 | ||
|
|
37a1fffb8d | ||
|
|
6ae6f6cb68 | ||
|
|
510d81b872 | ||
|
|
ebabb6ca99 | ||
|
|
1678bee3b5 | ||
|
|
c055260023 | ||
|
|
e0f5c9691b | ||
|
|
9da9bdf06f | ||
|
|
fea1c22aa9 | ||
|
|
48b10e8618 | ||
|
|
7286c099a0 | ||
|
|
f29b0f0af8 |
No files matched your search
@@ -8,6 +8,7 @@ on:
|
||||
jobs:
|
||||
update_wiki_stats:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 20
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
@@ -5,6 +5,18 @@ 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.48.5] - 2026-09-29
|
||||
|
||||
### Fixed
|
||||
|
||||
- Issue with start up tasks that might have caused "Failed to fetch session data" errors.
|
||||
|
||||
## [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
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
1010
|
||||
],
|
||||
"diagnosticLevel": "hint",
|
||||
"minFirmwareVersion": "11.5.0",
|
||||
// The validation regex rules are validated using the validation-plugin.ts plugin
|
||||
"validation": [
|
||||
{
|
||||
|
||||
Generated
+379
-1950
File diff suppressed because it is too large.
Load diff
+15
-21
@@ -1,39 +1,37 @@
|
||||
{
|
||||
"name": "playlet",
|
||||
"version": "0.48.3",
|
||||
"version": "0.48.5",
|
||||
"description": "Unofficial YouTube client for Roku",
|
||||
"devDependencies": {
|
||||
"@rokucommunity/bslint": "^0.8.44",
|
||||
"@rokucommunity/bslint": "^0.8.46",
|
||||
"@types/crypto-js": "^4.2.2",
|
||||
"@types/fs-extra": "^11.0.4",
|
||||
"@types/node": "^26.1.1",
|
||||
"@types/node": "^26.6.3",
|
||||
"@types/xml2js": "^0.4.14",
|
||||
"argparse": "^3.0.0",
|
||||
"brighterscript": "0.73.0",
|
||||
"brighterscript-formatter": "^1.8.1",
|
||||
"argparse": "^3.0.2",
|
||||
"brighterscript": "0.73.5",
|
||||
"brighterscript-formatter": "^1.8.3",
|
||||
"convert-svg-to-png": "^0.7.1",
|
||||
"crypto-js": "^4.2.0",
|
||||
"dotenv": "^17.4.2",
|
||||
"fs-extra": "^11.4.0",
|
||||
"dotenv": "^18.0.4",
|
||||
"fs-extra": "^11.4.1",
|
||||
"glob": "^13.0.6",
|
||||
"imap": "^0.8.19",
|
||||
"ip": "^2.0.1",
|
||||
"json5": "^2.2.3",
|
||||
"mailparser": "^3.9.14",
|
||||
"mailparser": "^3.9.28",
|
||||
"protocol-buffers-schema": "^3.6.1",
|
||||
"puppeteer": "^25.3.0",
|
||||
"roku-deploy": "^3.18.2",
|
||||
"roku-deploy": "^3.18.4",
|
||||
"roku-test-automation": "^2.2.2",
|
||||
"rooibos-roku": "5.16.4",
|
||||
"rounded-rect-9patch": "^1.1.2",
|
||||
"rooibos-roku": "5.16.5",
|
||||
"semver": "^7.8.5",
|
||||
"shelljs": "^0.10.0",
|
||||
"telnet-client": "^2.2.13",
|
||||
"telnet-client": "^2.2.14",
|
||||
"ts-node": "^10.9.2",
|
||||
"typescript": "6.0.3",
|
||||
"xml2js": "^0.6.2",
|
||||
"yaml": "^2.9.0",
|
||||
"youtubei.js": "^17.2.0"
|
||||
"yaml": "^2.9.1",
|
||||
"youtubei.js": "^18.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "22"
|
||||
@@ -68,20 +66,16 @@
|
||||
"test:integration:player": "npx tsx ./integration-tests/vpd-run-player.ts",
|
||||
"version-sync": "node tools/version-sync.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",
|
||||
"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",
|
||||
"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:read": "node tools/registry.js --output registry.json",
|
||||
"registry:clear": "node tools/registry.js --clear",
|
||||
"restart-app": "node tools/restart-app.js",
|
||||
"check-for-updates": "node tools/check-for-updates.js",
|
||||
"shutdown": "node tools/shutdown.js"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@rollup/rollup-linux-x64-gnu": "^4.62.2"
|
||||
}
|
||||
}
|
||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "playlet-app",
|
||||
"version": "0.48.3",
|
||||
"version": "0.48.5",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "playlet-app",
|
||||
"version": "0.48.3"
|
||||
"version": "0.48.5"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "playlet-app",
|
||||
"version": "0.48.3",
|
||||
"version": "0.48.5",
|
||||
"description": "Unofficial YouTube client for Roku",
|
||||
"scripts": {
|
||||
"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
|
||||
major_version=0
|
||||
minor_version=48
|
||||
build_version=00003
|
||||
build_version=00005
|
||||
|
||||
ui_resolutions=hd
|
||||
uri_resolution_autosub=$$RES$$,480p,720p,1080p
|
||||
|
||||
@@ -23,6 +23,7 @@ function Main(args as object) as void
|
||||
|
||||
Registry.ClearPlayletLibUrlsIfNeeded(args)
|
||||
Registry.ClearRegistryIfNeeded(args)
|
||||
Registry.ClearUnsupportedPlayletLibUrls()
|
||||
|
||||
scene = screen.CreateScene("BootstrapScene")
|
||||
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
|
||||
|
||||
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")
|
||||
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
|
||||
if launchArgs = invalid or launchArgs.clearRegistry = invalid
|
||||
return
|
||||
|
||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "playlet-lib",
|
||||
"version": "0.48.3",
|
||||
"version": "0.48.5",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "playlet-lib",
|
||||
"version": "0.48.3"
|
||||
"version": "0.48.5"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "playlet-lib",
|
||||
"version": "0.48.3",
|
||||
"version": "0.48.5",
|
||||
"description": "Unofficial YouTube client for Roku",
|
||||
"scripts": {
|
||||
"prebuild": "node ../tools/rm.js ../build/playlet-lib",
|
||||
|
||||
@@ -2,51 +2,20 @@ import "pkg:/source/utils/MessagePortUtils.bs"
|
||||
import "pkg:/source/utils/Types.bs"
|
||||
|
||||
function Init()
|
||||
m.jobQueueTaskReady = false
|
||||
m.jobQueueTask = CreateObject("roSGNode", "JobQueueTask")
|
||||
m.jobQueueTask.observeFieldScoped("ready", FuncName(OnJobQueueTaskReady))
|
||||
m.jobQueueTask.control = "run"
|
||||
m.top.observeField("shutdown", FuncName(OnShutdown))
|
||||
m.top.observeField("request", FuncName(OnRequest))
|
||||
end function
|
||||
|
||||
function OnJobQueueTaskReady(event as object) as void
|
||||
jobQueueTask = event.getRoSGNode()
|
||||
jobQueueTask.unobserveFieldScoped("ready")
|
||||
|
||||
m.jobQueueTaskReady = true
|
||||
|
||||
pendingRequestEvents = m.pendingRequestEvents
|
||||
if pendingRequestEvents = invalid
|
||||
return
|
||||
end if
|
||||
|
||||
m.pendingRequestEvents = invalid
|
||||
for each requestEvent in pendingRequestEvents
|
||||
OnRequest(requestEvent)
|
||||
end for
|
||||
m.jobQueueTask.control = "run"
|
||||
end function
|
||||
|
||||
function OnShutdown() as void
|
||||
m.top.unobserveField("shutdown")
|
||||
m.top.unobserveField("request")
|
||||
m.jobQueueTaskReady = false
|
||||
m.jobQueueTask.unobserveField("ready")
|
||||
m.jobQueueTask.shutdown = true
|
||||
m.jobQueueTask = invalid
|
||||
m.pendingRequestEvents = invalid
|
||||
end function
|
||||
|
||||
function OnRequest(event as object) as void
|
||||
if not m.jobQueueTaskReady
|
||||
if m.pendingRequestEvents = invalid
|
||||
m.pendingRequestEvents = []
|
||||
end if
|
||||
m.pendingRequestEvents.push(event)
|
||||
LogWarnNoTelemetry("JobQueue: Job queue task is not ready, request will be queued")
|
||||
return
|
||||
end if
|
||||
|
||||
request = event.getData()
|
||||
if not IsAssociativeArray(request)
|
||||
LogError("JobQueue: Invalid request data", request)
|
||||
|
||||
@@ -9,65 +9,57 @@ import "pkg:/source/utils/StringUtils.bs"
|
||||
const MAX_JOB_TASK_COUNT = 30
|
||||
' Minimum number of JobTasks that will be kept alive
|
||||
const MIN_JOB_TASK_COUNT = 2
|
||||
' Time in milliseconds to wait before scaling down JobTasks
|
||||
' Time in milliseconds without a message before scaling down JobTasks
|
||||
const SCALE_DOWN_THRESHOLD_MS = 10000
|
||||
' wait() sometimes isn't woken by a new message (seen on device); the next wait() returns it
|
||||
const POLL_MS = 1000
|
||||
' Missed requests cluster right after start (measured): check the port more often then
|
||||
const STARTUP_WINDOW_MS = 2000
|
||||
const STARTUP_POLL_MS = 100
|
||||
|
||||
function Init()
|
||||
m.top.functionName = "JobQueueTaskLoop"
|
||||
m.port = CreateObject("roMessagePort")
|
||||
m.top.observeField("shutdown", m.port)
|
||||
m.top.observeField("request", m.port)
|
||||
end function
|
||||
|
||||
function JobQueueTaskLoop() as void
|
||||
messagePort = CreateObject("roMessagePort")
|
||||
|
||||
m.top.observeField("shutdown", messagePort)
|
||||
m.top.observeField("request", messagePort)
|
||||
|
||||
m.top.ready = true
|
||||
port = m.port
|
||||
|
||||
m.busyJobTasks = {}
|
||||
m.idleJobTasks = []
|
||||
|
||||
requests = []
|
||||
startup = CreateObject("roTimespan")
|
||||
scaleDownTimer = CreateObject("roTimespan")
|
||||
|
||||
while true
|
||||
while requests.count() > 0
|
||||
if m.idleJobTasks.Count() > 0
|
||||
ScheduleRequest(requests.Shift(), m.idleJobTasks.Pop())
|
||||
continue while
|
||||
end if
|
||||
|
||||
if m.idleJobTasks.Count() + m.busyJobTasks.Count() < MAX_JOB_TASK_COUNT
|
||||
LogDebug("Creating a new JobTask. Idle:", m.idleJobTasks.Count(), ", Busy:", m.busyJobTasks.Count())
|
||||
jobTask = CreateObject("roSGNode", "JobTask")
|
||||
jobTaskId = "JobTask-" + StringUtils.RandomId()
|
||||
jobTask.id = jobTaskId
|
||||
jobTaskObject = {
|
||||
id: jobTaskId
|
||||
node: jobTask
|
||||
}
|
||||
m.busyJobTasks[jobTaskId] = jobTaskObject
|
||||
MessagePortUtils.ObserveFieldScopedExSafe(jobTask, "ready", messagePort)
|
||||
jobTask.control = "run"
|
||||
else
|
||||
#if DEBUG
|
||||
LogWarnNoTelemetry("Cannot create new JobTask. Idle:", m.idleJobTasks.Count(), ", Busy:", m.busyJobTasks.Count())
|
||||
#end if
|
||||
end if
|
||||
|
||||
exit while
|
||||
while requests.Count() > 0 and m.idleJobTasks.Count() > 0
|
||||
ScheduleRequest(requests.Shift(), m.idleJobTasks.Pop())
|
||||
end while
|
||||
|
||||
scaleDownThresholdMs = m.idleJobTasks.Count() > MIN_JOB_TASK_COUNT ? SCALE_DOWN_THRESHOLD_MS : 0
|
||||
message = wait(scaleDownThresholdMs, messagePort)
|
||||
if requests.Count() > 0 and m.idleJobTasks.Count() + m.busyJobTasks.Count() < MAX_JOB_TASK_COUNT
|
||||
StartJobTask(requests.Shift(), port)
|
||||
end if
|
||||
|
||||
waitMs = POLL_MS
|
||||
if startup.TotalMilliseconds() < STARTUP_WINDOW_MS
|
||||
waitMs = STARTUP_POLL_MS
|
||||
end if
|
||||
|
||||
message = wait(waitMs, port)
|
||||
if message = invalid
|
||||
if m.idleJobTasks.Count() > 0
|
||||
if m.idleJobTasks.Count() > MIN_JOB_TASK_COUNT and scaleDownTimer.TotalMilliseconds() >= SCALE_DOWN_THRESHOLD_MS
|
||||
jobTaskObject = m.idleJobTasks.Pop()
|
||||
jobTaskObject.node.UnobserveFieldScoped("ready")
|
||||
jobTaskObject.node.shutdown = true
|
||||
LogDebug("Scaled down JobTasks. Idle:", m.idleJobTasks.Count(), ", Busy:", m.busyJobTasks.Count())
|
||||
scaleDownTimer.Mark()
|
||||
end if
|
||||
continue while
|
||||
end if
|
||||
scaleDownTimer.Mark()
|
||||
|
||||
messageType = Type(message)
|
||||
if messageType = "roSGNodeEvent"
|
||||
@@ -89,16 +81,32 @@ function JobQueueTaskLoop() as void
|
||||
end while
|
||||
end function
|
||||
|
||||
function StartJobTask(request as object, port as object) as void
|
||||
LogDebug("Creating a new JobTask. Idle:", m.idleJobTasks.Count(), ", Busy:", m.busyJobTasks.Count())
|
||||
|
||||
jobTask = CreateObject("roSGNode", "JobTask")
|
||||
jobTaskId = "JobTask-" + StringUtils.RandomId()
|
||||
jobTask.id = jobTaskId
|
||||
jobTaskObject = {
|
||||
id: jobTaskId
|
||||
node: jobTask
|
||||
}
|
||||
MessagePortUtils.ObserveFieldScopedExSafe(jobTask, "ready", port)
|
||||
' Set the request before starting the task: its first wait() then returns it right away,
|
||||
' with no wakeup to miss.
|
||||
ScheduleRequest(request, jobTaskObject)
|
||||
jobTask.control = "run"
|
||||
end function
|
||||
|
||||
function ScheduleRequest(request as dynamic, jobTaskObject as dynamic)
|
||||
m.busyJobTasks[jobTaskObject.id] = jobTaskObject
|
||||
jobTaskObject.node.request = request
|
||||
end function
|
||||
|
||||
function Shutdown()
|
||||
m.top.UnobserveFieldScoped("request")
|
||||
m.top.UnobserveFieldScoped("shutdown")
|
||||
m.top.UnobserveField("request")
|
||||
m.top.UnobserveField("shutdown")
|
||||
m.top.request = invalid
|
||||
m.top.ready = false
|
||||
|
||||
for each jobTaskId in m.busyJobTasks
|
||||
jobTask = m.busyJobTasks[jobTaskId]
|
||||
|
||||
@@ -2,6 +2,5 @@
|
||||
<interface>
|
||||
<field id="request" type="assocarray" />
|
||||
<field id="shutdown" type="boolean" />
|
||||
<field id="ready" type="boolean" />
|
||||
</interface>
|
||||
</component>
|
||||
@@ -2,20 +2,21 @@ import "pkg:/components/JobSystem/JobRequest.bs"
|
||||
import "pkg:/source/utils/Logging.bs"
|
||||
import "pkg:/source/utils/StringUtils.bs"
|
||||
|
||||
' wait() sometimes isn't woken by a new message (seen on device); the next wait() returns it
|
||||
const POLL_MS = 1000
|
||||
|
||||
function Init()
|
||||
m.top.functionName = "JobTaskLoop"
|
||||
m.port = CreateObject("roMessagePort")
|
||||
m.top.observeField("shutdown", m.port)
|
||||
m.top.observeField("request", m.port)
|
||||
end function
|
||||
|
||||
function JobTaskLoop() as void
|
||||
msgPort = CreateObject("roMessagePort")
|
||||
|
||||
m.top.observeField("shutdown", msgPort)
|
||||
m.top.observeField("request", msgPort)
|
||||
|
||||
m.top.ready = true
|
||||
port = m.port
|
||||
|
||||
while true
|
||||
msg = wait(0, msgPort)
|
||||
msg = wait(POLL_MS, port)
|
||||
msgType = type(msg)
|
||||
|
||||
if msgType = "roSGNodeEvent"
|
||||
|
||||
@@ -255,6 +255,7 @@ class DashManifest
|
||||
xtagsInfo = m.GetXtagsInfo(format)
|
||||
format.xtagsInfo = xtagsInfo
|
||||
format.isDrc = xtagsInfo.isDrc
|
||||
format.isVoiceBoost = xtagsInfo.isVoiceBoost
|
||||
format.isDubbed = xtagsInfo.isDubbed
|
||||
format.isAutoDubbed = xtagsInfo.isAutoDubbed
|
||||
format.isDescriptive = xtagsInfo.isDescriptive
|
||||
@@ -277,12 +278,7 @@ class DashManifest
|
||||
audioTrackId = format.audioTrack.id
|
||||
end if
|
||||
|
||||
drc = ""
|
||||
if format.isDrc = true
|
||||
drc = "drc"
|
||||
end if
|
||||
|
||||
groupId = `${mimeType}-${justCodec}-${colorInfo}-${audioTrackId}-${drc}`
|
||||
groupId = `${mimeType}-${justCodec}-${colorInfo}-${audioTrackId}${m.GetAudioVariantSuffix(format)}`
|
||||
|
||||
if groupInfo[groupId] = invalid
|
||||
groupInfo[groupId] = []
|
||||
@@ -441,7 +437,7 @@ class DashManifest
|
||||
end for
|
||||
end if
|
||||
|
||||
if IsAssociativeArray(firstFormat.audioTrack) or firstFormat.isDrc = true
|
||||
if IsAssociativeArray(firstFormat.audioTrack) or firstFormat.isDrc = true or firstFormat.isVoiceBoost = true
|
||||
' Roles
|
||||
roles = m.GetTrackRoles(firstFormat)
|
||||
for each role in roles
|
||||
@@ -474,9 +470,7 @@ class DashManifest
|
||||
if IsAssociativeArray(stream.audioTrack) and IsString(stream.audioTrack.id)
|
||||
representationId = `${representationId}-${stream.audioTrack.id}`
|
||||
end if
|
||||
if stream.isDrc = true
|
||||
representationId = `${representationId}-drc`
|
||||
end if
|
||||
representationId = `${representationId}${m.GetAudioVariantSuffix(stream)}`
|
||||
|
||||
representationAttributes = {
|
||||
"id": representationId
|
||||
@@ -739,7 +733,10 @@ class DashManifest
|
||||
|
||||
function GetTrackRoles(format as object) as object
|
||||
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")
|
||||
else
|
||||
roles.Push("alternate")
|
||||
@@ -753,13 +750,28 @@ class DashManifest
|
||||
roles.Push("description")
|
||||
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")
|
||||
end if
|
||||
|
||||
return roles
|
||||
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
|
||||
' 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
|
||||
@@ -885,6 +897,7 @@ class DashManifest
|
||||
lang: ""
|
||||
acont: ""
|
||||
isDrc: false
|
||||
isVoiceBoost: false
|
||||
isDubbed: false
|
||||
isAutoDubbed: false
|
||||
isDescriptive: false
|
||||
@@ -921,6 +934,8 @@ class DashManifest
|
||||
result.acont = tags[key]
|
||||
else if key = "drc" and tags[key] = "1"
|
||||
result.isDrc = true
|
||||
else if key = "vb" and tags[key] = "1"
|
||||
result.isVoiceBoost = true
|
||||
end if
|
||||
end for
|
||||
|
||||
|
||||
@@ -1496,6 +1496,12 @@ namespace Innertube
|
||||
return invalid
|
||||
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)
|
||||
return invalid
|
||||
end if
|
||||
@@ -1526,6 +1532,29 @@ namespace Innertube
|
||||
return invalid
|
||||
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
|
||||
videoId = nodeData["contentId"]
|
||||
if not IsString(videoId)
|
||||
|
||||
@@ -17,6 +17,9 @@ namespace Innertube
|
||||
if sessionData = invalid or not IsInt(sessionData.timestamp)
|
||||
return false
|
||||
end if
|
||||
if StringUtils.IsNullOrEmpty(sessionData.visitorData)
|
||||
return false
|
||||
end if
|
||||
nowSeconds = TimeUtils.Now().AsSeconds()
|
||||
return nowSeconds - sessionData.timestamp <= INNERTUBE_VISITOR_DATA_LIFESPAN_SECONDS
|
||||
end function
|
||||
|
||||
@@ -48,14 +48,14 @@ function TelemetryLoop() as void
|
||||
m.dist = GetDist(m.tags)
|
||||
m.userId = GetUserId()
|
||||
|
||||
ReportSessionStart()
|
||||
ReportLastExitCrash()
|
||||
|
||||
m.top.observeField("LogInfo", msgPort)
|
||||
m.top.observeField("LogWarn", msgPort)
|
||||
m.top.observeField("LogError", msgPort)
|
||||
m.top.observeField("LogEvent", msgPort)
|
||||
|
||||
ReportSessionStart()
|
||||
ReportLastExitCrash()
|
||||
|
||||
#if SUPPORTS_BATCHING
|
||||
debouceMs = 2000
|
||||
debounceCountLimit = 20
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
# VideoPlayerDev
|
||||
|
||||
The custom video player intended to replace `components/VideoPlayer` — a stock-OS-trickplay replica plus a
|
||||
control button row. It is selected at **compile time** by `#const USE_DEV_PLAYER` in `VideoQueue.bs` (default
|
||||
`false`). Build with the flag `true` to run it (and the integration suite).
|
||||
The custom video player that replaced `components/VideoPlayer` — a stock-OS-trickplay replica plus a control
|
||||
button row. It is selected at **compile time** by `#const USE_DEV_PLAYER` in `VideoQueue.bs`, currently `true`:
|
||||
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
|
||||
|
||||
|
||||
@@ -418,7 +418,7 @@ function TrySponsorBlockSkip() as boolean
|
||||
end function
|
||||
|
||||
' 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).
|
||||
function OnOkPress() as boolean
|
||||
' commit an active transport.
|
||||
|
||||
@@ -84,6 +84,14 @@ function TestSetup() as void
|
||||
m.top.unobserveField(deviceField)
|
||||
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()
|
||||
end function
|
||||
|
||||
@@ -118,6 +126,13 @@ function TestSetLive(edgeMs as integer) as void
|
||||
m.transport.OnPosition(edgeMs)
|
||||
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).
|
||||
function TestFireLiveBadgeHold() as void
|
||||
OnLiveBadgeHoldFire()
|
||||
@@ -214,6 +229,7 @@ function TestSnapshot() as object
|
||||
focusTarget: m.focusTarget
|
||||
focusedButton: m.focusedButton
|
||||
nudgeCount: m.top.nudgeCount
|
||||
sponsorNoticeShown: SponsorBlock.GetCurrentNotification(m.notifications) <> invalid
|
||||
forceLiveBadge: m.trickPlayBar.forceLiveBadge
|
||||
liveBadgeShown: m.trickPlayBar.findNode("liveLabel").visible
|
||||
barRemainingText: m.trickPlayBar.findNode("remainingLabel").text
|
||||
|
||||
@@ -52,6 +52,7 @@
|
||||
<function name="TestWireQueueClose" />
|
||||
<function name="TestSetControl" />
|
||||
<function name="TestSetLive" />
|
||||
<function name="TestSeedSponsorBlock" />
|
||||
<function name="TestFireLiveBadgeHold" />
|
||||
<function name="TestKillAutoHide" />
|
||||
<function name="TestFinishChromeFadeOut" />
|
||||
|
||||
@@ -216,11 +216,18 @@ namespace Tests
|
||||
end function
|
||||
|
||||
' 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 _()
|
||||
m.assertFalse(m.Snap().chromeShown) ' starts hidden after setup
|
||||
m.top.callFunc("TestKey", RemoteKeys.Up, true)
|
||||
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
|
||||
|
||||
' =========================================================================================
|
||||
@@ -349,6 +356,121 @@ namespace Tests
|
||||
m.assertTrue(m.top.videoQueue.closePlayer, "rung 4: Back closes")
|
||||
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
|
||||
' 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")
|
||||
@@ -555,6 +677,61 @@ namespace Tests
|
||||
m.assertEqual(snap.focusedButton, 1, "the highlight is untouched")
|
||||
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
|
||||
' 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.
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
<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"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 533 B After Width: | Height: | Size: 365 B |
@@ -1,5 +1,5 @@
|
||||
{
|
||||
inputHash: 'c4e2899f8a5e58f6ae711e91e518b4f3',
|
||||
inputHash: '020c780cc50d3bc4ed9fc56f03bd1b21',
|
||||
outputs: [
|
||||
{
|
||||
outputFilePath: 'images/icons/search.png',
|
||||
|
||||
@@ -3,7 +3,7 @@ title=PlayletLib
|
||||
# Do not update version manually, it is auto updated from package.json
|
||||
major_version=0
|
||||
minor_version=48
|
||||
build_version=00003
|
||||
build_version=00005
|
||||
|
||||
ui_resolutions=hd
|
||||
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:
|
||||
' - Removed Kanji, because it added a significant amount of size, while the use
|
||||
' cases of this app does not include Kanji
|
||||
@@ -7,4 +30,4 @@
|
||||
' the generation more thread friendly (we can generate the qrcode in a task) without
|
||||
' freezing the UI.
|
||||
' - Added a simple cachefs cache file to avoid regenerating the same QRCode images
|
||||
' TODO:P2 add original tests
|
||||
' TODO:P2 add original tests
|
||||
@@ -471,7 +471,15 @@ namespace HttpClient
|
||||
backoffMs = 1000 + Rnd(2000)
|
||||
tryNumber = m._tryCount - triesLeft + 1
|
||||
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)
|
||||
try
|
||||
|
||||
@@ -35,6 +35,12 @@ namespace Tests
|
||||
m.assertEqual(PlayerCoordinatorLogic.KeyToCommand(RemoteKeys.Ok), 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.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)
|
||||
end function
|
||||
|
||||
|
||||
@@ -33,10 +33,6 @@ function LogTelemetryEvent(event as object)
|
||||
m.global.telemetry.LogEvent = event
|
||||
end function
|
||||
|
||||
function LogWarnTelemetry(message as string)
|
||||
m.global.telemetry.LogWarn = message
|
||||
end function
|
||||
|
||||
function ToString(value as dynamic) as string
|
||||
if getInterface(value, "ifString") <> invalid
|
||||
return value
|
||||
|
||||
Generated
+566
-267
File diff suppressed because it is too large.
Load diff
+15
-15
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "playlet-web",
|
||||
"version": "0.48.3",
|
||||
"version": "0.48.5",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
@@ -9,27 +9,27 @@
|
||||
"lint": "svelte-check --tsconfig ./tsconfig.json --fail-on-warnings"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@sveltejs/vite-plugin-svelte": "^7.2.0",
|
||||
"@sveltejs/vite-plugin-svelte": "^7.3.1",
|
||||
"@tailwindcss/postcss": "^4.3.3",
|
||||
"@tailwindcss/typography": "^0.5.20",
|
||||
"@tsconfig/svelte": "^5.0.8",
|
||||
"@vitejs/plugin-legacy": "^8.2.2",
|
||||
"autoprefixer": "^10.5.4",
|
||||
"bgutils-js": "^4.0.2",
|
||||
"daisyui": "^5.7.0",
|
||||
"dotenv": "^17.4.2",
|
||||
"@vitejs/plugin-legacy": "^8.2.3",
|
||||
"autoprefixer": "^10.6.1",
|
||||
"bgutils-js": "^4.0.3",
|
||||
"daisyui": "^5.7.46",
|
||||
"dotenv": "^18.0.4",
|
||||
"ip": "^2.0.1",
|
||||
"jszip": "^3.10.1",
|
||||
"postcss": "^8.5.23",
|
||||
"rollup-plugin-visualizer": "^7.0.1",
|
||||
"svelte": "^5.56.8",
|
||||
"svelte-check": "^4.7.3",
|
||||
"svelte-preprocess": "6.0.3",
|
||||
"jszip": "^3.10.2",
|
||||
"postcss": "^8.5.28",
|
||||
"rollup-plugin-visualizer": "^7.1.1",
|
||||
"svelte": "^5.57.1",
|
||||
"svelte-check": "^4.7.6",
|
||||
"svelte-preprocess": "^6.0.5",
|
||||
"tailwindcss": "^4.3.3",
|
||||
"terser": "^5.49.0",
|
||||
"terser": "^5.51.2",
|
||||
"tslib": "^2.8.1",
|
||||
"typescript": "^5.9.3",
|
||||
"vite": "^8.1.5",
|
||||
"vite": "^8.3.1",
|
||||
"vite-plugin-compression": "^0.5.1"
|
||||
}
|
||||
}
|
||||
+24
-11
@@ -12,6 +12,17 @@
|
||||
let libUrlType;
|
||||
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 () => {
|
||||
releases = await fetchReleaseTags();
|
||||
setCurrentlyUsedRelease();
|
||||
@@ -62,17 +73,19 @@
|
||||
break;
|
||||
}
|
||||
}
|
||||
return releases.map((release) => {
|
||||
return {
|
||||
name: release.tag_name,
|
||||
enabled:
|
||||
release.assets.filter(
|
||||
(asset) =>
|
||||
asset.name === "playlet-lib.zip" ||
|
||||
asset.name === "playlet-lib.squashfs.pkg"
|
||||
).length > 0,
|
||||
};
|
||||
});
|
||||
return releases
|
||||
.filter((release) => isSupported(release.tag_name))
|
||||
.map((release) => {
|
||||
return {
|
||||
name: release.tag_name,
|
||||
enabled:
|
||||
release.assets.filter(
|
||||
(asset) =>
|
||||
asset.name === "playlet-lib.zip" ||
|
||||
asset.name === "playlet-lib.squashfs.pkg"
|
||||
).length > 0,
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
async function apply() {
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"composite": true,
|
||||
"module": "NodeNext",
|
||||
"moduleResolution": "NodeNext"
|
||||
"target": "ESNext",
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "Bundler"
|
||||
},
|
||||
"include": [
|
||||
"vite.config.ts"
|
||||
|
||||
@@ -35,7 +35,7 @@ const config: UserConfig = {
|
||||
// But the tools are not (because brighterscript is expecting CommonJs)
|
||||
// so we can't import the function from the tools/get-env-vars.js.
|
||||
function getEnvVars(requiredVars = undefined) {
|
||||
const envFile = joinPath(__dirname, '../.env');
|
||||
const envFile = joinPath(import.meta.dirname, '../.env');
|
||||
|
||||
let envVars = process.env;
|
||||
if (existsSync(envFile)) {
|
||||
|
||||
@@ -7,7 +7,6 @@ const { existsSync, writeFileSync, readFileSync } = require('fs');
|
||||
const json5 = require('json5');
|
||||
const md5 = require('crypto-js/md5');
|
||||
const path = require('path');
|
||||
const { executablePath } = require('puppeteer');
|
||||
|
||||
const META_EXT = '.meta.json5';
|
||||
|
||||
@@ -118,7 +117,7 @@ function checkFileHash(file, hash) {
|
||||
|
||||
async function generateImage(inputImage, options, rootDir) {
|
||||
const opts = {
|
||||
launch: { executablePath: await executablePath() },
|
||||
launch: { channel: 'chrome' },
|
||||
...options
|
||||
};
|
||||
opts.outputFilePath = path.join(rootDir, opts.outputFilePath);
|
||||
|
||||
+96
-58
@@ -34,23 +34,27 @@ This page was automatically generated on ${formattedDate}.
|
||||
fs.writeFileSync(markdownFile, markdownContent);
|
||||
}
|
||||
|
||||
async function deleteExistingAttachments() {
|
||||
try {
|
||||
const files = fs.readdirSync(attachmentDestination);
|
||||
function deleteExistingAttachments() {
|
||||
const files = fs.readdirSync(attachmentDestination);
|
||||
|
||||
for (const file of files) {
|
||||
if (path.extname(file) === '.png') {
|
||||
fs.unlinkSync(path.join(attachmentDestination, file));
|
||||
console.log(`Deleted ${file}`);
|
||||
}
|
||||
for (const file of files) {
|
||||
if (path.extname(file) === '.png') {
|
||||
fs.unlinkSync(path.join(attachmentDestination, file));
|
||||
console.log(`Deleted ${file}`);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
}
|
||||
|
||||
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({
|
||||
user: config.EMAIL,
|
||||
password: config.EMAIL_APP_PASSWORD,
|
||||
@@ -59,7 +63,9 @@ const imap = new Imap({
|
||||
tls: true,
|
||||
tlsOptions: {
|
||||
rejectUnauthorized: false
|
||||
}
|
||||
},
|
||||
connTimeout: CONNECT_TIMEOUT_MS,
|
||||
authTimeout: AUTH_TIMEOUT_MS
|
||||
});
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
const timeout = setTimeout(() => {
|
||||
console.log('Timeout');
|
||||
function sleep(ms) {
|
||||
return new Promise(resolve => setTimeout(resolve, ms));
|
||||
}
|
||||
|
||||
function fail(error) {
|
||||
console.error('Error:', error);
|
||||
process.exit(1);
|
||||
}, 10 * 60 * 1000);
|
||||
}
|
||||
|
||||
imap.once('ready', async () => {
|
||||
try {
|
||||
await openBoxAsync('INBOX');
|
||||
function connectAsync() {
|
||||
return new Promise((resolve, reject) => {
|
||||
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();
|
||||
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();
|
||||
} catch (error) {
|
||||
console.error('Error:', error);
|
||||
async function connectWithRetryAsync() {
|
||||
for (let attempt = 1; ; attempt++) {
|
||||
try {
|
||||
await connectAsync();
|
||||
return;
|
||||
} catch (error) {
|
||||
if (attempt === CONNECT_ATTEMPTS) {
|
||||
throw error;
|
||||
}
|
||||
console.error('Connection attempt %d/%d failed: %s', attempt, CONNECT_ATTEMPTS, error.message);
|
||||
await sleep(RETRY_DELAY_MS);
|
||||
}
|
||||
}
|
||||
clearTimeout(timeout);
|
||||
});
|
||||
}
|
||||
|
||||
imap.once('error', err => {
|
||||
console.error(err);
|
||||
});
|
||||
async function downloadStats() {
|
||||
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');
|
||||
});
|
||||
|
||||
imap.connect();
|
||||
setTimeout(() => fail(new Error(`Gave up after ${RUN_TIMEOUT_MS / 1000}s`)), RUN_TIMEOUT_MS);
|
||||
|
||||
downloadStats().then(() => {
|
||||
process.exit(0);
|
||||
}).catch(fail);
|
||||
Reference in new issue
Block a user