From 6b4807bbf5719d80082bdd33592f034af1f47bb4 Mon Sep 17 00:00:00 2001 From: gordielachance Date: Sat, 1 Oct 2016 00:31:01 +0200 Subject: [PATCH] add apiversion setting cloned from https://github.com/lrusak/plugin.audio.subsonic/commit/761fc593c4a94027b 6483b98886a995b88bb03af --- addon.py | 3 ++- lib/libsonic_extra/__init__.py | 4 ++-- resources/settings.xml | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/addon.py b/addon.py index 8c5a74e..fd6961c 100644 --- a/addon.py +++ b/addon.py @@ -30,6 +30,7 @@ class Plugin(object): self.url = addon.getSetting("subsonic_url") self.username = addon.getSetting("username") self.password = addon.getSetting("password") + self.apiversion = addon.getSetting("apiversion") self.albums_per_page = int(addon.getSetting("albums_per_page")) self.tracks_per_page = int(addon.getSetting("tracks_per_page")) @@ -39,7 +40,7 @@ class Plugin(object): # Create connection self.connection = libsonic_extra.SubsonicClient( - self.url, self.username, self.password) + self.url, self.username, self.password, self.apiversion) def build_url(self, query): """ diff --git a/lib/libsonic_extra/__init__.py b/lib/libsonic_extra/__init__.py index 9a5e1ee..e001e2c 100644 --- a/lib/libsonic_extra/__init__.py +++ b/lib/libsonic_extra/__init__.py @@ -33,7 +33,7 @@ class SubsonicClient(libsonic.Connection): - Add conventient `walk_*' methods to iterate over the API responses. """ - def __init__(self, url, username, password): + def __init__(self, url, username, password, apiversion): """ Construct a new SubsonicClient. @@ -63,7 +63,7 @@ class SubsonicClient(libsonic.Connection): # Invoke original constructor super(SubsonicClient, self).__init__( - host, username, password, port=port) + host, username, password, port=port, apiVersion=apiversion) def getIndexes(self, *args, **kwargs): """ diff --git a/resources/settings.xml b/resources/settings.xml index 011955f..df7c41c 100644 --- a/resources/settings.xml +++ b/resources/settings.xml @@ -4,6 +4,7 @@ +