Skip to content

Commit

Permalink
Make reconnect less prone to being lost by event troubles.
Browse files Browse the repository at this point in the history
  • Loading branch information
iwalton3 committed Jun 19, 2022
1 parent eb678c2 commit 59a2bec
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions jellyfin_mpv_shim/clients.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 59a2bec

Please sign in to comment.