diff --git a/builds/visionLabs-roku-smoketest.zip b/builds/visionLabs-roku-smoketest.zip index 9c0f147..1088f44 100644 Binary files a/builds/visionLabs-roku-smoketest.zip and b/builds/visionLabs-roku-smoketest.zip differ diff --git a/components/MainScene.brs b/components/MainScene.brs index 9d037df..d2a4ec6 100644 --- a/components/MainScene.brs +++ b/components/MainScene.brs @@ -37,8 +37,7 @@ sub loadConfig() end if cameras = config.cameras - m.status.text = cameras.count().toStr() + " cameras loaded, fetching snapshots..." - loadedCount = 0 + m.status.text = cameras.count().toStr() + " cameras loaded, snapshot-first prototype" for i = 0 to m.cameraNodes.count() - 1 poster = m.cameraPosters[i] @@ -56,25 +55,13 @@ sub loadConfig() label = label + chr(10) + "Frigate ID: " + camera.frigateCamera end if - snapshotUrl = buildSnapshotUrl(config, camera) - targetPath = "tmp:/" + camera.id + ".jpg" - result = fetchSnapshot(snapshotUrl, targetPath) - - if result.success then - poster.uri = targetPath - loadedCount = loadedCount + 1 - node.text = label - else - poster.uri = "" - node.text = label + chr(10) + "Snapshot failed (" + result.code.toStr() + ")" - end if + poster.uri = buildSnapshotUrl(config, camera) + node.text = label else poster.uri = "" node.text = "Empty slot" end if end for - - m.status.text = loadedCount.toStr() + " of " + cameras.count().toStr() + " snapshots loaded" end sub function buildSnapshotUrl(config as Object, camera as Object) as String @@ -101,24 +88,3 @@ function buildSnapshotUrl(config as Object, camera as Object) as String return baseUrl + path end function - -function fetchSnapshot(url as String, filePath as String) as Object - result = { - success: false - code: 0 - } - - if url = "" then - return result - end if - - transfer = CreateObject("roUrlTransfer") - transfer.SetCertificatesFile("common:/certs/ca-bundle.crt") - transfer.InitClientCertificates() - transfer.SetUrl(url) - - result.success = transfer.GetToFile(filePath) - result.code = transfer.GetResponseCode() - - return result -end function