This commit is contained in:
tomkat83 2016-03-07 17:11:54 +01:00
parent a258f969ab
commit e9e1de6e3d

View file

@ -88,7 +88,9 @@ class InitialSetup():
plexToken = result['token']
plexid = result['plexid']
# Get g_PMS list of servers (saved to plx.g_PMS)
httpsUpdated = False
while True:
if httpsUpdated is False:
tokenDict = {'MyPlexToken': plexToken} if plexToken else {}
# Populate g_PMS variable with the found Plex servers
self.plx.discoverPMS(clientId,
@ -96,9 +98,11 @@ class InitialSetup():
xbmc.getIPAddress(),
tokenDict=tokenDict)
self.logMsg("Result of setting g_PMS variable: %s"
% self.plx.g_PMS, 2)
% self.plx.g_PMS, 1)
isconnected = False
serverlist = self.plx.returnServerList(clientId, self.plx.g_PMS)
serverlist = self.plx.returnServerList(
clientId, self.plx.g_PMS)
self.logMsg('PMS serverlist: %s' % serverlist)
# Let user pick server from a list
# Get a nicer list
dialoglist = []
@ -132,7 +136,12 @@ class InitialSetup():
self.logMsg("Setting SSL verify to true, because server is "
"not local", 1)
chk = self.plx.CheckConnection(url, server['accesstoken'])
# Unauthorized
if chk == 504 and httpsUpdated is False:
# Not able to use HTTP, try HTTPs for now
serverlist[resp]['scheme'] = 'https'
httpsUpdated = True
continue
httpsUpdated = False
if chk == 401:
# Not yet authorized for Plex server
# Please sign in to plex.tv