Review server offline

Add settings to disable offline server message
This commit is contained in:
angelblue05 2016-09-04 19:28:30 -05:00
parent feda0cb9df
commit e19e90e703
4 changed files with 12 additions and 5 deletions

View file

@ -229,6 +229,7 @@
<string id="30542">Server</string> <string id="30542">Server</string>
<string id="30543">Username or email</string> <string id="30543">Username or email</string>
<string id="30544">Enable database locked fix (will slow syncing process)</string> <string id="30544">Enable database locked fix (will slow syncing process)</string>
<string id="30545">Enable server offline message</string>
<!-- dialogs --> <!-- dialogs -->
<string id="30600">Sign in with Emby Connect</string> <string id="30600">Sign in with Emby Connect</string>

View file

@ -254,6 +254,10 @@ class WebSocket_Client(threading.Thread):
userclient.UserClient().get_user(data) userclient.UserClient().get_user(data)
self.librarySync.refresh_views = True self.librarySync.refresh_views = True
elif messageType == "ServerShuttingDown":
# Server went offline
window('emby_online', value="false")
def on_close(self, ws): def on_close(self, ws):
log.debug("Closed.") log.debug("Closed.")

View file

@ -67,6 +67,7 @@
<setting id="additionalUsers" type="text" label="30528" default="" /> <setting id="additionalUsers" type="text" label="30528" default="" />
<setting type="lsep" label="30534" /> <setting type="lsep" label="30534" />
<setting id="connectMsg" type="bool" label="30249" default="true" /> <setting id="connectMsg" type="bool" label="30249" default="true" />
<setting id="offlinetMsg" type="bool" label="30545" default="true" />
<setting id="restartMsg" type="bool" label="30530" default="false" /> <setting id="restartMsg" type="bool" label="30530" default="false" />
<setting id="newContent" type="bool" label="30531" default="false" /> <setting id="newContent" type="bool" label="30531" default="false" />
<setting id="newvideotime" type="number" label="30532" visible="eq(-1,true)" default="5" option="int" subsetting="true" /> <setting id="newvideotime" type="number" label="30532" visible="eq(-1,true)" default="5" option="int" subsetting="true" />

View file

@ -227,6 +227,7 @@ class Service(object):
log.info("Server is offline.") log.info("Server is offline.")
window('emby_online', value="false") window('emby_online', value="false")
if settings('offlineMsg') == "true":
xbmcgui.Dialog().notification( xbmcgui.Dialog().notification(
heading=lang(33001), heading=lang(33001),
message="%s %s" % (self.addonName, lang(33002)), message="%s %s" % (self.addonName, lang(33002)),