diff --git a/resources/lib/connectmanager.py b/resources/lib/connectmanager.py index 1376236e..09970fa6 100644 --- a/resources/lib/connectmanager.py +++ b/resources/lib/connectmanager.py @@ -70,8 +70,8 @@ class ConnectManager(object): window('emby_state.json', value=self.state) return self.state - def get_server(self, server): - self.state = self._connect.connectToAddress(server) + def get_server(self, server, options={}): + self.state = self._connect.connectToAddress(server, options) return self.get_state() @classmethod diff --git a/resources/lib/initialsetup.py b/resources/lib/initialsetup.py index 19619f10..400f6249 100644 --- a/resources/lib/initialsetup.py +++ b/resources/lib/initialsetup.py @@ -79,10 +79,14 @@ class InitialSetup(object): if settings('server') == "": current_server = self.user_client.get_server() if current_server is not None: - server = self.connectmanager.get_server(current_server) + server = self.connectmanager.get_server(current_server, + {'ssl': self.user_client.get_ssl()}) log.info("Detected: %s", server) - server_id = server['Servers'][0]['Id'] - settings('serverId', value=server_id) + 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()