diff --git a/PlexPy.py b/PlexPy.py index 0243ce0f..4d8d953f 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.POLLING_FAILOVER = True + 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/current_activity.html b/data/interfaces/default/current_activity.html index 00a96048..7a741026 100644 --- a/data/interfaces/default/current_activity.html +++ b/data/interfaces/default/current_activity.html @@ -19,7 +19,7 @@ session_key Returns a unique session id for the active stream rating_key Returns the unique identifier for the media item. media_index Returns the index of the media item. parent_media_index Returns the index of the media item's parent. -type Returns the type of session. Either 'track', 'episode' or 'movie'. +media_type Returns the type of session. Either 'track', 'episode' or 'movie'. thumb Returns the location of the item's thumbnail. Use with pms_image_proxy. bif_thumb Returns the location of the item's bif thumbnail. Use with pms_image_proxy. art Returns the location of the item's artwork @@ -67,21 +67,21 @@ DOCUMENTATION :: END % if data['stream_count'] != '0': % for a in data['sessions']:
- % if a['type'] != 'photo': + % if a['media_type'] != 'photo':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. This is currently experimental. Encrypted websocket is not currently supported.
+