From 3b05f811b0ae7cd192f6c1d24f6869aaf0095a70 Mon Sep 17 00:00:00 2001 From: Adam Katz <6454774+adamhotep@users.noreply.github.com> Date: Thu, 4 Jan 2024 23:27:13 -0500 Subject: [PATCH 1/2] Solve issue with missing art When encountering a movie with missing image data, we'd get `EXCEPTION: argument "value" for method "setArt" must be unicode or str`. This is because that's sometimes an empty dict rather than a string. This converts `{}` to `""` to resolve the issue. --- resources/lib/common/kodi_wrappers.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/resources/lib/common/kodi_wrappers.py b/resources/lib/common/kodi_wrappers.py index c097301cc..d62204d84 100644 --- a/resources/lib/common/kodi_wrappers.py +++ b/resources/lib/common/kodi_wrappers.py @@ -79,6 +79,9 @@ def __setstate__(self, state): # Pickle method total_time = float(state['properties'].pop('TotalTime', 0)) video_info.setResumePoint(resume_time, total_time) super().setProperties(state['properties']) + for part in ['thumb', 'landscape']: + if part not in state['art'] or state['art'][part] == {}: + state['art'][part] = '' super().setArt(state['art']) super().addContextMenuItems(state.get('context_menus', [])) super().select(state.get('is_selected', False)) From 487c5a8885ea95ad0c32b76e0439b93433077330 Mon Sep 17 00:00:00 2001 From: Adam Katz <6454774+adamhotep@users.noreply.github.com> Date: Sun, 7 Jan 2024 00:18:44 -0500 Subject: [PATCH 2/2] Workaround is now non-desctructive (Not that this makes it much better; see CastagnaIT/plugin.video.netflix#1668) --- resources/lib/common/kodi_wrappers.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/resources/lib/common/kodi_wrappers.py b/resources/lib/common/kodi_wrappers.py index d62204d84..34a996bab 100644 --- a/resources/lib/common/kodi_wrappers.py +++ b/resources/lib/common/kodi_wrappers.py @@ -79,10 +79,11 @@ def __setstate__(self, state): # Pickle method total_time = float(state['properties'].pop('TotalTime', 0)) video_info.setResumePoint(resume_time, total_time) super().setProperties(state['properties']) + tmp_state = state['art'] for part in ['thumb', 'landscape']: - if part not in state['art'] or state['art'][part] == {}: - state['art'][part] = '' - super().setArt(state['art']) + if part not in tmp_state or tmp_state[part] == {}: + tmp_state[part] = '' + super().setArt(tmp_state) super().addContextMenuItems(state.get('context_menus', [])) super().select(state.get('is_selected', False))