move server setting to __init__

This commit is contained in:
shaun 2015-04-27 13:45:20 +10:00
parent dfbb281987
commit b4d1822ea4

View File

@ -25,6 +25,10 @@ class DownloadUtils():
if(level != None):
self.logLevel = int(level)
port = self.addonSettings.getSetting('port')
host = self.addonSettings.getSetting('ipaddress')
self.server = host + ":" + port
def logMsg(self, msg, level = 1):
if(self.logLevel >= level):
xbmc.log("MBCon DownloadUtils -> " + msg)
@ -68,20 +72,8 @@ class DownloadUtils():
return ""
query = ""
played = "0"
# use the local image proxy server that is made available by this addons service
port = self.addonSettings.getSetting('port')
host = self.addonSettings.getSetting('ipaddress')
server = host + ":" + port
artwork = "http://%s/mediabrowser/Items/%s/Images/%s/%s?MaxWidth=%s&MaxHeight=%s&Format=original&Tag=%s%s" % (server, id, type, index, width, height, imageTag, query)
'''
artwork = ( "http://" + server + "/mediabrowser/Items/" + str(id) +
"/Images/" + type +
"/" + index + "/" + imageTag + "/original/" +
str(height) + "/" + str(width) + "/" + played + "?" + query)
'''
artwork = "http://%s/mediabrowser/Items/%s/Images/%s/%s?MaxWidth=%s&MaxHeight=%s&Format=original&Tag=%s%s" % (self.server, id, type, index, width, height, imageTag, query)
self.logMsg("getArtwork : " + artwork, level=2)