From 90443b4028b52b50e109ba48ee3809647fed5827 Mon Sep 17 00:00:00 2001 From: JonnyWong16 Date: Wed, 14 Feb 2018 08:53:27 -0800 Subject: [PATCH] Catch failed to retrieve Plex Cloud status --- plexpy/activity_pinger.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/plexpy/activity_pinger.py b/plexpy/activity_pinger.py index 64b4f059..966158c2 100644 --- a/plexpy/activity_pinger.py +++ b/plexpy/activity_pinger.py @@ -272,13 +272,17 @@ def connect_server(log=True, startup=False): plex_tv = plextv.PlexTV() status = plex_tv.get_cloud_server_status() - if status: + if status is True: logger.info(u"Tautulli Monitor :: Plex Cloud server is active.") - else: + elif status is False: if log: logger.info(u"Tautulli Monitor :: Plex Cloud server is sleeping.") - if startup: - web_socket.on_disconnect() + else: + if log: + logger.error(u"Tautulli Monitor :: Failed to retrieve Plex Cloud server status.") + + if not status and startup: + web_socket.on_disconnect() else: status = True