Merge branch 'master' into addmusic

This commit is contained in:
Jimi 2022-06-01 17:27:59 -06:00 committed by GitHub
commit 49cb5483d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 458 additions and 169 deletions

View File

@ -9,25 +9,32 @@ function onKeyEvent(key as string, press as boolean) as boolean
list = m.top.findNode("configOptions")
checkbox = m.top.findNode("onOff")
button = m.top.findNode("submit")
submit = m.top.findNode("submit")
quickConnect = m.top.findNode("quickConnect")
if key = "back"
m.top.backPressed = true
else if key = "down" and checkbox.focusedChild = invalid and button.focusedChild = invalid
else if key = "down" and checkbox.focusedChild = invalid and submit.focusedChild = invalid
limit = list.content.getChildren(-1, 0).count() - 1
if limit = list.itemFocused
checkbox.setFocus(true)
return true
end if
else if key = "down" and button.focusedChild = invalid
button.setFocus(true)
else if key = "down" and submit.focusedChild = invalid
submit.setFocus(true)
return true
else if key = "up" and button.focusedChild <> invalid
else if key = "up" and submit.focusedChild <> invalid or quickConnect.focusedChild <> invalid
checkbox.setFocus(true)
return true
else if key = "up" and checkbox.focusedChild <> invalid
list.setFocus(true)
return true
else if key = "right" and submit.focusedChild <> invalid
quickConnect.setFocus(true)
return true
else if key = "left" and quickConnect.focusedChild <> invalid
submit.setFocus(true)
return true
end if
return false
end function

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8" ?>
<component name="ConfigScene" extends="JFGroup">
<component name="LoginScene" extends="JFGroup">
<children>
<label text="Enter Configuration"
id="prompt"
@ -14,14 +14,21 @@
<Button
id="submit"
text="Submit"
showFocusFootprint="false"
translation="[150, 550]" />
<Button
id="quickConnect"
translation="[550, 550]"
/>
<label text=""
id="alert"
wrap="true"
width="1620"
font="font:MediumSystemFont"
translation="[150, 680]" />
<Timer
id="quickConnectTimer"
duration="3"
repeat="true" />
</children>
<script type="text/brightscript" uri="ConfigScene.brs"/>
<script type="text/brightscript" uri="LoginScene.brs"/>
</component>

View File

@ -0,0 +1,13 @@
sub init()
m.top.functionName = "monitorQuickConnect"
end sub
sub monitorQuickConnect()
authenticated = checkQuickConnect(m.top.secret)
if authenticated = true
m.top.authenticated = 1
else
m.top.authenticated = -1
end if
end sub

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8" ?>
<component name="QuickConnect" extends="Task">
<interface>
<field id="secret" type="string" />
<field id="authenticated" type="integer" value="0"/>
</interface>
<script type="text/brightscript" uri="QuickConnect.brs" />
<script type="text/brightscript" uri="pkg:/source/api/userauth.brs" />
<script type="text/brightscript" uri="pkg:/source/api/baserequest.brs" />
<script type="text/brightscript" uri="pkg:/source/utils/config.brs" />
</component>

View File

@ -0,0 +1,65 @@
sub init()
m.quickConnectTimer = m.top.findNode("quickConnectTimer")
m.quickConnectTimer.observeField("fire", "quickConnectStatus")
m.quickConnectTimer.control = "start"
m.top.observeFieldScoped("buttonSelected", "onButtonSelected")
end sub
sub quickConnectStatus()
m.quickConnectTimer.control = "stop"
m.checkTask = CreateObject("roSGNode", "QuickConnect")
m.checkTask.secret = m.top.quickConnectJson.secret
m.checkTask.observeField("authenticated", "OnAuthenticated")
m.checkTask.control = "run"
end sub
sub OnAuthenticated()
m.checkTask.unobserveField("authenticated")
' Did we get the A-OK to authenticate?
authenticated = m.checkTask.authenticated
if authenticated < 0
' Still waiting, check again in 3 seconds...
authenticated = 0
m.checkTask.observeField("authenticated", "OnAuthenticated")
m.quickConnectTimer.control = "start"
else if authenticated > 0
' We've been given the go ahead, try to authenticate via Quick Connect...
authenticated = AuthenticateViaQuickConnect(m.top.quickConnectJson.secret)
if authenticated <> invalid and authenticated = true
m.user = AboutMe()
LoadUserPreferences()
LoadUserAbilities(m.user)
m.top.close = true
m.top.authenticated = true
else
m.top.close = true
m.top.authenticated = false
end if
end if
end sub
sub quickConnectClosed()
m.quickConnectTimer.control = "stop"
if m.checkTask <> invalid
m.checkTask.unobserveField("authenticated")
end if
m.top.close = true
end sub
sub onButtonSelected()
' only one button at the moment...
quickConnectClosed()
end sub
function onKeyEvent(key as string, press as boolean) as boolean
if not press then return false
' Note that "OK" does not get sent here, hence onButtonSelected() above.
if key = "back"
quickConnectClosed()
return true
end if
return false
end function

View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8" ?>
<component name="QuickConnectDialog" extends="StandardMessageDialog">
<children>
<Timer id="quickConnectTimer" duration="3" repeat="false" />
</children>
<interface>
<field id="quickConnectJson" type="assocarray" />
<field id="authenticated" type="boolean" alwaysNotify="true"/>
</interface>
<script type="text/brightscript" uri="QuickConnectDialog.brs" />
<script type="text/brightscript" uri="pkg:/source/api/userauth.brs" />
<script type="text/brightscript" uri="pkg:/source/api/baserequest.brs" />
<script type="text/brightscript" uri="pkg:/source/utils/config.brs" />
</component>

View File

@ -557,5 +557,21 @@
<translation>%1 of %2</translation>
<extracomment>Item position and count. %1 = current item. %2 = total number of items</extracomment>
</message>
<message>
<source>Quick Connect</source>
<translation>Quick Connect</translation>
</message>
<message>
<source>Here is your Quick Connect code:</source>
<translation>Here is your Quick Connect code:</translation>
</message>
<message>
<source>(Dialog will close automatically)</source>
<translation>(Dialog will close automatically)</translation>
</message>
<message>
<source>There was an error authenticating via Quick Connect.</source>
<translation>There was an error authenticating via Quick Connect.</translation>
</message>
</context>
</TS>

View File

@ -3267,7 +3267,7 @@ elemeket</translation>
<translation>Sajátosságok</translation>
<message>
<source>Press &apos;OK&apos; to Close</source>
<translation>Press &apos;OK&apos; to Close</translation>
<translation>Nyomd meg az OK gombot a bezáráshoz</translation>
</message>
</message>
<message>
@ -3391,5 +3391,45 @@ elemeket</translation>
<source>Save Credentials?</source>
<translation>Hitelesítő adatok mentése?</translation>
</message>
<message>
<source>%1 of %2</source>
<translation>%1 a 2% -ból</translation>
<extracomment>Item position and count. %1 = current item. %2 = total number of items</extracomment>
</message>
<message>
<source>Go to episode</source>
<translation>Ugrás az epizódra</translation>
<extracomment>Continue Watching Popup Menu - Navigate to the Episode Detail Page</extracomment>
</message>
<message>
<source>Go to season</source>
<translation>Ugrás az évadra</translation>
<extracomment>Continue Watching Popup Menu - Navigate to the Season Page</extracomment>
</message>
<message>
<source>Go to series</source>
<translation>Ugrás a sorozatra</translation>
<extracomment>Continue Watching Popup Menu - Navigate to the Series Detail Page</extracomment>
</message>
<message>
<source>Set Watched</source>
<translation>Megnézve</translation>
<extracomment>Button Text - When pressed, marks item as Warched</extracomment>
</message>
<message>
<source>Set Favorite</source>
<translation>Kedvenc hozzáadása</translation>
<extracomment>Button Text - When pressed, sets item as Favorite</extracomment>
</message>
<message>
<source>Show item count in the library, and index of selected item.</source>
<translation>Elemszám megjelenítése a könyvtárban.</translation>
<extracomment>Description for option in Setting Screen</extracomment>
</message>
<message>
<source>Item Count</source>
<translation>Elemek száma</translation>
<extracomment>UI -&gt; Media Grid -&gt; Item Count in user setting screen.</extracomment>
</message>
</context>
</TS>

286
package-lock.json generated
View File

@ -12,9 +12,9 @@
"brighterscript-formatter": "^1.6.8"
},
"devDependencies": {
"@rokucommunity/bslint": "^0.7.1",
"brighterscript": "^0.51.2",
"rooibos-cli": "^1.4.0"
"@rokucommunity/bslint": "0.7.1",
"brighterscript": "0.51.4",
"rooibos-cli": "1.4.0"
}
},
"node_modules/@nodelib/fs.scandir": {
@ -81,6 +81,44 @@
"node": ">=8"
}
},
"node_modules/@rokucommunity/bslint/node_modules/ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"dev": true,
"dependencies": {
"color-convert": "^2.0.1"
},
"engines": {
"node": ">=8"
},
"funding": {
"url": "https://github.com/chalk/ansi-styles?sponsor=1"
}
},
"node_modules/@rokucommunity/bslint/node_modules/cliui": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz",
"integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==",
"dev": true,
"dependencies": {
"string-width": "^4.2.0",
"strip-ansi": "^6.0.0",
"wrap-ansi": "^6.2.0"
}
},
"node_modules/@rokucommunity/bslint/node_modules/color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"dev": true,
"dependencies": {
"color-name": "~1.1.4"
},
"engines": {
"node": ">=7.0.0"
}
},
"node_modules/@rokucommunity/bslint/node_modules/color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
@ -88,9 +126,9 @@
"dev": true
},
"node_modules/@rokucommunity/bslint/node_modules/fs-extra": {
"version": "10.0.0",
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.0.0.tgz",
"integrity": "sha512-C5owb14u9eJwizKGdchcDUQeFtlSHHthBk8pbX9Vc1PFZrLombudjDnNns88aYslCyF6IY5SUw3Roz6xShcEIQ==",
"version": "10.1.0",
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz",
"integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==",
"dev": true,
"dependencies": {
"graceful-fs": "^4.2.0",
@ -101,7 +139,7 @@
"node": ">=12"
}
},
"node_modules/@rokucommunity/bslint/node_modules/fs-extra/node_modules/jsonfile": {
"node_modules/@rokucommunity/bslint/node_modules/jsonfile": {
"version": "6.1.0",
"resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz",
"integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==",
@ -113,7 +151,19 @@
"graceful-fs": "^4.1.6"
}
},
"node_modules/@rokucommunity/bslint/node_modules/fs-extra/node_modules/universalify": {
"node_modules/@rokucommunity/bslint/node_modules/strip-ansi": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
"integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
"dev": true,
"dependencies": {
"ansi-regex": "^5.0.1"
},
"engines": {
"node": ">=8"
}
},
"node_modules/@rokucommunity/bslint/node_modules/universalify": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz",
"integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==",
@ -122,18 +172,6 @@
"node": ">= 10.0.0"
}
},
"node_modules/@rokucommunity/bslint/node_modules/strip-ansi": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz",
"integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==",
"dev": true,
"dependencies": {
"ansi-regex": "^5.0.0"
},
"engines": {
"node": ">=8"
}
},
"node_modules/@rokucommunity/bslint/node_modules/wrap-ansi": {
"version": "6.2.0",
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz",
@ -148,32 +186,11 @@
"node": ">=8"
}
},
"node_modules/@rokucommunity/bslint/node_modules/wrap-ansi/node_modules/ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"dev": true,
"dependencies": {
"color-convert": "^2.0.1"
},
"engines": {
"node": ">=8"
},
"funding": {
"url": "https://github.com/chalk/ansi-styles?sponsor=1"
}
},
"node_modules/@rokucommunity/bslint/node_modules/wrap-ansi/node_modules/color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"dev": true,
"dependencies": {
"color-name": "~1.1.4"
},
"engines": {
"node": ">=7.0.0"
}
"node_modules/@rokucommunity/bslint/node_modules/y18n": {
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz",
"integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==",
"dev": true
},
"node_modules/@rokucommunity/bslint/node_modules/yargs": {
"version": "15.4.1",
@ -197,24 +214,7 @@
"node": ">=8"
}
},
"node_modules/@rokucommunity/bslint/node_modules/yargs/node_modules/cliui": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz",
"integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==",
"dev": true,
"dependencies": {
"string-width": "^4.2.0",
"strip-ansi": "^6.0.0",
"wrap-ansi": "^6.2.0"
}
},
"node_modules/@rokucommunity/bslint/node_modules/yargs/node_modules/y18n": {
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz",
"integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==",
"dev": true
},
"node_modules/@rokucommunity/bslint/node_modules/yargs/node_modules/yargs-parser": {
"node_modules/@rokucommunity/bslint/node_modules/yargs-parser": {
"version": "18.1.3",
"resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz",
"integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==",
@ -760,9 +760,9 @@
}
},
"node_modules/brighterscript": {
"version": "0.51.2",
"resolved": "https://registry.npmjs.org/brighterscript/-/brighterscript-0.51.2.tgz",
"integrity": "sha512-UbXAX56vLASPn+uF3y/Bp5NsI1Nb9zzSIxiMnKhxKpMhE0ItM242vTZL5tSL8q78UfRiJmrjYEP/Slndm4u33Q==",
"version": "0.51.4",
"resolved": "https://registry.npmjs.org/brighterscript/-/brighterscript-0.51.4.tgz",
"integrity": "sha512-/mxXy+fU8HM6u3B0lO8mBsgucTXgVz3dyeaVHwvF0N0MS36Q1CQWI4KliLQ8ko1uVP6Csax9ZOGCJF8hW0GcGg==",
"dev": true,
"dependencies": {
"@rokucommunity/bslib": "^0.1.1",
@ -1213,7 +1213,7 @@
"node_modules/brighterscript/node_modules/is-extglob": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
"integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=",
"integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==",
"dev": true,
"engines": {
"node": ">=0.10.0"
@ -5885,61 +5885,6 @@
"integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
"dev": true
},
"color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"dev": true
},
"fs-extra": {
"version": "10.0.0",
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.0.0.tgz",
"integrity": "sha512-C5owb14u9eJwizKGdchcDUQeFtlSHHthBk8pbX9Vc1PFZrLombudjDnNns88aYslCyF6IY5SUw3Roz6xShcEIQ==",
"dev": true,
"requires": {
"graceful-fs": "^4.2.0",
"jsonfile": "^6.0.1",
"universalify": "^2.0.0"
},
"dependencies": {
"jsonfile": {
"version": "6.1.0",
"resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz",
"integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==",
"dev": true,
"requires": {
"graceful-fs": "^4.1.6",
"universalify": "^2.0.0"
}
},
"universalify": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz",
"integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==",
"dev": true
}
}
},
"strip-ansi": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz",
"integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==",
"dev": true,
"requires": {
"ansi-regex": "^5.0.0"
}
},
"wrap-ansi": {
"version": "6.2.0",
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz",
"integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==",
"dev": true,
"requires": {
"ansi-styles": "^4.0.0",
"string-width": "^4.1.0",
"strip-ansi": "^6.0.0"
},
"dependencies": {
"ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
@ -5949,6 +5894,17 @@
"color-convert": "^2.0.1"
}
},
"cliui": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz",
"integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==",
"dev": true,
"requires": {
"string-width": "^4.2.0",
"strip-ansi": "^6.0.0",
"wrap-ansi": "^6.2.0"
}
},
"color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
@ -5957,9 +5913,66 @@
"requires": {
"color-name": "~1.1.4"
}
},
"color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"dev": true
},
"fs-extra": {
"version": "10.1.0",
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz",
"integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==",
"dev": true,
"requires": {
"graceful-fs": "^4.2.0",
"jsonfile": "^6.0.1",
"universalify": "^2.0.0"
}
},
"jsonfile": {
"version": "6.1.0",
"resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz",
"integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==",
"dev": true,
"requires": {
"graceful-fs": "^4.1.6",
"universalify": "^2.0.0"
}
},
"strip-ansi": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
"integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
"dev": true,
"requires": {
"ansi-regex": "^5.0.1"
}
},
"universalify": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz",
"integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==",
"dev": true
},
"wrap-ansi": {
"version": "6.2.0",
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz",
"integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==",
"dev": true,
"requires": {
"ansi-styles": "^4.0.0",
"string-width": "^4.1.0",
"strip-ansi": "^6.0.0"
}
},
"y18n": {
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz",
"integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==",
"dev": true
},
"yargs": {
"version": "15.4.1",
"resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz",
@ -5977,25 +5990,8 @@
"which-module": "^2.0.0",
"y18n": "^4.0.0",
"yargs-parser": "^18.1.2"
},
"dependencies": {
"cliui": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz",
"integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==",
"dev": true,
"requires": {
"string-width": "^4.2.0",
"strip-ansi": "^6.0.0",
"wrap-ansi": "^6.2.0"
}
},
"y18n": {
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz",
"integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==",
"dev": true
},
"yargs-parser": {
"version": "18.1.3",
"resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz",
@ -6007,8 +6003,6 @@
}
}
}
}
}
},
"@xml-tools/parser": {
"version": "1.0.11",
@ -6477,9 +6471,9 @@
}
},
"brighterscript": {
"version": "0.51.2",
"resolved": "https://registry.npmjs.org/brighterscript/-/brighterscript-0.51.2.tgz",
"integrity": "sha512-UbXAX56vLASPn+uF3y/Bp5NsI1Nb9zzSIxiMnKhxKpMhE0ItM242vTZL5tSL8q78UfRiJmrjYEP/Slndm4u33Q==",
"version": "0.51.4",
"resolved": "https://registry.npmjs.org/brighterscript/-/brighterscript-0.51.4.tgz",
"integrity": "sha512-/mxXy+fU8HM6u3B0lO8mBsgucTXgVz3dyeaVHwvF0N0MS36Q1CQWI4KliLQ8ko1uVP6Csax9ZOGCJF8hW0GcGg==",
"dev": true,
"requires": {
"@rokucommunity/bslib": "^0.1.1",
@ -6615,7 +6609,7 @@
"is-extglob": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
"integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=",
"integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==",
"dev": true
},
"is-glob": {

View File

@ -7,9 +7,9 @@
"test": "tests"
},
"devDependencies": {
"@rokucommunity/bslint": "^0.7.1",
"brighterscript": "^0.51.2",
"rooibos-cli": "^1.4.0"
"@rokucommunity/bslint": "0.7.1",
"brighterscript": "0.51.4",
"rooibos-cli": "1.4.0"
},
"scripts": {
"validate": "npx bsc --copy-to-staging=false --create-package=false",

View File

@ -50,33 +50,33 @@ function CreateServerGroup()
dialog.title = tr("Connecting to Server")
m.scene.dialog = dialog
serverInfoResult = ServerInfo()
m.serverInfoResult = ServerInfo()
dialog.close = true
if serverInfoResult = invalid
if m.serverInfoResult = invalid
' Maybe don't unset setting, but offer as a prompt
' Server not found, is it online? New values / Retry
print "Server not found, is it online? New values / Retry"
screen.errorMessage = tr("Server not found, is it online?")
SignOut(false)
else if serverInfoResult.Error <> invalid and serverInfoResult.Error
else if m.serverInfoResult.Error <> invalid and m.serverInfoResult.Error
' If server redirected received, update the URL
if serverInfoResult.UpdatedUrl <> invalid
serverUrl = serverInfoResult.UpdatedUrl
if m.serverInfoResult.UpdatedUrl <> invalid
serverUrl = m.serverInfoResult.UpdatedUrl
set_setting("server", serverUrl)
end if
' Display Error Message to user
message = tr("Error: ")
if serverInfoResult.ErrorCode <> invalid
message = message + "[" + serverInfoResult.ErrorCode.toStr() + "] "
if m.serverInfoResult.ErrorCode <> invalid
message = message + "[" + m.serverInfoResult.ErrorCode.toStr() + "] "
end if
screen.errorMessage = message + tr(serverInfoResult.ErrorMessage)
screen.errorMessage = message + tr(m.serverInfoResult.ErrorMessage)
SignOut(false)
else
screen.visible = false
if serverInfoResult.serverName <> invalid
return serverInfoResult.ServerName + " (Saved)"
if m.serverInfoResult.serverName <> invalid
return m.serverInfoResult.ServerName + " (Saved)"
else
return "Saved"
end if
@ -135,7 +135,7 @@ end function
function CreateSigninGroup(user = "")
' Get and Save Jellyfin user login credentials
group = CreateObject("roSGNode", "ConfigScene")
group = CreateObject("roSGNode", "LoginScene")
m.global.sceneManager.callFunc("pushScene", group)
port = CreateObject("roMessagePort")
@ -185,6 +185,18 @@ function CreateSigninGroup(user = "")
items.appendChild(saveCheckBox)
checkbox.content = items
checkbox.checkedState = [true]
quickConnect = group.findNode("quickConnect")
if m.serverInfoResult = invalid
m.serverInfoResult = ServerInfo()
end if
' Quick Connect only supported for server version 10.8+ right now...
if versionChecker(m.serverInfoResult.Version, "10.8.0")
' Add option for Quick Connect
quickConnect.text = tr("Quick Connect")
quickConnect.observeField("buttonSelected", port)
else
quickConnect.visible = false
end if
items = [username_field, password_field]
config.configItems = items
@ -224,6 +236,41 @@ function CreateSigninGroup(user = "")
end if
print "Login attempt failed..."
group.findNode("alert").text = tr("Login attempt failed.")
else if node = "quickConnect"
json = initQuickConnect()
if json = invalid
group.findNode("alert").text = tr("Quick Connect not available.")
else
' Server user is talking to is at least 10.8 and has quick connect enabled...
m.quickConnectDialog = createObject("roSGNode", "QuickConnectDialog")
m.quickConnectDialog.quickConnectJson = json
m.quickConnectDialog.title = tr("Quick Connect")
m.quickConnectDialog.message = [tr("Here is your Quick Connect code: ") + json.Code, tr("(Dialog will close automatically)")]
m.quickConnectDialog.buttons = [tr("Cancel")]
m.quickConnectDialog.observeField("authenticated", port)
m.scene.dialog = m.quickConnectDialog
end if
else if msg.getField() = "authenticated"
authenticated = msg.getData()
if authenticated = true
' Quick connect authentication was successful...
return "true"
else
dialog = createObject("roSGNode", "Dialog")
dialog.id = "QuickConnectError"
dialog.title = tr("Quick Connect")
dialog.buttons = [tr("OK")]
dialog.message = tr("There was an error authenticating via Quick Connect.")
m.scene.dialog = dialog
m.scene.dialog.observeField("buttonSelected", port)
end if
else
' If there are no other button matches, check if this is a simple "OK" Dialog & Close if so
dialog = msg.getRoSGNode()
if dialog.id = "QuickConnectError"
dialog.unobserveField("buttonSelected")
dialog.close = true
end if
end if
end if
end while

View File

@ -197,3 +197,49 @@ sub LoadUserAbilities(user)
set_user_setting("livetv.canrecord", "false")
end if
end sub
function initQuickConnect()
resp = APIRequest("QuickConnect/Initiate")
jsonResponse = getJson(resp)
if jsonResponse = invalid
return invalid
end if
if jsonResponse.Secret = invalid
return invalid
end if
return jsonResponse
end function
function checkQuickConnect(secret)
url = Substitute("QuickConnect/Connect?secret={0}", secret)
resp = APIRequest(url)
jsonResponse = getJson(resp)
if jsonResponse = invalid
return false
end if
if jsonResponse.Authenticated <> invalid and jsonResponse.Authenticated = true
return true
end if
return false
end function
function AuthenticateViaQuickConnect(secret)
params = {
secret: secret
}
req = APIRequest("Users/AuthenticateWithQuickConnect")
jsonResponse = postJson(req, FormatJson(params))
if jsonResponse <> invalid and jsonResponse.AccessToken <> invalid
userdata = CreateObject("roSGNode", "UserData")
userdata.json = jsonResponse
userdata.callFunc("setActive")
userdata.callFunc("saveToRegistry")
return true
end if
return false
end function

View File

@ -209,4 +209,31 @@ function getMinutes(ticks) as integer
' A tick is .1ms, so 1/10,000,000 for ticks to seconds,
' then 1/60 for seconds to minutes... 1/600,000,000
return roundNumber(ticks / 600000000.0)
'
' Returns whether or not a version number (e.g. 10.7.7) is greater or equal
' to some minimum version allowed (e.g. 10.8.0)
function versionChecker(versionToCheck as string, minVersionAccepted as string)
leftHand = CreateObject("roLongInteger")
rightHand = CreateObject("roLongInteger")
regEx = CreateObject("roRegex", "\.", "")
version = regEx.Split(versionToCheck)
if version.Count() < 3
for i = version.Count() to 3 step 1
version.AddTail("0")
end for
end if
minVersion = regEx.Split(minVersionAccepted)
if minVersion.Count() < 3
for i = minVersion.Count() to 3 step 1
minVersion.AddTail("0")
end for
end if
leftHand = (version[0].ToInt() * 10000) + (version[1].ToInt() * 100) + (version[2].ToInt() * 10)
rightHand = (minVersion[0].ToInt() * 10000) + (minVersion[1].ToInt() * 100) + (minVersion[2].ToInt() * 10)
return leftHand >= rightHand
end function