mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-12-25 02:06:09 +00:00
Fix server migration and typo
This commit is contained in:
parent
1149af84aa
commit
1a961e853b
2 changed files with 15 additions and 13 deletions
|
@ -308,7 +308,7 @@ class ConnectionManager(object):
|
||||||
return self._resolveFailure()
|
return self._resolveFailure()
|
||||||
|
|
||||||
try:
|
try:
|
||||||
publicInfo = self._tryConnect(address, options)
|
publicInfo = self._tryConnect(address, options=options)
|
||||||
except Exception:
|
except Exception:
|
||||||
return _onFail()
|
return _onFail()
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -77,23 +77,25 @@ class InitialSetup(object):
|
||||||
|
|
||||||
###$ Begin migration $###
|
###$ Begin migration $###
|
||||||
if settings('server') == "":
|
if settings('server') == "":
|
||||||
current_server = self.user_client.get_server()
|
self.user_client.get_server()
|
||||||
if current_server is not None:
|
log.info("server migration completed")
|
||||||
server = self.connectmanager.get_server(current_server,
|
|
||||||
{'ssl': self.user_client.get_ssl()})
|
|
||||||
log.info("Detected: %s", server)
|
|
||||||
try:
|
|
||||||
server_id = server['Servers'][0]['Id']
|
|
||||||
settings('serverId', value=server_id)
|
|
||||||
except Exception as error:
|
|
||||||
log.error(error)
|
|
||||||
log.info("server migration completed")
|
|
||||||
|
|
||||||
self.user_client.get_userid()
|
self.user_client.get_userid()
|
||||||
self.user_client.get_token()
|
self.user_client.get_token()
|
||||||
###$ End migration $###
|
###$ End migration $###
|
||||||
|
|
||||||
if settings('server'):
|
current_server = self.user_client.get_server()
|
||||||
|
if current_server and not settings('serverId'):
|
||||||
|
server = self.connectmanager.get_server(current_server,
|
||||||
|
{'ssl': self.user_client.get_ssl()})
|
||||||
|
log.info("Detected: %s", server)
|
||||||
|
try:
|
||||||
|
server_id = server['Servers'][0]['Id']
|
||||||
|
settings('serverId', value=server_id)
|
||||||
|
except Exception as error:
|
||||||
|
log.error(error)
|
||||||
|
|
||||||
|
if current_server:
|
||||||
current_state = self.connectmanager.get_state()
|
current_state = self.connectmanager.get_state()
|
||||||
try:
|
try:
|
||||||
for server in current_state['Servers']:
|
for server in current_state['Servers']:
|
||||||
|
|
Loading…
Reference in a new issue