mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-12-25 10:16:11 +00:00
Websocket Server online check modification
This is in place, in the hopes to prevent a false "Server unreachable" error, created by a random int is not be iterated. Will be revisited once this elusive error is resolved.
This commit is contained in:
parent
6a0b9a4934
commit
795430daff
1 changed files with 7 additions and 6 deletions
|
@ -307,7 +307,13 @@ class WebSocketThread(threading.Thread):
|
|||
#raise
|
||||
|
||||
def on_close(self, ws):
|
||||
WINDOW = self.WINDOW
|
||||
self.logMsg("Closed", 2)
|
||||
# Server is not online
|
||||
if WINDOW.getProperty("Server_online") == "true":
|
||||
self.logMsg("Server is unreachable.", 1)
|
||||
WINDOW.setProperty("Server_online", "false")
|
||||
xbmcgui.Dialog().notification("Error connecting", "%s Server is unreachable." % self.addonName)
|
||||
|
||||
def on_open(self, ws):
|
||||
pass
|
||||
|
@ -348,14 +354,9 @@ class WebSocketThread(threading.Thread):
|
|||
self.client.run_forever()
|
||||
|
||||
if (self.keepRunning):
|
||||
# Server is not online
|
||||
if WINDOW.getProperty("Server_online") == "true":
|
||||
self.logMsg("Server is unreachable.", 1)
|
||||
WINDOW.setProperty("Server_online", "false")
|
||||
xbmcgui.Dialog().notification("Error connecting", "%s Server is unreachable." % self.addonName)
|
||||
|
||||
if self.KodiMonitor.waitForAbort(5):
|
||||
break
|
||||
else: break
|
||||
|
||||
self.logMsg("Thread Exited")
|
||||
|
Loading…
Reference in a new issue