Added a welcome message
Instead of server online, added a welcome message with the name of the user.
This commit is contained in:
parent
c36b896f99
commit
3954c50329
1 changed files with 8 additions and 2 deletions
10
service.py
10
service.py
|
@ -36,6 +36,7 @@ class Service():
|
||||||
WINDOW = xbmcgui.Window(10000)
|
WINDOW = xbmcgui.Window(10000)
|
||||||
|
|
||||||
warn_auth = True
|
warn_auth = True
|
||||||
|
welcome_msg = True
|
||||||
server_online = True
|
server_online = True
|
||||||
|
|
||||||
def __init__(self, *args ):
|
def __init__(self, *args ):
|
||||||
|
@ -90,7 +91,12 @@ class Service():
|
||||||
if WINDOW.getProperty('Server_online') == "true":
|
if WINDOW.getProperty('Server_online') == "true":
|
||||||
# Server is online
|
# Server is online
|
||||||
if (user.currUser != None) and (user.HasAccess == True):
|
if (user.currUser != None) and (user.HasAccess == True):
|
||||||
self.warn_auth = True
|
|
||||||
|
if self.welcome_msg:
|
||||||
|
# Reset authentication warnings
|
||||||
|
self.welcome_msg = False
|
||||||
|
self.warn_auth = True
|
||||||
|
xbmcgui.Dialog().notification("Emby server", "Welcome %s!" % user.currUser, sound=False)
|
||||||
|
|
||||||
# Correctly launch the websocket, if user manually launches the add-on
|
# Correctly launch the websocket, if user manually launches the add-on
|
||||||
if (self.newWebSocketThread == None):
|
if (self.newWebSocketThread == None):
|
||||||
|
@ -184,7 +190,7 @@ class Service():
|
||||||
# Abort was requested while waiting.
|
# Abort was requested while waiting.
|
||||||
break
|
break
|
||||||
xbmcgui.Dialog().notification("Connection successful", "%s Server is online." % self.addonName, time=2000, sound=False)
|
xbmcgui.Dialog().notification("Connection successful", "%s Server is online." % self.addonName, time=2000, sound=False)
|
||||||
|
|
||||||
self.server_online = True
|
self.server_online = True
|
||||||
self.logMsg("Server is online and ready.", 1)
|
self.logMsg("Server is online and ready.", 1)
|
||||||
WINDOW.setProperty("Server_online", "true")
|
WINDOW.setProperty("Server_online", "true")
|
||||||
|
|
Loading…
Reference in a new issue