From a4496706672f5f67074554d54fc4010b9931a32f Mon Sep 17 00:00:00 2001 From: JonnyWong16 Date: Sun, 17 Dec 2017 23:12:56 -0800 Subject: [PATCH] Some more first run fixes --- data/interfaces/default/welcome.html | 2 +- plexpy/config.py | 9 ++------- plexpy/web_socket.py | 9 +++++---- plexpy/webserve.py | 10 ++++++++++ 4 files changed, 18 insertions(+), 12 deletions(-) diff --git a/data/interfaces/default/welcome.html b/data/interfaces/default/welcome.html index 7938cd81..934cf642 100644 --- a/data/interfaces/default/welcome.html +++ b/data/interfaces/default/welcome.html @@ -18,7 +18,6 @@ - ${next.headIncludes()} @@ -164,6 +163,7 @@
+ diff --git a/plexpy/config.py b/plexpy/config.py index 2036251e..62714751 100644 --- a/plexpy/config.py +++ b/plexpy/config.py @@ -175,8 +175,8 @@ _CONFIG_DEFINITIONS = { 'GIT_PATH': (str, 'General', ''), 'GIT_REMOTE': (str, 'General', 'origin'), 'GIT_TOKEN': (str, 'General', ''), - 'GIT_USER': (str, 'General', 'tautulli'), - 'GIT_REPO': (str, 'General', 'tautulli'), + 'GIT_USER': (str, 'General', 'JonnyWong16'), + 'GIT_REPO': (str, 'General', 'plexpy'), 'GRAPH_TYPE': (str, 'General', 'plays'), 'GRAPH_DAYS': (int, 'General', 30), 'GRAPH_MONTHS': (int, 'General', 12), @@ -873,8 +873,3 @@ class Config(object): self.MUSIC_WATCHED_PERCENT = self.NOTIFY_WATCHED_PERCENT self.CONFIG_VERSION == 9 - - if self.CONFIG_VERSION == 9: - if self.GIT_USER.lower() == 'jonnywong16': - self.GIT_USER = 'tautulli' - self.CONFIG_VERSION = 10 \ No newline at end of file diff --git a/plexpy/web_socket.py b/plexpy/web_socket.py index 9de7350d..5163eba5 100644 --- a/plexpy/web_socket.py +++ b/plexpy/web_socket.py @@ -33,10 +33,11 @@ ws_reconnect = False def start_thread(): - # Check for any existing sessions on start up - activity_pinger.check_active_sessions(ws_request=True) - # Start the websocket listener on it's own thread - threading.Thread(target=run).start() + if plexpy.CONFIG.FIRST_RUN_COMPLETE: + # Check for any existing sessions on start up + activity_pinger.check_active_sessions(ws_request=True) + # Start the websocket listener on it's own thread + threading.Thread(target=run).start() def on_disconnect(): diff --git a/plexpy/webserve.py b/plexpy/webserve.py index 1aab403c..d43aa59e 100644 --- a/plexpy/webserve.py +++ b/plexpy/webserve.py @@ -2722,12 +2722,18 @@ class WebInterface(object): del kwargs[use_config] # Check if we should refresh our data + first_run = False server_changed = False reschedule = False https_changed = False refresh_libraries = False refresh_users = False + # First run from the setup wizard + if kwargs.get('first_run'): + del kwargs['first_run'] + first_run = True + # If we change any monitoring settings, make sure we reschedule tasks. if kwargs.get('check_github') != plexpy.CONFIG.CHECK_GITHUB or \ kwargs.get('refresh_libraries_interval') != str(plexpy.CONFIG.REFRESH_LIBRARIES_INTERVAL) or \ @@ -2796,6 +2802,10 @@ class WebInterface(object): pmsconnect.get_server_friendly_name() web_socket.reconnect() + # If first run, start websocket + if first_run: + web_socket.start_thread() + # Reconfigure scheduler if intervals changed if reschedule: plexpy.initialize_scheduler()