add legacyauth setting

cloned from
https://github.com/lrusak/plugin.audio.subsonic/commit/ad4fc0d0be33ea827
5a73e9a9d10bc6a5f772dba
This commit is contained in:
gordielachance 2016-10-01 00:56:59 +02:00
parent b35dfd278d
commit 44418a384e
3 changed files with 6 additions and 3 deletions

View File

@ -32,6 +32,8 @@ class Plugin(object):
self.password = addon.getSetting("password")
self.apiversion = addon.getSetting("apiversion")
self.insecure = addon.getSetting("insecure") == "true"
self.legacyauth = addon.getSetting("legacyauth") == "true"
self.albums_per_page = int(addon.getSetting("albums_per_page"))
self.tracks_per_page = int(addon.getSetting("tracks_per_page"))
@ -41,7 +43,7 @@ class Plugin(object):
# Create connection
self.connection = libsonic_extra.SubsonicClient(
self.url, self.username, self.password, self.apiversion, self.insecure)
self.url, self.username, self.password, self.apiversion, self.insecure, self.legacyauth)
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, apiversion, insecure):
def __init__(self, url, username, password, apiversion, insecure, legacyauth):
"""
Construct a new SubsonicClient.
@ -63,7 +63,7 @@ class SubsonicClient(libsonic.Connection):
# Invoke original constructor
super(SubsonicClient, self).__init__(
host, username, password, port=port, apiVersion=apiversion, insecure=insecure)
host, username, password, port=port, apiVersion=apiversion, insecure=insecure, legacyAuth=legacyauth)
def getIndexes(self, *args, **kwargs):
"""

View File

@ -6,6 +6,7 @@
<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="legacyauth" type="bool" label="Use pre-1.13.0 API version authentication" default="false"/>
<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"/>