Update for strings

This commit is contained in:
angelblue05 2016-02-17 02:13:37 -06:00
parent 0ba1ac4104
commit 52a5d35295
10 changed files with 477 additions and 389 deletions

View file

@ -18,12 +18,14 @@ class Read_EmbyServer():
def __init__(self):
window = utils.window
self.clientInfo = clientinfo.ClientInfo()
self.addonName = self.clientInfo.getAddonName()
self.doUtils = downloadutils.DownloadUtils().downloadUrl
self.userId = utils.window('emby_currUser')
self.server = utils.window('emby_server%s' % self.userId)
self.userId = window('emby_currUser')
self.server = window('emby_server%s' % self.userId)
def logMsg(self, msg, lvl=1):
@ -183,6 +185,8 @@ class Read_EmbyServer():
def getSection(self, parentid, itemtype=None, sortby="SortName", basic=False, dialog=None):
log = self.logMsg
doUtils = self.doUtils
items = {
@ -208,7 +212,7 @@ class Read_EmbyServer():
items['TotalRecordCount'] = total
except TypeError: # Failed to retrieve
self.logMsg("%s:%s Failed to retrieve the server response." % (url, params), 2)
log("%s:%s Failed to retrieve the server response." % (url, params), 2)
else:
index = 0
@ -250,27 +254,27 @@ class Read_EmbyServer():
# Something happened to the connection
if not throttled:
throttled = True
self.logMsg("Throttle activated.", 1)
log("Throttle activated.", 1)
if jump == highestjump:
# We already tried with the highestjump, but it failed. Reset value.
self.logMsg("Reset highest value.", 1)
log("Reset highest value.", 1)
highestjump = 0
# Lower the number by half
if highestjump:
throttled = False
jump = highestjump
self.logMsg("Throttle deactivated.", 1)
log("Throttle deactivated.", 1)
else:
jump = int(jump/4)
self.logMsg("Set jump limit to recover: %s" % jump, 1)
log("Set jump limit to recover: %s" % jump, 2)
retry = 0
while utils.window('emby_online') != "true":
# Wait server to come back online
if retry == 3:
self.logMsg("Unable to reconnect to server. Abort process.", 1)
log("Unable to reconnect to server. Abort process.", 1)
return
retry += 1
@ -298,7 +302,7 @@ class Read_EmbyServer():
increment = 10
jump += increment
self.logMsg("Increase jump limit to: %s" % jump, 1)
log("Increase jump limit to: %s" % jump, 1)
return items
def getViews(self, type, root=False):