jellyfin-kodi icon indicating copy to clipboard operation
jellyfin-kodi copied to clipboard

Crash if existing library ID for any reason is not returned by get_libraries

Open oddstr13 opened this issue 3 years ago • 0 comments

Describe the bug

To Reproduce

  1. Sync libraries
  2. Delete library in Jellyfin
  3. Trigger new sync

Expected behavior

Logs

2020-08-24 01:13:19.100 T:2493506416  NOTICE: JELLYFIN.database -> ERROR::jellyfin_kodi/database/__init__.py:186 type: <type 'exceptions.ValueError'> value: u'3ea17cff75a309cabede44ee3a92f942' is not in list
2020-08-24 01:13:19.111 T:2614596464  NOTICE: JELLYFIN.full_sync -> INFO::jellyfin_kodi/full_sync.py:58 -->[ fullsync ]
2020-08-24 01:13:19.123 T:2493506416   ERROR: Exception in thread Thread-5:
                                            Traceback (most recent call last):
                                              File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
                                              File "/storage/.kodi/addons/plugin.video.jellyfin/jellyfin_kodi/library.py", line 85, in run
                                                if not self.startup():
                                              File "/storage/.kodi/addons/plugin.video.jellyfin/jellyfin_kodi/library.py", line 308, in startup
                                                Views().get_nodes()
                                              File "/storage/.kodi/addons/plugin.video.jellyfin/jellyfin_kodi/views.py", line 246, in get_nodes
                                                self.add_nodes(node_path, view)
                                              File "/storage/.kodi/addons/plugin.video.jellyfin/jellyfin_kodi/views.py", line 303, in add_nodes
                                                self.node_index(folder, view, mixed)
                                              File "/storage/.kodi/addons/plugin.video.jellyfin/jellyfin_kodi/views.py", line 374, in node_index
                                                index = self.sync['SortedViews'].index(view['Id'])
                                            ValueError: u'3ea17cff75a309cabede44ee3a92f942' is not in list
2020-08-24 01:13:19.135 T:2614596464  NOTICE: JELLYFIN.helper.wrapper -> INFO::jellyfin_kodi/helper/wrapper.py:36 Processing Removing library
2020-08-24 01:13:19.171 T:2614596464  NOTICE: JELLYFIN.full_sync -> INFO::jellyfin_kodi/full_sync.py:580 --<[ fullsync ]
2020-08-24 01:13:19.619 T:2614596464  NOTICE: JELLYFIN.database -> ERROR::jellyfin_kodi/database/__init__.py:186 type: <type 'exceptions.ValueError'> value: u'3ea17cff75a309cabede44ee3a92f942' is not in list
2020-08-24 01:13:19.626 T:2614596464   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.ValueError'>
                                            Error Contents: u'3ea17cff75a309cabede44ee3a92f942' is not in list
                                            Traceback (most recent call last):
                                              File "/storage/.kodi/addons/plugin.video.jellyfin/jellyfin_kodi/entrypoint/service.py", line 296, in onNotification
                                                if not self.library_thread.remove_library(lib):
                                              File "/storage/.kodi/addons/plugin.video.jellyfin/jellyfin_kodi/library.py", line 534, in remove_library
                                                Views().get_nodes()
                                              File "/storage/.kodi/addons/plugin.video.jellyfin/jellyfin_kodi/views.py", line 246, in get_nodes
                                                self.add_nodes(node_path, view)
                                              File "/storage/.kodi/addons/plugin.video.jellyfin/jellyfin_kodi/views.py", line 303, in add_nodes
                                                self.node_index(folder, view, mixed)
                                              File "/storage/.kodi/addons/plugin.video.jellyfin/jellyfin_kodi/views.py", line 374, in node_index
                                                index = self.sync['SortedViews'].index(view['Id'])
                                            ValueError: u'3ea17cff75a309cabede44ee3a92f942' is not in list
                                            -->End of Python script error report<--
2020-08-24 01:13:19.636 T:2614596464  NOTICE: JELLYFIN.full_sync -> INFO::jellyfin_kodi/full_sync.py:58 -->[ fullsync ]
2020-08-24 01:13:19.657 T:2614596464  NOTICE: JELLYFIN.helper.wrapper -> INFO::jellyfin_kodi/helper/wrapper.py:36 Processing Removing library
2020-08-24 01:13:33.275 T:3011589456   ERROR: Control 50 in window 10025 has been asked to focus, but it can't

Screenshots

System (please complete the following information):

  • OS: any
  • Jellyfin Version: 10.6.3
  • Kodi Version: any
  • Addon Version: master
  • Playback Mode: n/a

Additional context

This issue gained my attention due to #352 but probably also happened due to #297

oddstr13 avatar Aug 24 '20 23:08 oddstr13