Skip to content

Commit

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

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.apiversion)
self.url, self.username, self.password, self.apiversion, self.insecure)

def build_url(self, query):
"""
Expand Down
4 changes: 2 additions & 2 deletions lib/libsonic_extra/__init__.py
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, apiversion):
def __init__(self, url, username, password, apiversion, insecure):
"""
Construct a new SubsonicClient.
Expand Down Expand Up @@ -64,7 +64,7 @@ def __init__(self, url, username, password, apiversion):

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

def getIndexes(self, *args, **kwargs):
"""
Expand Down
1 change: 1 addition & 0 deletions resources/settings.xml
Expand Up @@ -4,6 +4,7 @@
<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="insecure" type="bool" label="Allow self signed certificates" default="false" />
<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 5c5040a

Please sign in to comment.