Accidentally erased method

This commit is contained in:
angelblue05 2016-09-09 19:18:30 -05:00
parent ff00c35b5b
commit 4d7991ab5f

View file

@ -317,6 +317,26 @@ class ConnectionManager(object):
else: else:
return server return server
def onAuthenticated(self, result, options={}):
credentials = self.credentialProvider.getCredentials()
for s in credentials['Servers']:
if s['Id'] == result['ServerId']:
server = s
break
else: # Server not found?
return
if options.get('updateDateLastAccessed') is not False:
server['DateLastAccessed'] = datetime.now().strftime('%Y-%m-%dT%H:%M:%SZ')
server['UserId'] = result['User']['Id']
server['AccessToken'] = result['AccessToken']
self.credentialProvider.addOrUpdateServer(credentials['Servers'], server)
self._saveUserInfoIntoCredentials(server, result['User'])
self.credentialProvider.getCredentials(credentials)
def _tryConnect(self, url, timeout=None): def _tryConnect(self, url, timeout=None):
url = self.getEmbyServerUrl(url, "system/info/public") url = self.getEmbyServerUrl(url, "system/info/public")