mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-05 20:51:15 -07:00
Very early work on implementing websocket monitoring method.
This commit is contained in:
parent
9c955771c0
commit
fa71beb03f
24 changed files with 7814 additions and 3 deletions
12
PlexPy.py
12
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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue