From c36b896f99b199eb64b9663927948e928a35e779 Mon Sep 17 00:00:00 2001 From: angelblue05 <tamara.angel05@gmail.com> Date: Thu, 4 Jun 2015 03:44:55 -0500 Subject: [PATCH] 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. --- resources/settings.xml | 2 +- service.py | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/resources/settings.xml b/resources/settings.xml index 58e99f5b..635c5474 100644 --- a/resources/settings.xml +++ b/resources/settings.xml @@ -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> diff --git a/service.py b/service.py index 80a9d82b..10e61c37 100644 --- a/service.py +++ b/service.py @@ -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.