Skip to content

Commit

Permalink
add apiversion setting
Browse files Browse the repository at this point in the history
  • Loading branch information
lrusak committed Sep 27, 2016
1 parent ad830b6 commit 761fc59
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion addon.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,15 @@ def __init__(self, addon_url, addon_handle, addon_args):
self.url = addon.getSetting("subsonic_url")
self.username = addon.getSetting("username")
self.password = addon.getSetting("password")
self.apiversion = addon.getSetting("apiversion")

self.random_count = addon.getSetting("random_count")
self.bitrate = addon.getSetting("bitrate")
self.transcode_format = addon.getSetting("transcode_format")

# 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):
"""
Expand Down
4 changes: 2 additions & 2 deletions lib/libsonic_extra/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,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.
Expand Down Expand Up @@ -64,7 +64,7 @@ def __init__(self, url, username, password):

# Invoke original constructor
super(SubsonicClient, self).__init__(
host, username, password, port=port)
host, username, password, port=port, apiVersion=apiversion)

def getIndexes(self, *args, **kwargs):
"""
Expand Down
1 change: 1 addition & 0 deletions resources/settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<setting id="subsonic_url" type="text" label="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 id="random_count" type="labelenum" label="Random songs" values="10|15|20|25"/>
<setting id="transcode_format" type="labelenum" label="Transcode format" values="mp3|raw|flv|ogg"/>
<setting id="bitrate" type="labelenum" label="Bitrate" values="320|256|224|192|160|128|112|96|80|64|56|48|40|32"/>
Expand Down

0 comments on commit 761fc59

Please sign in to comment.