add apiversion setting

cloned from
https://github.com/lrusak/plugin.audio.subsonic/commit/761fc593c4a94027b
6483b98886a995b88bb03af
This commit is contained in:
gordielachance 2016-10-01 00:31:01 +02:00
parent fe158c33fb
commit 6b4807bbf5
3 changed files with 5 additions and 3 deletions

View File

@ -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):
"""

View File

@ -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):
"""

View File

@ -4,6 +4,7 @@
<setting id="subsonic_url" type="text" label="Server URL" default="http://demo.subsonic.org"/>
<setting id="username" type="text" label="Username" default="guest3"/>
<setting id="password" type="text" option="hidden" label="Password" default="guest"/>
<setting id="apiversion" type="labelenum" label="API version" values="1.11.0|1.12.0|1.13.0|1.14.0" default="1.13.0"/>
<setting type="sep" />
<setting id="albums_per_page" type="labelenum" label="Albums per page" default="50" values="10|25|50|100|250|500"/>
<setting id="tracks_per_page" type="labelenum" label="Tracks per page" default="100" values="10|25|50|100|250|500"/>