From 293dc7a7680beabb3efa788ef00f1a98c478a8a2 Mon Sep 17 00:00:00 2001 From: Matt Date: Tue, 11 May 2021 19:51:34 -0400 Subject: [PATCH 1/4] Make sure numpy doesn't cause issues --- jellyfin_kodi/jellyfin/ws_client.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/jellyfin_kodi/jellyfin/ws_client.py b/jellyfin_kodi/jellyfin/ws_client.py index 3ba8d6b3..6c80d9b4 100644 --- a/jellyfin_kodi/jellyfin/ws_client.py +++ b/jellyfin_kodi/jellyfin/ws_client.py @@ -10,6 +10,10 @@ from kodi_six import xbmc from helper import LazyLogger +# If numpy is installed, the websockets library tries to use it, and then +# kodi hard crashes for reasons I don't even want to pretend to understand +import sys +sys.modules['numpy'] = None import websocket ################################################################################################## From 405a0038a3518b8e6707daa4be23d476677cad66 Mon Sep 17 00:00:00 2001 From: Matt Date: Tue, 11 May 2021 19:55:08 -0400 Subject: [PATCH 2/4] Stop throwing errors during playback reporting --- jellyfin_kodi/jellyfin/http.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/jellyfin_kodi/jellyfin/http.py b/jellyfin_kodi/jellyfin/http.py index a3027ca4..63c0f570 100644 --- a/jellyfin_kodi/jellyfin/http.py +++ b/jellyfin_kodi/jellyfin/http.py @@ -173,6 +173,9 @@ class HTTP(object): return clean_none_dict_values(response) except ValueError: return + except TypeError: + # Empty json + return def _request(self, data): From a4e024634f5e0c43ef219e4f0bc785820b108140 Mon Sep 17 00:00:00 2001 From: Matt Date: Sun, 16 May 2021 21:43:08 -0400 Subject: [PATCH 3/4] Make linter ignore these imports --- jellyfin_kodi/jellyfin/ws_client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jellyfin_kodi/jellyfin/ws_client.py b/jellyfin_kodi/jellyfin/ws_client.py index 6c80d9b4..6553f615 100644 --- a/jellyfin_kodi/jellyfin/ws_client.py +++ b/jellyfin_kodi/jellyfin/ws_client.py @@ -12,9 +12,9 @@ from helper import LazyLogger # If numpy is installed, the websockets library tries to use it, and then # kodi hard crashes for reasons I don't even want to pretend to understand -import sys +import sys # noqa: E402 sys.modules['numpy'] = None -import websocket +import websocket # noqa: E402 ################################################################################################## From 53aa27444b69654476fdb9e45a69dec5b0696b47 Mon Sep 17 00:00:00 2001 From: Matt Date: Sun, 16 May 2021 21:48:37 -0400 Subject: [PATCH 4/4] Arguments with a linter --- jellyfin_kodi/jellyfin/ws_client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jellyfin_kodi/jellyfin/ws_client.py b/jellyfin_kodi/jellyfin/ws_client.py index 6553f615..30f4c831 100644 --- a/jellyfin_kodi/jellyfin/ws_client.py +++ b/jellyfin_kodi/jellyfin/ws_client.py @@ -12,9 +12,9 @@ from helper import LazyLogger # If numpy is installed, the websockets library tries to use it, and then # kodi hard crashes for reasons I don't even want to pretend to understand -import sys # noqa: E402 +import sys # noqa: E402,I100 sys.modules['numpy'] = None -import websocket # noqa: E402 +import websocket # noqa: E402,I201 ##################################################################################################