diff --git a/PlexPy.py b/PlexPy.py index 0243ce0f..4b4ad54d 100755 --- a/PlexPy.py +++ b/PlexPy.py @@ -20,7 +20,7 @@ import sys # Ensure lib added to path, before any other imports sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'lib/')) -from plexpy import webstart, logger +from plexpy import webstart, logger, web_socket import locale import time @@ -191,6 +191,16 @@ def main(): # Start the background threads plexpy.start() + # Open connection for websocket + if plexpy.CONFIG.MONITORING_USE_WEBSOCKET: + try: + web_socket.start_thread() + except: + logger.warn(u"Websocket :: Unable to open connection.") + # Fallback to polling + plexpy.CONFIG.MONITORING_USE_WEBSOCKET = 0 + plexpy.initialize_scheduler() + # Open webbrowser if plexpy.CONFIG.LAUNCH_BROWSER and not args.nolaunch: plexpy.launch_browser(plexpy.CONFIG.HTTP_HOST, http_port, diff --git a/data/interfaces/default/settings.html b/data/interfaces/default/settings.html index 560165f5..cd80ec4d 100644 --- a/data/interfaces/default/settings.html +++ b/data/interfaces/default/settings.html @@ -262,6 +262,7 @@ available_notification_agents = notifiers.available_notification_agents()
If you're using websocket monitoring, any server changes require a restart of PlexPy.
The interval (in seconds) PlexPy will ping your Plex Server. Min 30 seconds, recommended 60 seconds.
Instead of polling the server at regular intervals let the server tell us when something happens.
+