update all login paths to use new UpdateURL() function
This commit is contained in:
parent
ff8e7c3471
commit
87448d02cd
|
@ -248,6 +248,11 @@ function CreateServerGroup()
|
|||
else if type(msg) = "roSGNodeEvent"
|
||||
node = msg.getNode()
|
||||
if node = "submit"
|
||||
' Show Connecting to Server spinner
|
||||
dialog = createObject("roSGNode", "ProgressDialog")
|
||||
dialog.title = tr("Connecting to Server")
|
||||
m.scene.dialog = dialog
|
||||
|
||||
serverUrl = standardize_jellyfin_url(screen.serverUrl)
|
||||
'If this is a different server from what we know, reset username/password setting
|
||||
if m.global.session.server.url <> serverUrl
|
||||
|
@ -255,28 +260,31 @@ function CreateServerGroup()
|
|||
set_setting("password", "")
|
||||
end if
|
||||
set_setting("server", serverUrl)
|
||||
session.server.UpdateURL(serverUrl)
|
||||
' Show Connecting to Server spinner
|
||||
dialog = createObject("roSGNode", "ProgressDialog")
|
||||
dialog.title = tr("Connecting to Server")
|
||||
m.scene.dialog = dialog
|
||||
|
||||
isConnected = session.server.UpdateURL(serverUrl)
|
||||
serverInfoResult = invalid
|
||||
if isConnected
|
||||
serverInfoResult = ServerInfo()
|
||||
|
||||
end if
|
||||
dialog.close = true
|
||||
|
||||
if serverInfoResult = invalid
|
||||
if isConnected = false or 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 isValid(serverInfoResult.Error) and serverInfoResult.Error
|
||||
else
|
||||
if isValid(serverInfoResult.Error) and serverInfoResult.Error
|
||||
' If server redirected received, update the URL
|
||||
if isValid(serverInfoResult.UpdatedUrl)
|
||||
serverUrl = serverInfoResult.UpdatedUrl
|
||||
set_setting("server", serverUrl)
|
||||
session.server.UpdateURL(serverUrl)
|
||||
isConnected = session.server.UpdateURL(serverUrl)
|
||||
if isConnected
|
||||
screen.visible = false
|
||||
return ""
|
||||
end if
|
||||
end if
|
||||
' Display Error Message to user
|
||||
message = tr("Error: ")
|
||||
|
@ -293,6 +301,7 @@ function CreateServerGroup()
|
|||
return "Saved"
|
||||
end if
|
||||
end if
|
||||
end if
|
||||
else if node = "delete_saved"
|
||||
serverPicker = screen.findNode("serverPicker")
|
||||
itemToDelete = serverPicker.content.getChild(serverPicker.itemFocused)
|
||||
|
|
|
@ -90,7 +90,8 @@ function ServerInfo()
|
|||
' set the server to new location and try again
|
||||
if right(headers.location, 19) = "/System/Info/Public"
|
||||
set_setting("server", left(headers.location, len(headers.location) - 19))
|
||||
session.server.UpdateURL(left(headers.location, len(headers.location) - 19))
|
||||
isConnected = session.server.UpdateURL(left(headers.location, len(headers.location) - 19))
|
||||
if isConnected
|
||||
info = ServerInfo()
|
||||
if info.Error
|
||||
info.UpdatedUrl = left(headers.location, len(headers.location) - 19)
|
||||
|
@ -99,6 +100,7 @@ function ServerInfo()
|
|||
return info
|
||||
end if
|
||||
end if
|
||||
end if
|
||||
|
||||
' handle any non 200 responses, returning the error code and message
|
||||
if resp.GetResponseCode() <> 200
|
||||
|
|
Loading…
Reference in New Issue
Block a user