Server online check

Only display the notification in the event the server was offline first.
Removed the option to suppress it, as it is now useless. Also muted the
notification.
This commit is contained in:
angelblue05 2015-06-04 03:44:55 -05:00
parent b2655396cb
commit c36b896f99
2 changed files with 4 additions and 5 deletions

View file

@ -34,7 +34,7 @@
</category>
<category label="30022">
<setting id="logLevel" type="enum" label="30004" values="None|Info|Debug" default="0" />
<setting id="supressConnectMsg" type="bool" label="30249" default="false" visible="true" enable="true" />
<!--<setting id="supressConnectMsg" type="bool" label="30249" default="false" visible="true" enable="true" /> -->
<setting label="30239" type="action" action="RunPlugin(plugin://plugin.video.emby?mode=reset)" />
</category>

View file

@ -173,7 +173,7 @@ class Service():
if self.server_online:
WINDOW.setProperty("Server_online", "false")
self.logMsg("Server is offline.", 1)
xbmcgui.Dialog().notification("Error connecting", "%s Server is unreachable." % self.addonName)
xbmcgui.Dialog().notification("Error connecting", "%s Server is unreachable." % self.addonName, sound=False)
self.server_online = False
else:
# Server is online
@ -183,11 +183,10 @@ class Service():
if self.KodiMonitor.waitForAbort(5):
# Abort was requested while waiting.
break
xbmcgui.Dialog().notification("Connection successful", "%s Server is online." % self.addonName, time=2000, sound=False)
self.server_online = True
self.logMsg("Server is online and ready.", 1)
addonSettings = xbmcaddon.Addon(id='plugin.video.emby')
if addonSettings.getSetting("supressConnectMsg")=="false":
xbmcgui.Dialog().notification("Connection successful", "%s Server is online." % self.addonName, time=2000)
WINDOW.setProperty("Server_online", "true")
# Server is online, proceed.