fix a unicode bug, comparing unicode and none unicode strings has issues

This commit is contained in:
Shaun
2018-01-03 18:59:33 +11:00
parent 8cb632db7d
commit 12930afa9e
3 changed files with 2 additions and 2 deletions

View File

@@ -176,7 +176,7 @@ class DownloadUtils():
userid = ""
secure = False
for user in result:
if (user.get("Name") == userName):
if (user.get("Name") == unicode(userName, "utf-8")):
userid = user.get("Id")
log.debug("Username Found: {0}", user.get("Name"))
if (user.get("HasPassword") == True):

View File

@@ -490,7 +490,6 @@ def get_next_episode(item):
parendId = item.get("ParentId", "na")
item_index = item.get("IndexNumber", -1)
if parendId == "na":
log.debug("No parent id, can not get next")
return None

View File

@@ -107,6 +107,7 @@ def checkServer(force=False, change_user=False, notify=False):
# we need to change the user
current_username = settings.getSetting("username")
current_username = unicode(current_username, "utf-8")
# if asked or we have no current user then show user selection screen
if change_user or len(current_username) == 0: