Enable brighterscript, create NPM build scripts, install and use roku-log, and use bsc import statements (#1173)

This commit is contained in:
Charles Ewert 2023-05-03 17:21:04 -04:00 committed by GitHub
parent 92e1535f88
commit 2389af0868
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
215 changed files with 1543 additions and 1720 deletions

View File

@ -1,4 +1,4 @@
name: build
name: build-dev
on:
pull_request:
@ -17,11 +17,14 @@ jobs:
with:
node-version: "lts/*"
cache: "npm"
- run: npm ci
- run: npx ropm install
- run: make dev
- name: NPM install
run: npm ci
- name: Install roku module dependencies
run: npx ropm install
- name: Build app
run: npm run build
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3
with:
name: Jellyfin-Roku-dev-${{ github.sha }}
path: ${{ github.workspace }}/out/staging
path: ${{ github.workspace }}/build/staging
if-no-files-found: error

View File

@ -1,4 +1,4 @@
name: build
name: build-prod
on:
pull_request:
@ -66,11 +66,14 @@ jobs:
with:
node-version: "lts/*"
cache: "npm"
- run: npm ci
- run: npx ropm install
- run: make release
- name: NPM install
run: npm ci
- name: Install roku module dependencies
run: npx ropm install
- name: Build app for production
run: npm run build-prod
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3
with:
name: Jellyfin-Roku-release-${{ github.sha }}
path: ${{ github.workspace }}/out/staging
name: Jellyfin-Roku-v${{ env.newManVersion }}-${{ github.sha }}
path: ${{ github.workspace }}/build/staging
if-no-files-found: error

10
.vscode/launch.json vendored
View File

@ -5,6 +5,8 @@
"type": "brightscript",
"request": "launch",
"name": "Jellyfin Debug",
"rootDir": "${workspaceFolder}/build/staging",
"preLaunchTask": "build-dev",
"stopOnEntry": false,
// To enable RALE:
// set "brightscript.debug.raleTrackerTaskFileLocation": "/absolute/path/to/rale/TrackerTask.xml" in your vscode user settings
@ -14,14 +16,6 @@
//"host": "${promptForHost}",
//WARNING: don't edit this value. Instead, set "brightscript.debug.password": "YOUR_PASSWORD_HERE" in your vscode user settings
//"password": "${promptForPassword}",
"files": [
"components/**/*",
"images/**/*",
"locale/**/*",
"settings/**/*",
"source/**/*",
"manifest"
]
},
{
"name": "Run tests",

View File

@ -10,5 +10,6 @@
},
"xml.format.maxLineWidth": 0,
"editor.formatOnSave": true,
"brightscript.output.hyperlinkFormat": "FilenameAndFunction",
"brightscript.bsdk": "node_modules/brighterscript"
}

40
.vscode/tasks.json vendored
View File

@ -1,6 +1,42 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "build-dev",
"type": "shell",
"command": "npm run build",
"problemMatcher": [],
"presentation": {
"echo": true,
"focus": false,
"panel": "shared",
"showReuseMessage": false,
"clear": true
},
"group": {
"kind": "build",
"isDefault": true
}
},
{
"label": "build-prod",
"type": "shell",
"command": "npm run build-prod",
"problemMatcher": [],
"presentation": {
"echo": true,
"focus": false,
"panel": "shared",
"showReuseMessage": false,
"clear": true
},
"group": {
"kind": "build",
"isDefault": true
}
},
{
"label": "build-tests",
"type": "shell",
@ -8,7 +44,7 @@
"problemMatcher": [],
"presentation": {
"echo": true,
"reveal": "silent",
"reveal": "always",
"focus": false,
"panel": "shared",
"showReuseMessage": false,
@ -26,7 +62,7 @@
"problemMatcher": [],
"presentation": {
"echo": true,
"reveal": "silent",
"reveal": "always",
"focus": false,
"panel": "shared",
"showReuseMessage": false,

37
bsconfig-prod.json Normal file
View File

@ -0,0 +1,37 @@
{
"files": [
"manifest",
"source/**/*.*",
"components/**/*.*",
"images/**/*.*",
"locale/en_US/translations.ts",
"locale/en_GB/translations.ts",
"locale/fr_CA/translations.ts",
"locale/es_ES/translations.ts",
"locale/de_DE/translations.ts",
"locale/it_IT/translations.ts",
"locale/pt_BR/translations.ts",
"settings/**/*.*",
{
"src": "resources/branding/release/*.*",
"dest": "images"
}
],
"plugins": [
"@rokucommunity/bslint",
"roku-log-bsc-plugin"
],
"rokuLog": {
"strip": true,
"insertPkgPath": false,
"removeComments": true
},
"diagnosticFilters": [
"node_modules/**/*",
"**/roku_modules/**/*"
],
"allowBrighterScriptInBrightScript": true,
"autoImportComponentScript": true,
"stagingDir": "build/staging",
"retainStagingDir": true
}

View File

@ -20,7 +20,12 @@
"dest": "settings"
}
],
"diagnosticFilters": [
"node_modules/**/*",
"**/roku_modules/**/*"
],
"autoImportComponentScript": true,
"allowBrighterScriptInBrightScript": true,
"createPackage": false,
"stagingFolderPath": "build",
"plugins": [

View File

@ -10,10 +10,18 @@
],
"plugins": [
"@rokucommunity/bslint",
"rooibos-roku"
"roku-log-bsc-plugin"
],
"rokuLog": {
"insertPkgPath": true
},
"diagnosticFilters": [
"node_modules/**",
"**/roku_modules/**"
]
"node_modules/**/*",
"**/roku_modules/**/*"
],
"sourceMap": true,
"autoImportComponentScript": true,
"allowBrighterScriptInBrightScript": true,
"stagingDir": "build/staging",
"retainStagingDir": true
}

View File

@ -4,6 +4,7 @@
"source/**/*.bs",
"components/**/*.brs",
"components/**/*.bs",
"test-app/**/*.bs"
"test-app/**/*.bs",
"!**/roku_modules/**/*.*"
]
}

View File

@ -3,7 +3,4 @@
<interface>
<field id="escape" type="string" alwaysNotify="true" />
</interface>
<script type="text/brightscript" uri="ButtonGroupHoriz.brs" />
</component>

View File

@ -25,5 +25,4 @@
<field id="focusedIndex" type="integer" alwaysNotify="true" />
<field id="selectedIndex" type="integer" onChange="selectedIndexChanged" />
</interface>
<script type="text/brightscript" uri="JFButtons.brs" />
</component>

View File

@ -12,5 +12,4 @@
<field id="width" type="array" />
<field id="height" type="int" />
</interface>
<script type="text/brightscript" uri="TextSizeTask.brs" />
</component>

View File

@ -1,3 +1,6 @@
import "pkg:/source/utils/config.brs"
import "pkg:/source/roku_modules/api/api.brs"
sub init()
m.top.functionName = "getNextEpisodeTask"
end sub

View File

@ -6,7 +6,4 @@
<field id="showID" type="string" />
<field id="nextEpisodeData" type="assocarray" />
</interface>
<script type="text/brightscript" uri="GetNextEpisodeTask.brs" />
<script type="text/brightscript" uri="pkg:/source/utils/config.brs" />
<script type="text/brightscript" uri="pkg:/source/roku_modules/api/api.brs" />
</component>

View File

@ -1,3 +1,9 @@
import "pkg:/source/utils/config.brs"
import "pkg:/source/utils/misc.brs"
import "pkg:/source/utils/deviceCapabilities.brs"
import "pkg:/source/api/baserequest.brs"
import "pkg:/source/roku_modules/api/api.brs"
sub init()
m.top.functionName = "getPlaybackInfoTask"
end sub

View File

@ -5,10 +5,4 @@
<field id="videoID" type="string" />
<field id="data" type="assocarray" />
</interface>
<script type="text/brightscript" uri="GetPlaybackInfoTask.brs" />
<script type="text/brightscript" uri="pkg:/source/utils/config.brs" />
<script type="text/brightscript" uri="pkg:/source/utils/misc.brs" />
<script type="text/brightscript" uri="pkg:/source/utils/deviceCapabilities.brs" />
<script type="text/brightscript" uri="pkg:/source/api/baserequest.brs" />
<script type="text/brightscript" uri="pkg:/source/roku_modules/api/api.brs" />
</component>

View File

@ -1,3 +1,6 @@
import "pkg:/source/utils/config.brs"
import "pkg:/source/roku_modules/api/api.brs"
sub init()
m.top.functionName = "getShuffleEpisodesTask"
end sub

View File

@ -5,7 +5,4 @@
<field id="showID" type="string" />
<field id="data" type="assocarray" />
</interface>
<script type="text/brightscript" uri="GetShuffleEpisodesTask.brs" />
<script type="text/brightscript" uri="pkg:/source/utils/config.brs" />
<script type="text/brightscript" uri="pkg:/source/roku_modules/api/api.brs" />
</component>

View File

@ -17,5 +17,4 @@
<field id="focus" type="boolean" />
<field id="escape" type="string" value="" />
</interface>
<script type="text/brightscript" uri="IconButton.brs" />
</component>

View File

@ -51,5 +51,4 @@
<field id="focusedChild" type="node" onChange="focusChanged" />
<field id="itemAlphaSelected" type="string" />
</interface>
<script type="text/brightscript" uri="Alpha.brs" />
</component>

View File

@ -1,3 +1,7 @@
import "pkg:/source/api/UserLibrary.brs"
import "pkg:/source/api/baserequest.brs"
import "pkg:/source/utils/config.brs"
sub init()
m.top.functionName = "setFavoriteStatus"
end sub

View File

@ -5,8 +5,4 @@
<field id="itemId" type="string" />
<field id="favTask" type="string" value="" />
</interface>
<script type="text/brightscript" uri="FavoriteItemsTask.brs" />
<script type="text/brightscript" uri="pkg:/source/api/UserLibrary.brs" />
<script type="text/brightscript" uri="pkg:/source/api/baserequest.brs" />
<script type="text/brightscript" uri="pkg:/source/utils/config.brs" />
</component>

View File

@ -1,4 +1,9 @@
import "pkg:/source/utils/config.brs"
import "pkg:/source/utils/misc.brs"
import "pkg:/source/roku_modules/log/LogMixin.brs"
sub init()
m.log = log.Logger("GridItem")
m.posterMask = m.top.findNode("posterMask")
m.itemPoster = m.top.findNode("itemPoster")
m.itemIcon = m.top.findNode("itemIcon")
@ -117,7 +122,7 @@ sub itemContentChanged()
m.posterText.height = 200
m.posterText.width = 280
else
print "Unhandled Grid Item Type: " + itemData.type
m.log.warn("Unhandled Grid Item Type", itemData.type)
end if
'If Poster not loaded, ensure "blue box" is shown until loaded

View File

@ -18,7 +18,4 @@
<field id="itemHasFocus" type="boolean" onChange="focusChanged" />
<field id="focusPercent" type="float" onChange="focusChanging" />
</interface>
<script type="text/brightscript" uri="GridItem.brs" />
<script type="text/brightscript" uri="pkg:/source/utils/config.brs" />
<script type="text/brightscript" uri="pkg:/source/utils/misc.brs" />
</component>

View File

@ -1,3 +1,6 @@
import "pkg:/source/utils/misc.brs"
import "pkg:/source/utils/config.brs"
sub init()
m.itemPoster = m.top.findNode("itemPoster")
m.posterText = m.top.findNode("posterText")

View File

@ -11,7 +11,4 @@
<field id="itemContent" type="node" onChange="itemContentChanged" />
<field id="itemHasFocus" type="boolean" onChange="focusChanged" alwaysNotify="true" />
</interface>
<script type="text/brightscript" uri="GridItemSmall.brs" />
<script type="text/brightscript" uri="pkg:/source/utils/misc.brs" />
<script type="text/brightscript" uri="pkg:/source/utils/config.brs" />
</component>

View File

@ -1,5 +1,11 @@
sub init()
import "pkg:/source/utils/misc.brs"
import "pkg:/source/utils/config.brs"
import "pkg:/source/api/baserequest.brs"
import "pkg:/source/utils/deviceCapabilities.brs"
import "pkg:/source/roku_modules/log/LogMixin.brs"
sub init()
m.log = log.Logger("ItemGrid")
m.options = m.top.findNode("options")
m.showItemCount = get_user_setting("itemgrid.showItemCount") = "true"
@ -206,7 +212,7 @@ sub loadInitialItems()
m.loadItemsTask.itemType = "Series,Movie"
m.loadItemsTask.itemId = m.top.parentItem.parentFolder
else
print "[ItemGrid] Unknown Type: " m.top.parentItem
m.log.warn("Unknown Item Type", m.top.parentItem)
end if
if m.top.parentItem.type <> "Folder" and (m.options.view = "Networks" or m.view = "Networks" or m.options.view = "Studios" or m.view = "Studios")

View File

@ -39,9 +39,4 @@
<field id="alphaActive" type="boolean" value="false" />
<field id="jumpToItem" type="integer" value="" />
</interface>
<script type="text/brightscript" uri="pkg:/source/utils/misc.brs" />
<script type="text/brightscript" uri="pkg:/source/utils/config.brs" />
<script type="text/brightscript" uri="pkg:/source/api/baserequest.brs" />
<script type="text/brightscript" uri="pkg:/source/utils/deviceCapabilities.brs" />
<script type="text/brightscript" uri="ItemGrid.brs" />
</component>

View File

@ -1,5 +1,8 @@
sub init()
import "pkg:/source/utils/misc.brs"
import "pkg:/source/roku_modules/log/LogMixin.brs"
sub init()
m.log = log.Logger("ItemGridOptions")
m.buttons = m.top.findNode("buttons")
m.buttons.buttons = [tr("View"), tr("Sort"), tr("Filter")]
m.buttons.selectedIndex = 1
@ -203,7 +206,7 @@ sub setHeartColor(color as string)
end if
end for
catch e
print e.number, e.message
m.log.error("setHeartColor()", e.number, e.message)
end try
end sub

View File

@ -52,6 +52,4 @@
<field id="favorite" type="string" value="Favorite" />
</interface>
<script type="text/brightscript" uri="ItemGridOptions.brs" />
<script type="text/brightscript" uri="pkg:/source/utils/misc.brs" />
</component>

View File

@ -1,4 +1,14 @@
import "pkg:/source/api/Items.brs"
import "pkg:/source/roku_modules/api/api.brs"
import "pkg:/source/api/baserequest.brs"
import "pkg:/source/utils/config.brs"
import "pkg:/source/utils/misc.brs"
import "pkg:/source/api/Image.brs"
import "pkg:/source/utils/deviceCapabilities.brs"
import "pkg:/source/roku_modules/log/LogMixin.brs"
sub init()
m.log = log.Logger("LoadItemsTask2")
m.top.functionName = "loadItems"
m.top.limit = 60
@ -235,7 +245,7 @@ sub loadItems()
tmp.posterUrl = api_API().items.getimageurl(item.id, "primary", 0, { "maxHeight": 280, "maxWidth": 280, "quality": "90" })
else
print "[LoadItems] Unknown Type: " item.Type
m.log.warn("Unknown Type", item.Type)
end if
if tmp <> invalid

View File

@ -21,12 +21,4 @@
<field id="totalRecordCount" type="int" value="-1" />
<field id="content" type="array" />
</interface>
<script type="text/brightscript" uri="LoadItemsTask2.brs" />
<script type="text/brightscript" uri="pkg:/source/api/Items.brs" />
<script type="text/brightscript" uri="pkg:/source/roku_modules/api/api.brs" />
<script type="text/brightscript" uri="pkg:/source/api/baserequest.brs" />
<script type="text/brightscript" uri="pkg:/source/utils/config.brs" />
<script type="text/brightscript" uri="pkg:/source/utils/misc.brs" />
<script type="text/brightscript" uri="pkg:/source/api/Image.brs" />
<script type="text/brightscript" uri="pkg:/source/utils/deviceCapabilities.brs" />
</component>

View File

@ -1,3 +1,13 @@
import "pkg:/source/utils/misc.brs"
import "pkg:/source/api/Items.brs"
import "pkg:/source/api/UserLibrary.brs"
import "pkg:/source/roku_modules/api/api.brs"
import "pkg:/source/api/baserequest.brs"
import "pkg:/source/utils/config.brs"
import "pkg:/source/api/Image.brs"
import "pkg:/source/api/userauth.brs"
import "pkg:/source/utils/deviceCapabilities.brs"
sub init()
m.top.functionName = "loadItems"

View File

@ -20,14 +20,4 @@
<field id="totalRecordCount" type="int" value="-1" />
<field id="content" type="array" />
</interface>
<script type="text/brightscript" uri="LoadVideoContentTask.brs" />
<script type="text/brightscript" uri="pkg:/source/utils/misc.brs" />
<script type="text/brightscript" uri="pkg:/source/api/Items.brs" />
<script type="text/brightscript" uri="pkg:/source/api/UserLibrary.brs" />
<script type="text/brightscript" uri="pkg:/source/roku_modules/api/api.brs" />
<script type="text/brightscript" uri="pkg:/source/api/baserequest.brs" />
<script type="text/brightscript" uri="pkg:/source/utils/config.brs" />
<script type="text/brightscript" uri="pkg:/source/api/Image.brs" />
<script type="text/brightscript" uri="pkg:/source/api/userauth.brs" />
<script type="text/brightscript" uri="pkg:/source/utils/deviceCapabilities.brs" />
</component>

View File

@ -1,3 +1,10 @@
import "pkg:/source/utils/misc.brs"
import "pkg:/source/utils/config.brs"
import "pkg:/source/api/baserequest.brs"
import "pkg:/source/api/Image.brs"
import "pkg:/source/utils/deviceCapabilities.brs"
import "pkg:/source/roku_modules/api/api.brs"
sub setupNodes()
m.options = m.top.findNode("options")
m.itemGrid = m.top.findNode("itemGrid")

View File

@ -57,11 +57,4 @@
<field id="showItemTitles" type="string" value="showonhover" />
<field id="jumpToItem" type="integer" value="" />
</interface>
<script type="text/brightscript" uri="pkg:/source/utils/misc.brs" />
<script type="text/brightscript" uri="pkg:/source/utils/config.brs" />
<script type="text/brightscript" uri="pkg:/source/api/baserequest.brs" />
<script type="text/brightscript" uri="pkg:/source/api/Image.brs" />
<script type="text/brightscript" uri="pkg:/source/utils/deviceCapabilities.brs" />
<script type="text/brightscript" uri="MovieLibraryView.brs" />
<script type="text/brightscript" uri="pkg:/source/roku_modules/api/api.brs" />
</component>

View File

@ -1,3 +1,6 @@
import "pkg:/source/utils/misc.brs"
import "pkg:/source/utils/config.brs"
sub init()
m.itemPoster = m.top.findNode("itemPoster")
m.postTextBackground = m.top.findNode("postTextBackground")

View File

@ -11,7 +11,4 @@
<field id="itemContent" type="node" onChange="itemContentChanged" />
<field id="itemHasFocus" type="boolean" onChange="focusChanged" />
</interface>
<script type="text/brightscript" uri="MusicArtistGridItem.brs" />
<script type="text/brightscript" uri="pkg:/source/utils/misc.brs" />
<script type="text/brightscript" uri="pkg:/source/utils/config.brs" />
</component>

View File

@ -1,3 +1,9 @@
import "pkg:/source/utils/misc.brs"
import "pkg:/source/utils/config.brs"
import "pkg:/source/api/baserequest.brs"
import "pkg:/source/api/Image.brs"
import "pkg:/source/utils/deviceCapabilities.brs"
sub setupNodes()
m.options = m.top.findNode("options")
m.itemGrid = m.top.findNode("itemGrid")

View File

@ -42,10 +42,4 @@
<field id="showItemTitles" type="string" value="showonhover" />
<field id="jumpToItem" type="integer" value="" />
</interface>
<script type="text/brightscript" uri="pkg:/source/utils/misc.brs" />
<script type="text/brightscript" uri="pkg:/source/utils/config.brs" />
<script type="text/brightscript" uri="pkg:/source/api/baserequest.brs" />
<script type="text/brightscript" uri="pkg:/source/api/Image.brs" />
<script type="text/brightscript" uri="pkg:/source/utils/deviceCapabilities.brs" />
<script type="text/brightscript" uri="MusicLibraryView.brs" />
</component>

View File

@ -3,5 +3,4 @@
<interface>
<field id="minChars" type="int" />
</interface>
<script type="text/brightscript" uri="JFButton.brs" />
</component>

View File

@ -7,5 +7,4 @@
<field id="optionsAvailable" value="true" type="boolean" />
<field id="overhangVisible" value="true" type="boolean" />
</interface>
<script type="text/brightscript" uri="JFGroup.brs" />
</component>

View File

@ -20,5 +20,4 @@
<field id="fontHeight" type="integer" />
<field id="fontWidth" type="integer" />
</interface>
<script type="text/brightscript" uri="JFMessageDialog.brs" />
</component>

View File

@ -1,3 +1,5 @@
import "pkg:/source/utils/config.brs"
sub init()
m.top.id = "overhang"
' hide seperators till they're needed

View File

@ -40,6 +40,4 @@
<field id="disableMoveAnimation" value="false" type="boolean" />
<function name="resetTime" />
</interface>
<script type="text/brightscript" uri="JFOverhang.brs" />
<script type="text/brightscript" uri="pkg:/source/utils/config.brs" />
</component>

View File

@ -1,3 +1,5 @@
import "pkg:/source/utils/misc.brs"
sub init()
m.top.backgroundColor = "#262626" '"#101010"
m.top.backgroundURI = ""

View File

@ -7,6 +7,4 @@
<interface>
<field id="exit" type="boolean" alwaysNotify="true" />
</interface>
<script type="text/brightscript" uri="JFScene.brs" />
<script type="text/brightscript" uri="pkg:/source/utils/misc.brs" />
</component>

View File

@ -1,3 +1,10 @@
import "pkg:/source/roku_modules/log/LogMixin.brs"
sub init()
' initialize the log manager. second param sets log output:
' 1 error, 2 warn, 3 info, 4 verbose, 5 debug
_rLog = log_initializeLogManager(["log_PrintTransport"], 5) 'bs:disable-line
end sub
' Function called when the screen is displayed by the screen manager
' It is expected that screens override this function to handle focus
' managmenet and any other actions required on screen shown
@ -14,3 +21,4 @@ end sub
' to handle focus any actions required on the screen being hidden
sub OnScreenHidden()
end sub

View File

@ -4,5 +4,4 @@
<function name="OnScreenShown" />
<function name="OnScreenHidden" />
</interface>
<script type="text/brightscript" uri="JFScreen.brs" />
</component>

View File

@ -1,3 +1,7 @@
import "pkg:/source/utils/misc.brs"
import "pkg:/source/utils/config.brs"
import "pkg:/source/roku_modules/api/api.brs"
sub init()
m.playbackTimer = m.top.findNode("playbackTimer")
m.bufferCheckTimer = m.top.findNode("bufferCheckTimer")

View File

@ -23,11 +23,6 @@
<field id="mediaSourceId" type="string" />
<field id="audioIndex" type="integer" />
</interface>
<script type="text/brightscript" uri="JFVideo.brs" />
<script type="text/brightscript" uri="pkg:/source/utils/misc.brs" />
<script type="text/brightscript" uri="pkg:/source/utils/config.brs" />
<script type="text/brightscript" uri="pkg:/source/roku_modules/api/api.brs" />
<children>
<Group id="captionGroup" translation="[960,1020]"></Group>

View File

@ -1,3 +1,6 @@
import "pkg:/source/utils/config.brs"
import "pkg:/source/utils/misc.brs"
sub init()
m.title = m.top.findNode("title")
m.staticTitle = m.top.findNode("staticTitle")

View File

@ -16,7 +16,4 @@
<field id="itemWidth" type="integer" />
<field id="itemHasFocus" type="boolean" onChange="focusChanged" />
</interface>
<script type="text/brightscript" uri="ListPoster.brs" />
<script type="text/brightscript" uri="pkg:/source/utils/config.brs" />
<script type="text/brightscript" uri="pkg:/source/utils/misc.brs" />
</component>

View File

@ -0,0 +1,17 @@
sub setTitle()
m.top.findNode("titleArea").primaryTitle = m.top.title
end sub
sub setOverview()
m.top.findNode("description").text = m.top.overview
end sub
function onKeyEvent(key as string, press as boolean) as boolean
if press = false then return false
if key = "OK" and m.top.findNode("contentArea").isInFocusChain()
m.top.close = true
end if
return false
end function

View File

@ -4,27 +4,6 @@
<field id="Title" type="string" onchange="setTitle" />
<field id="Overview" type="string" onChange="setOverview" />
</interface>
<script type="text/brightscript">
<![CDATA[
sub setTitle()
m.top.findNode("titleArea").primaryTitle = m.top.title
end sub
sub setOverview()
m.top.findNode("description").text = m.top.overview
end sub
function onKeyEvent(key as string, press as boolean) as boolean
if press = false then return false
if key = "OK" and m.top.findNode("contentArea").isInFocusChain()
m.top.close = true
end if
return false
end function
]]>
</script>
<children>
<StdDlgTitleArea id="titleArea" />
<StdDlgContentArea id="contentArea">

View File

@ -1,3 +1,7 @@
import "pkg:/source/api/Image.brs"
import "pkg:/source/api/baserequest.brs"
import "pkg:/source/utils/config.brs"
sub init()
m.dscr = m.top.findNode("description")
m.vidsList = m.top.findNode("extrasGrid")

View File

@ -37,8 +37,4 @@
</LayoutGroup>
<extrasSlider id="personVideos" />
</children>
<script type="text/brightscript" uri="PersonDetails.brs" />
<script type="text/brightscript" uri="pkg:/source/api/Image.brs" />
<script type="text/brightscript" uri="pkg:/source/api/baserequest.brs" />
<script type="text/brightscript" uri="pkg:/source/utils/config.brs" />
</component>

View File

@ -2,5 +2,5 @@
<!-- A PlaybackDialog is a regular dialog, except it takes key releases -->
<!-- instead of presses so that key releases don't fall into other listeners -->
<component name="PlaybackDialog" extends="Dialog">
<script type="text/brightscript" uri="PlaybackDialog.brs" />
</component>

View File

@ -3,5 +3,4 @@
<children>
<Label id="checkmark" width="60" height="50" font="font:MediumBoldSystemFont" horizAlign="center" vertAlign="bottom" text="✓" />
</children>
<script type="text/brightscript" uri="PlayedCheckmark.brs" />
</component>

View File

@ -1,3 +1,6 @@
import "pkg:/source/api/baserequest.brs"
import "pkg:/source/utils/config.brs"
sub init()
m.top.functionName = "PlaystateUpdate"
end sub

View File

@ -5,7 +5,4 @@
<field id="status" type="string" />
<field id="params" type="assocarray" />
</interface>
<script type="text/brightscript" uri="PlaystateTask.brs" />
<script type="text/brightscript" uri="pkg:/source/api/baserequest.brs" />
<script type="text/brightscript" uri="pkg:/source/utils/config.brs" />
</component>

View File

@ -1,3 +1,5 @@
import "pkg:/source/utils/misc.brs"
sub init()
m.content = m.top.findNode("content")
m.top.observeField("contentData", "onContentDataChanged")

View File

@ -8,6 +8,4 @@
<interface>
<field id="contentData" type="assocarray" />
</interface>
<script type="text/brightscript" uri="RadioDialog.brs" />
<script type="text/brightscript" uri="pkg:/source/utils/misc.brs" />
</component>

View File

@ -1,3 +1,9 @@
import "pkg:/source/api/Items.brs"
import "pkg:/source/api/baserequest.brs"
import "pkg:/source/utils/config.brs"
import "pkg:/source/api/Image.brs"
import "pkg:/source/utils/deviceCapabilities.brs"
sub init()
m.top.layoutDirection = "vert"
m.top.horizAlignment = "center"

View File

@ -7,10 +7,4 @@
<interface>
<field id="search_values" type="string" alwaysNotify="true" />
</interface>
<script type="text/brightscript" uri="SearchBox.brs" />
<script type="text/brightscript" uri="pkg:/source/api/Items.brs" />
<script type="text/brightscript" uri="pkg:/source/api/baserequest.brs" />
<script type="text/brightscript" uri="pkg:/source/utils/config.brs" />
<script type="text/brightscript" uri="pkg:/source/api/Image.brs" />
<script type="text/brightscript" uri="pkg:/source/utils/deviceCapabilities.brs" />
</component>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<component name="Spinner" extends="BusySpinner">
<script type="text/brightscript" uri="Spinner.brs" />
</component>

View File

@ -6,5 +6,4 @@
<interface>
<field id="contentData" type="assocarray" />
</interface>
<script type="text/brightscript" uri="StandardDialog.brs" />
</component>

View File

@ -3,5 +3,4 @@
<children>
<StdDlgContentArea id="content" />
</children>
<script type="text/brightscript" uri="WhatsNewDialog.brs" />
</component>

View File

@ -1,3 +1,6 @@
import "pkg:/source/utils/config.brs"
import "pkg:/source/api/baserequest.brs"
sub init()
m.top.observeField("url", "fetchCaption")
m.top.currentCaption = []

View File

@ -6,9 +6,6 @@
<field id="playerState" type="string" value="stopped" />
<field id="currentPos" type="int" />
</interface>
<script type="text/brightscript" uri="captionTask.brs" />
<script type="text/brightscript" uri="pkg:/source/utils/config.brs" />
<script type="text/brightscript" uri="pkg:/source/api/baserequest.brs" />
<children>
<timer id="captionTimer" repeat="true" duration="0.1" />
</children>

View File

@ -5,5 +5,4 @@
<field id="value" type="string" />
<field id="type" type="string" />
</interface>
<script type="text/brightscript" uri="ConfigData.brs" />
</component>

View File

@ -11,6 +11,4 @@
<field id="itemContent" type="node" onChange="itemContentChanged" />
<field id="itemHasFocus" type="boolean" onChange="setColors" />
</interface>
<script type="text/brightscript" uri="ConfigItem.brs" />
</component>

View File

@ -1,3 +1,5 @@
import "pkg:/source/utils/config.brs"
sub init()
m.top.itemComponentName = "ConfigItem"

View File

@ -3,6 +3,4 @@
<interface>
<field id="configItems" type="nodearray" onChange="setData" />
</interface>
<script type="text/brightscript" uri="pkg:/source/utils/config.brs" />
<script type="text/brightscript" uri="ConfigList.brs" />
</component>

View File

@ -15,7 +15,6 @@ sub itemContentChanged() as void
end sub
sub onFocusPercentChange(event)
'print "focusPercentChange: " ; event.getData()
setTextColor(event.getData())
end sub

View File

@ -6,8 +6,6 @@
<field id="focusPercent" type="float" onchange="onFocusPercentChange" />
</interface>
<script type="text/brightscript" uri="JFServer.brs" />
<children>
<Poster id="poster" translation="[0,5]" width="90" height="90" />
<Group id="labels" translation="[100,0]">

View File

@ -30,5 +30,4 @@
duration="3"
repeat="true" />
</children>
<script type="text/brightscript" uri="LoginScene.brs"/>
</component>

View File

@ -1,7 +1,10 @@
import "pkg:/source/roku_modules/log/LogMixin.brs"
'
' Task used to discover jellyfin servers on the local network
'
sub init()
m.log = log.Logger("ServerDiscoveryTask")
m.top.functionName = "execute"
end sub
@ -36,7 +39,7 @@ sub execute()
end while
m.top.content = m.servers
print m.servers[0], m.servers[1], m.servers[2]
m.log.debug("Jellyfin servers found", m.servers[0], m.servers[1], m.servers[2])
end sub
sub AddServer(server)
@ -75,9 +78,9 @@ sub ProcessClientDiscoveryResponse(message)
iconWidth: 120,
iconHeight: 120
})
print "Found Jellyfin server using client discovery at " + server.Address
m.log.info("Found Jellyfin server using client discovery", server.Address)
catch e
print "Error scanning for jellyfin server", message
m.log.error("Error scanning for jellyfin server", message)
end try
end if
end sub
@ -122,7 +125,7 @@ sub ProcessSSDPResponse(message)
if locationUrl = invalid
return
else if m.locationUrlMap[locationUrl] <> invalid
print "Already discovered this location " + locationUrl
m.log.warn("Already discovered this location", locationUrl)
return
end if
@ -162,7 +165,7 @@ sub ProcessSSDPResponse(message)
end if
end for
AddServer(server)
print "Found jellyfin server using SSDP and DLNA at " + server.baseUrl
m.log.info("Found jellyfin server using SSDP and DLNA", server.baseUrl)
end if
end if
end sub

View File

@ -3,5 +3,4 @@
<interface>
<field id="content" type="array" />
</interface>
<script type="text/brightscript" uri="ServerDiscoveryTask.brs" />
</component>

View File

@ -1,4 +1,8 @@
import "pkg:/source/roku_modules/log/LogMixin.brs"
import "pkg:/source/utils/config.brs"
sub init()
m.log = log.Logger("SetServerScreen")
m.top.setFocus(true)
m.spinner = m.top.findNode("spinner")
@ -14,7 +18,7 @@ sub init()
end sub
function onKeyEvent(key as string, press as boolean) as boolean
print "SetServerScreen onKeyEvent", key, press
m.log.debug("SetServerScreen onKeyEvent", key, press)
if not press then return true
handled = true

View File

@ -35,8 +35,4 @@
<OptionsSlider id="options" />
</children>
<script type="text/brightscript" uri="SetServerScreen.brs" />
<script type="text/brightscript" uri="pkg:/source/utils/config.brs" />
</component>

View File

@ -5,5 +5,4 @@
<field id="title" type="string" />
<field id="json" type="assocarray" onChange="setFields" />
</interface>
<script type="text/brightscript" uri="AlbumData.brs" />
</component>

View File

@ -1,3 +1,7 @@
import "pkg:/source/api/Image.brs"
import "pkg:/source/api/baserequest.brs"
import "pkg:/source/utils/config.brs"
sub setFields()
json = m.top.json
m.top.id = json.id

View File

@ -3,8 +3,4 @@
<interface>
<field id="channelID" type="string" />
</interface>
<script type="text/brightscript" uri="ChannelData.brs" />
<script type="text/brightscript" uri="pkg:/source/api/Image.brs" />
<script type="text/brightscript" uri="pkg:/source/api/baserequest.brs" />
<script type="text/brightscript" uri="pkg:/source/utils/config.brs" />
</component>

View File

@ -1,3 +1,7 @@
import "pkg:/source/api/Image.brs"
import "pkg:/source/api/baserequest.brs"
import "pkg:/source/utils/config.brs"
sub setFields()
json = m.top.json

View File

@ -5,8 +5,4 @@
<field id="description" type="string" />
<field id="overview" type="string" value="boxsets" />
</interface>
<script type="text/brightscript" uri="CollectionData.brs" />
<script type="text/brightscript" uri="pkg:/source/api/Image.brs" />
<script type="text/brightscript" uri="pkg:/source/api/baserequest.brs" />
<script type="text/brightscript" uri="pkg:/source/utils/config.brs" />
</component>

View File

@ -1,3 +1,7 @@
import "pkg:/source/api/Image.brs"
import "pkg:/source/api/baserequest.brs"
import "pkg:/source/utils/config.brs"
sub setFields()
json = m.top.json

View File

@ -1,7 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<component name="FolderData" extends="JFContentItem">
<script type="text/brightscript" uri="FolderData.brs" />
<script type="text/brightscript" uri="pkg:/source/api/Image.brs" />
<script type="text/brightscript" uri="pkg:/source/api/baserequest.brs" />
<script type="text/brightscript" uri="pkg:/source/utils/config.brs" />
</component>

View File

@ -1,3 +1,6 @@
import "pkg:/source/utils/config.brs"
import "pkg:/source/roku_modules/api/api.brs"
sub init()
m.top.functionName = "getFiltersTask"
end sub

View File

@ -1,11 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<component name="GetFiltersTask" extends="Task">
<interface>
<field id="params" type="assocarray" />
<field id="filters" type="assocarray" />
</interface>
<script type="text/brightscript" uri="GetFiltersTask.brs" />
<script type="text/brightscript" uri="pkg:/source/utils/config.brs" />
<script type="text/brightscript" uri="pkg:/source/roku_modules/api/api.brs" />
</component>

View File

@ -1,3 +1,7 @@
import "pkg:/source/api/baserequest.brs"
import "pkg:/source/utils/config.brs"
import "pkg:/source/api/Image.brs"
sub setData()
' We keep json around just as a reference,
' but ideally everything should be going through one of the interfaces

View File

@ -15,8 +15,4 @@
<field id="usePoster" type="bool" value="false" />
<field id="isWatched" type="bool" value="false" />
</interface>
<script type="text/brightscript" uri="pkg:/source/api/baserequest.brs" />
<script type="text/brightscript" uri="pkg:/source/utils/config.brs" />
<script type="text/brightscript" uri="pkg:/source/api/Image.brs" />
<script type="text/brightscript" uri="HomeData.brs" />
</component>

View File

@ -8,5 +8,4 @@
<field id="width" type="integer" />
<field id="url" type="string" />
</interface>
<script type="text/brightscript" uri="ImageData.brs" />
</component>

View File

@ -1,3 +1,8 @@
import "pkg:/source/api/Image.brs"
import "pkg:/source/api/baserequest.brs"
import "pkg:/source/utils/config.brs"
import "pkg:/source/utils/misc.brs"
sub setFields()
json = m.top.json

View File

@ -8,9 +8,4 @@
<field id="mediaSourceCount" type="integer" />
<field id="mediaSources" type="array" />
</interface>
<script type="text/brightscript" uri="MovieData.brs" />
<script type="text/brightscript" uri="pkg:/source/api/Image.brs" />
<script type="text/brightscript" uri="pkg:/source/api/baserequest.brs" />
<script type="text/brightscript" uri="pkg:/source/utils/config.brs" />
<script type="text/brightscript" uri="pkg:/source/utils/misc.brs" />
</component>

View File

@ -6,5 +6,4 @@
<field id="image" type="node" onChange="setPoster" />
<field id="overview" type="string" />
</interface>
<script type="text/brightscript" uri="MusicAlbumData.brs" />
</component>

View File

@ -1,3 +1,7 @@
import "pkg:/source/api/Image.brs"
import "pkg:/source/api/baserequest.brs"
import "pkg:/source/utils/config.brs"
sub setFields()
json = m.top.json
m.top.id = json.id

View File

@ -1,7 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<component name="MusicAlbumSongListData" extends="JFContentItem">
<script type="text/brightscript" uri="MusicAlbumSongListData.brs" />
<script type="text/brightscript" uri="pkg:/source/api/Image.brs" />
<script type="text/brightscript" uri="pkg:/source/api/baserequest.brs" />
<script type="text/brightscript" uri="pkg:/source/utils/config.brs" />
</component>

View File

@ -1,3 +1,7 @@
import "pkg:/source/api/Image.brs"
import "pkg:/source/api/baserequest.brs"
import "pkg:/source/utils/config.brs"
sub setFields()
json = m.top.json
m.top.id = json.id

View File

@ -1,7 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<component name="MusicArtistData" extends="JFContentItem">
<script type="text/brightscript" uri="MusicArtistData.brs" />
<script type="text/brightscript" uri="pkg:/source/api/Image.brs" />
<script type="text/brightscript" uri="pkg:/source/api/baserequest.brs" />
<script type="text/brightscript" uri="pkg:/source/utils/config.brs" />
</component>

Some files were not shown because too many files have changed in this diff Show More