diff --git a/CHANGELOG.md b/CHANGELOG.md index ce7a618..1bf578b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## v2.1.0 +Backport v3.0.2 to Kodi Leia for testing + ## v3.0.2 Released 29th September 2021 (by warwickh) * Removed dependency on future and dateutil diff --git a/lib/libsonic/connection.py b/lib/libsonic/connection.py index fa03a83..de34ea6 100644 --- a/lib/libsonic/connection.py +++ b/lib/libsonic/connection.py @@ -164,7 +164,7 @@ class Connection(object): if len(self._hostname.split('/'))>1: print(len(self._hostname.split('/'))) xbmc.log("Got a folder %s"%(self._hostname.split('/')[1]),xbmc.LOGDEBUG) - parts = urllib.parse.urlparse(self._baseUrl) + parts = urlparse.urlparse(self._baseUrl) self._baseUrl = "%s://%s" % (parts.scheme, parts.hostname) self._hostname = parts.hostname self._serverPath = parts.path.strip('/') + '/rest' @@ -2932,7 +2932,7 @@ class Connection(object): """ separate REST portion of URL from base server path. """ - return urllib.parse.splithost(self._serverPath)[1].split('/')[0] + return urlparse.splithost(self._serverPath)[1].split('/')[0] def _fixLastModified(self, data): """ diff --git a/main.py b/main.py index d57b9c1..6f9fe5f 100644 --- a/main.py +++ b/main.py @@ -44,7 +44,7 @@ def get_connection(): if connection==None: connected = False # Create connection - if 1:#try: + try: connection = libsonic.Connection( baseUrl=Addon().get_setting('subsonic_url'), username=Addon().get_setting('username', convert=False), @@ -56,11 +56,12 @@ def get_connection(): useGET=Addon().get_setting('useget'), ) connected = connection.ping() - #except: - # pass + except: + pass if connected==False: popup('Connection error') + plugin.log('Connection error') return False return connection