start and stop the service with user login and logoff

reset user and token when a user loggs off
This commit is contained in:
Shaun
2017-04-15 15:54:14 +10:00
parent ce88ee84eb
commit 0b966b6791
2 changed files with 8 additions and 3 deletions

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.video.embycon"
name="EmbyCon"
version="1.1.1"
version="1.1.3"
provider-name="null_pointer">
<requires>
<import addon="xbmc.python" version="2.1.0"/>
@@ -9,7 +9,7 @@
<extension point="xbmc.python.pluginsource" library="default.py">
<provides>executable video audio image</provides>
</extension>
<extension point="xbmc.service" library="service.py" start="startup">
<extension point="xbmc.service" library="service.py" start="login">
</extension>
<extension point="xbmc.addon.metadata">
<platform>all</platform>

View File

@@ -140,7 +140,12 @@ while not xbmc.abortRequested:
xbmc.sleep(1000)
xbmcgui.Window(10000).setProperty("EmbyCon_Service_Timestamp", str(int(time.time())))
# clear user and token when loggin off
WINDOW = xbmcgui.Window(10000)
WINDOW.clearProperty("userid")
WINDOW.clearProperty("AccessToken")
# stop the WebSocket client
websocket_thread.stopClient()