From 59a2becb313618e00f023e9423a672f3bee47d7b Mon Sep 17 00:00:00 2001 From: Ian Walton Date: Sun, 19 Jun 2022 14:13:37 -0400 Subject: [PATCH] Make reconnect less prone to being lost by event troubles. --- jellyfin_mpv_shim/clients.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/jellyfin_mpv_shim/clients.py b/jellyfin_mpv_shim/clients.py index 11fca2f101..cff9e93863 100644 --- a/jellyfin_mpv_shim/clients.py +++ b/jellyfin_mpv_shim/clients.py @@ -181,7 +181,11 @@ def event(event_name, data): break else: log.warning("Client is not actually connected. (It does not show in the client list.)") + # WebSocketDisconnect doesn't always happen here. + client.callback = lambda *_: None + client.callback_ws = lambda *_: None client.stop() + event("WebSocketDisconnect", None) return False return True