Less logging when PMS is offline

This commit is contained in:
tomkat83 2016-12-17 13:21:44 +01:00
parent bdad097bd0
commit ce3435ac73
2 changed files with 10 additions and 10 deletions

View file

@ -215,12 +215,12 @@ class DownloadUtils():
# THE EXCEPTIONS # THE EXCEPTIONS
except requests.exceptions.ConnectionError as e: except requests.exceptions.ConnectionError as e:
# Connection error # Connection error
log.warn("Server unreachable at: %s" % url) log.debug("Server unreachable at: %s" % url)
log.warn(e) log.debug(e)
except requests.exceptions.Timeout as e: except requests.exceptions.Timeout as e:
log.warn("Server timeout at: %s" % url) log.debug("Server timeout at: %s" % url)
log.warn(e) log.debug(e)
except requests.exceptions.HTTPError as e: except requests.exceptions.HTTPError as e:
log.warn('HTTP Error at %s' % url) log.warn('HTTP Error at %s' % url)

View file

@ -221,10 +221,11 @@ class Service():
# Server is offline or cannot be reached # Server is offline or cannot be reached
# Alert the user and suppress future warning # Alert the user and suppress future warning
if self.server_online: if self.server_online:
log.error("Server is offline.") self.server_online = False
window('plex_online', value="false") window('plex_online', value="false")
# Suspend threads # Suspend threads
window('suspend_LibraryThread', value='true') window('suspend_LibraryThread', value='true')
log.error("Plex Media Server went offline")
xbmcgui.Dialog().notification( xbmcgui.Dialog().notification(
heading=lang(33001), heading=lang(33001),
message="%s %s" message="%s %s"
@ -232,10 +233,9 @@ class Service():
icon="special://home/addons/plugin.video." icon="special://home/addons/plugin.video."
"plexkodiconnect/icon.png", "plexkodiconnect/icon.png",
sound=False) sound=False)
self.server_online = False
counter += 1 counter += 1
# Periodically check if the IP changed, e.g. per minute # Periodically check if the IP changed, e.g. per minute
if counter > 30: if counter > 20:
counter = 0 counter = 0
setup = initialsetup.InitialSetup() setup = initialsetup.InitialSetup()
tmp = setup.PickPMS() tmp = setup.PickPMS()
@ -258,8 +258,8 @@ class Service():
"plexkodiconnect/icon.png", "plexkodiconnect/icon.png",
time=5000, time=5000,
sound=False) sound=False)
self.server_online = True self.server_online = True
log.warn("Server %s is online and ready." % server) log.info("Server %s is online and ready." % server)
window('plex_online', value="true") window('plex_online', value="true")
if window('plex_authenticated') == 'true': if window('plex_authenticated') == 'true':
# Server got offline when we were authenticated. # Server got offline when we were authenticated.
@ -273,7 +273,7 @@ class Service():
break break
if monitor.waitForAbort(2): if monitor.waitForAbort(3):
# Abort was requested while waiting. # Abort was requested while waiting.
break break