diff --git a/default.py b/default.py
index e9744b44..9ecbe8aa 100644
--- a/default.py
+++ b/default.py
@@ -43,6 +43,17 @@ if mode == "play" or mode == "playfromaddon":
elif mode == "reset":
utils.reset()
+elif mode == "resetauth":
+ # User tried login and failed too many times
+ resp = xbmcgui.Dialog().yesno("Warning", "Emby might lock your account if you fail to log in too many times. Proceed anyway?")
+ if resp == 1:
+ xbmc.log("Reset login attempts.")
+ WINDOW.setProperty("Server_status", "Auth")
+ else:
+ xbmc.executebuiltin('Addon.OpenSettings(plugin.video.emby)')
+
+
+
if mode == "channels" or mode == "channelsfolder":
id = params['id']
diff --git a/resources/lib/UserClient.py b/resources/lib/UserClient.py
index 2bef61f0..f801627b 100644
--- a/resources/lib/UserClient.py
+++ b/resources/lib/UserClient.py
@@ -116,7 +116,7 @@ class UserClient(threading.Thread):
username = self.getUsername()
w_token = self.WINDOW.getProperty('accessToken%s' % username)
- s_token = self.addon.getSetting('accessToken%s' % username)
+ s_token = self.addon.getSetting('accessToken')
# Verify the window property
if (w_token != ""):
@@ -272,7 +272,7 @@ class UserClient(threading.Thread):
if (result != None and accessToken != None):
self.currUser = username
userId = result[u'User'][u'Id']
- addon.setSetting("accessToken%s" % username, accessToken)
+ addon.setSetting("accessToken", accessToken)
addon.setSetting("userId%s" % username, userId)
self.logMsg("User Authenticated: %s" % accessToken)
self.loadCurrUser()
@@ -281,15 +281,16 @@ class UserClient(threading.Thread):
return
else:
self.logMsg("User authentication failed.")
- addon.setSetting("accessToken%s" % username, "")
+ addon.setSetting("accessToken", "")
addon.setSetting("userId%s" % username, "")
xbmcgui.Dialog().ok("Error connecting", "Invalid username or password.")
# Give two attempts at entering password
self.retry += 1
if self.retry == 2:
- self.logMsg("Too many retries. Please restart Kodi.")
+ self.logMsg("Too many retries. You can retry by selecting the option in the addon settings.")
self.WINDOW.setProperty("Server_status", "Stop")
+ xbmcgui.Dialog().ok("Error connecting", "Failed to authenticate too many times. You can retry by selecting the option in the addon settings.")
self.auth = False
return
diff --git a/resources/settings.xml b/resources/settings.xml
index a58bea71..d0d603da 100644
--- a/resources/settings.xml
+++ b/resources/settings.xml
@@ -3,13 +3,16 @@
-
+
+
+
+
@@ -21,8 +24,8 @@
-
-
+
+