mirror of
https://github.com/jellyfin/jellyfin-roku.git
synced 2025-02-19 22:41:47 +00:00
WIP
This commit is contained in:
parent
450448ac96
commit
32cfd72d44
@ -245,7 +245,7 @@ sub Main (args as dynamic) as void
|
||||
else if button.id = "change_server"
|
||||
unset_setting("server")
|
||||
unset_setting("port")
|
||||
SignOut()
|
||||
SignOut(false)
|
||||
sceneManager.callFunc("clearScenes")
|
||||
goto app_start
|
||||
else if button.id = "sign_out"
|
||||
@ -433,9 +433,9 @@ sub SaveServerList()
|
||||
|
||||
if addNewEntry
|
||||
if entryCount = 0
|
||||
set_setting("saved_servers", FormatJson({ serverList: [{ name: m.serverSelection, baseUrl: LCase(server), iconUrl: "pkg:/images/logo-icon120.jpg", iconWidth: 120, iconHeight: 120 }] }))
|
||||
set_setting("saved_servers", FormatJson({ serverList: [{ name: m.serverSelection, baseUrl: server, iconUrl: "pkg:/images/logo-icon120.jpg", iconWidth: 120, iconHeight: 120 }] }))
|
||||
else
|
||||
savedServers.serverList.Push({ name: m.serverSelection, baseUrl: LCase(server), iconUrl: "pkg:/images/logo-icon120.jpg", iconWidth: 120, iconHeight: 120 })
|
||||
savedServers.serverList.Push({ name: m.serverSelection, baseUrl: server, iconUrl: "pkg:/images/logo-icon120.jpg", iconWidth: 120, iconHeight: 120 })
|
||||
set_setting("saved_servers", FormatJson(savedServers))
|
||||
end if
|
||||
end if
|
||||
|
@ -59,7 +59,7 @@ function CreateServerGroup()
|
||||
' 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()
|
||||
SignOut(false)
|
||||
else if serverInfoResult.Error <> invalid and serverInfoResult.Error
|
||||
' If server redirected received, update the URL
|
||||
if serverInfoResult.UpdatedUrl <> invalid
|
||||
@ -72,7 +72,7 @@ function CreateServerGroup()
|
||||
message = message + "[" + serverInfoResult.ErrorCode.toStr() + "] "
|
||||
end if
|
||||
screen.errorMessage = message + tr(serverInfoResult.ErrorMessage)
|
||||
SignOut()
|
||||
SignOut(false)
|
||||
else
|
||||
screen.visible = false
|
||||
if serverInfoResult.serverName <> invalid
|
||||
|
@ -21,11 +21,29 @@ function AboutMe()
|
||||
return getJson(resp)
|
||||
end function
|
||||
|
||||
sub SignOut()
|
||||
sub SignOut(deleteSavedEntry = true as boolean)
|
||||
if get_setting("active_user") <> invalid
|
||||
unset_user_setting("token")
|
||||
unset_setting("username")
|
||||
unset_setting("password")
|
||||
if deleteSavedEntry = true
|
||||
'Also delete any credentials in the "saved servers" list
|
||||
saved = get_setting("saved_servers")
|
||||
server = get_setting("server")
|
||||
if server <> invalid
|
||||
server = LCase(server)
|
||||
savedServers = ParseJson(saved)
|
||||
newServers = { serverList: [] }
|
||||
for each item in savedServers.serverList
|
||||
if item.baseUrl = server
|
||||
item.username = ""
|
||||
item.password = ""
|
||||
end if
|
||||
newServers.serverList.Push(item)
|
||||
end for
|
||||
set_setting("saved_servers", FormatJson(newServers))
|
||||
end if
|
||||
end if
|
||||
end if
|
||||
unset_setting("active_user")
|
||||
m.global.sceneManager.currentUser = ""
|
||||
@ -53,7 +71,7 @@ sub RemoveUser(id as string)
|
||||
user.id = id
|
||||
user.callFunc("removeFromRegistry")
|
||||
|
||||
if get_setting("active_user") = id then SignOut()
|
||||
if get_setting("active_user") = id then SignOut(false)
|
||||
end sub
|
||||
|
||||
function ServerInfo()
|
||||
|
Loading…
x
Reference in New Issue
Block a user