From d41e3d7fe102ce90878842494c1c9c93afac4731 Mon Sep 17 00:00:00 2001 From: angelblue05 Date: Tue, 6 Feb 2018 05:48:01 -0600 Subject: [PATCH] Tweak server detection a bit Prevent looking up servers with default access dates. --- resources/lib/connect/connectionmanager.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/resources/lib/connect/connectionmanager.py b/resources/lib/connect/connectionmanager.py index 0f98478f..be88f20b 100644 --- a/resources/lib/connect/connectionmanager.py +++ b/resources/lib/connect/connectionmanager.py @@ -265,8 +265,8 @@ class ConnectionManager(object): sock.setsockopt(socket.SOL_IP, socket.IP_MULTICAST_LOOP, 1) sock.setsockopt(socket.IPPROTO_IP, socket.SO_REUSEADDR, 1) - log.debug("MultiGroup : %s" % str(MULTI_GROUP)) - log.debug("Sending UDP Data: %s" % MESSAGE) + log.debug("MultiGroup : %s", str(MULTI_GROUP)) + log.debug("Sending UDP Data: %s", MESSAGE) servers = [] @@ -282,11 +282,11 @@ class ConnectionManager(object): servers.append(json.loads(data)) except socket.timeout: - log.info("Found Servers: %s" % servers) + log.info("Found Servers: %s", servers) return servers except Exception as e: - log.error("Error trying to find servers: %s" % e) + log.error("Error trying to find servers: %s", e) return servers def _normalizeAddress(self, address): @@ -779,8 +779,7 @@ class ConnectionManager(object): firstServer = self._getLastUsedServer() # See if we have any saved credentials and can auto sign in - if firstServer: - + if firstServer and firstServer['DateLastAccessed'] != "2001-01-01T00:00:00Z": result = self.connectToServer(firstServer, options) if result and result.get('State') == ConnectionState['SignedIn']: return result