Fix connection port issue
This commit is contained in:
parent
c65548a73b
commit
861e7534c6
16
main.py
16
main.py
|
@ -49,18 +49,18 @@ def get_connection():
|
||||||
|
|
||||||
if connection==None:
|
if connection==None:
|
||||||
connected = False
|
connected = False
|
||||||
# Create connection
|
# Create connection
|
||||||
try:
|
try:
|
||||||
connection = libsonic.Connection(
|
connection = libsonic.Connection(
|
||||||
baseUrl=Addon().get_setting('subsonic_url'),
|
baseUrl=Addon().get_setting('subsonic_url'),
|
||||||
username=Addon().get_setting('username', convert=False),
|
username=Addon().get_setting('username', convert=False),
|
||||||
password=Addon().get_setting('password', convert=False),
|
password=Addon().get_setting('password', convert=False),
|
||||||
port=4040,#TO FIX
|
port=Addon().get_setting('port'),
|
||||||
apiVersion=Addon().get_setting('apiversion'),
|
apiVersion=Addon().get_setting('apiversion'),
|
||||||
insecure=Addon().get_setting('insecure') == 'false',
|
insecure=Addon().get_setting('insecure'),
|
||||||
legacyAuth=Addon().get_setting('legacyauth') == 'false',
|
legacyAuth=Addon().get_setting('legacyauth'),
|
||||||
useGET=False,#Addon().get_setting('useget') == 'True', #TO FIX
|
useGET=Addon().get_setting('useget'),
|
||||||
)
|
)
|
||||||
connected = connection.ping()
|
connected = connection.ping()
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
@ -676,7 +676,6 @@ def play_track(params):
|
||||||
|
|
||||||
@plugin.action()
|
@plugin.action()
|
||||||
def star_item(params):
|
def star_item(params):
|
||||||
plugin.log("Star/Unstar params %s"%params,xbmc.LOGINFO)
|
|
||||||
ids= params.get('ids'); #can be single or lists of IDs
|
ids= params.get('ids'); #can be single or lists of IDs
|
||||||
unstar= params.get('unstar',False);
|
unstar= params.get('unstar',False);
|
||||||
unstar = (unstar) and (unstar != 'None') and (unstar != 'False') #TO FIX better statement ?
|
unstar = (unstar) and (unstar != 'None') and (unstar != 'False') #TO FIX better statement ?
|
||||||
|
@ -714,7 +713,6 @@ def star_item(params):
|
||||||
request = connection.unstar(sids, albumIds, artistIds)
|
request = connection.unstar(sids, albumIds, artistIds)
|
||||||
else:
|
else:
|
||||||
request = connection.star(sids, albumIds, artistIds)
|
request = connection.star(sids, albumIds, artistIds)
|
||||||
xbmc.log("star resp: %s"%request)
|
|
||||||
if request['status'] == 'ok':
|
if request['status'] == 'ok':
|
||||||
did_action = True
|
did_action = True
|
||||||
|
|
||||||
|
@ -1052,7 +1050,7 @@ def stars_cache_update(ids,remove=False):
|
||||||
plugin.log(starred)
|
plugin.log(starred)
|
||||||
|
|
||||||
|
|
||||||
def stars_cache_get():
|
def stars_cache_get(): #Retrieving stars from cache is too slow, so load to local variable
|
||||||
global local_starred
|
global local_starred
|
||||||
plugin.log(len(local_starred))
|
plugin.log(len(local_starred))
|
||||||
if(len(local_starred)>0):
|
if(len(local_starred)>0):
|
||||||
|
|
Loading…
Reference in New Issue