jellyfin / jellyfin-kodi

Jellyfin Plugin for Kodi
https://jellyfin.org
GNU General Public License v3.0
820 stars 111 forks source link

Sync Failed #849

Closed hf-hf closed 5 months ago

hf-hf commented 5 months ago

Describe the bug Resource Sync failed,reinstalling Kodi and sync again still cannot run,I think the log may indicate that a certain resource is missing the VideoRangeType field. After clearing some resources and rescanning the media library, it still hasn't returned to normal.

Logs

2024-04-07 16:00:03.338 T:45264    info <general>: JELLYFIN.jellyfin_kodi.objects.tvshows -> DEBUG::jellyfin_kodi\objects\tvshows.py:299 EpisodeId be1c02b26f5f1863ccdbee0fea57fe3f not found
2024-04-07 16:00:03.350 T:45264    info <general>: JELLYFIN.jellyfin_kodi.database -> ERROR::jellyfin_kodi\database\__init__.py:165 type: <class 'KeyError'> value: 'VideoRangeType'
2024-04-07 16:00:03.353 T:45264    info <general>: JELLYFIN.jellyfin_kodi.database -> DEBUG::jellyfin_kodi\database\__init__.py:169 [jellyfin] 1 rows updated.
2024-04-07 16:00:03.356 T:45264    info <general>: JELLYFIN.jellyfin_kodi.database -> DEBUG::jellyfin_kodi\database\__init__.py:172 ---<[ database: jellyfin ] 1847219069936
2024-04-07 16:00:03.359 T:45264    info <general>: JELLYFIN.jellyfin_kodi.database -> ERROR::jellyfin_kodi\database\__init__.py:165 type: <class 'KeyError'> value: 'VideoRangeType'
2024-04-07 16:00:03.361 T:45264    info <general>: JELLYFIN.jellyfin_kodi.database -> DEBUG::jellyfin_kodi\database\__init__.py:169 [video] 21 rows updated.
2024-04-07 16:00:03.371 T:45264    info <general>: JELLYFIN.jellyfin_kodi.database -> DEBUG::jellyfin_kodi\database\__init__.py:172 ---<[ database: video ] 1847219071616
2024-04-07 16:00:03.380 T:13560    info <general>: Loading skin file: DialogConfirm.xml, load type: KEEP_IN_MEMORY
2024-04-07 16:00:05.315 T:13560 warning <general>: CGUIWindowManager - CGUIWindowManager::HandleAction - ignoring action 107, because topmost modal dialog closing animation is running
2024-04-07 16:00:05.335 T:45264    info <general>: JELLYFIN.jellyfin_kodi.full_sync -> ERROR::jellyfin_kodi\full_sync.py:274 full sync exited unexpectedly
2024-04-07 16:00:05.343 T:45264    info <general>: JELLYFIN.jellyfin_kodi.full_sync -> ERROR::jellyfin_kodi\full_sync.py:275 'VideoRangeType'
                                                   Traceback (most recent call last):
                                                     File "jellyfin_kodi\full_sync.py", line 260, in process_library
                                                       media[library['CollectionType']](library)
                                                     File "jellyfin_kodi\helper\wrapper.py", line 41, in wrapper
                                                       result = func(self, dialog=dialog, *args, **kwargs)
                                                     File "jellyfin_kodi\full_sync.py", line 358, in tvshows
                                                       obj.episode(episode)
                                                     File "jellyfin_kodi\helper\wrapper.py", line 65, in wrapper
                                                       return func(*args, **kwargs)
                                                     File "jellyfin_kodi\helper\wrapper.py", line 77, in wrapper
                                                       return func(self, item, e_item=e_item, *args, **kwargs)
                                                     File "jellyfin_kodi\objects\tvshows.py", line 325, in episode
                                                       obj['Video'] = API.video_streams(obj['Video'] or [], obj['Container'])
                                                     File "jellyfin_kodi\helper\api.py", line 79, in video_streams
                                                       elif track['VideoRangeType'] in ["HDR10", "HDR10Plus"]:
                                                   KeyError: 'VideoRangeType'

2024-04-07 16:00:05.346 T:45264    info <general>: JELLYFIN.jellyfin_kodi.helper.utils -> DEBUG::jellyfin_kodi\helper\utils.py:56 --[ window clear: jellyfin_sync ]
2024-04-07 16:00:05.352 T:45264    info <general>: JELLYFIN.jellyfin_kodi.full_sync -> INFO::jellyfin_kodi\full_sync.py:603 --<[ fullsync ]
2024-04-07 16:00:05.360 T:45264    info <general>: JELLYFIN.jellyfin_kodi.library -> ERROR::jellyfin_kodi\library.py:532 'VideoRangeType'
                                                   Traceback (most recent call last):
                                                     File "jellyfin_kodi\library.py", line 530, in add_library
                                                       sync.libraries(library_id, update)
                                                     File "jellyfin_kodi\full_sync.py", line 109, in libraries
                                                       self.start()
                                                     File "jellyfin_kodi\full_sync.py", line 193, in start
                                                       self.process_library(library)
                                                     File "jellyfin_kodi\full_sync.py", line 260, in process_library
                                                       media[library['CollectionType']](library)
                                                     File "jellyfin_kodi\helper\wrapper.py", line 41, in wrapper
                                                       result = func(self, dialog=dialog, *args, **kwargs)
                                                     File "jellyfin_kodi\full_sync.py", line 358, in tvshows
                                                       obj.episode(episode)
                                                     File "jellyfin_kodi\helper\wrapper.py", line 65, in wrapper
                                                       return func(*args, **kwargs)
                                                     File "jellyfin_kodi\helper\wrapper.py", line 77, in wrapper
                                                       return func(self, item, e_item=e_item, *args, **kwargs)
                                                     File "jellyfin_kodi\objects\tvshows.py", line 325, in episode
                                                       obj['Video'] = API.video_streams(obj['Video'] or [], obj['Container'])
                                                     File "jellyfin_kodi\helper\api.py", line 79, in video_streams
                                                       elif track['VideoRangeType'] in ["HDR10", "HDR10Plus"]:
                                                   KeyError: 'VideoRangeType'

System (please complete the following information): Jellyfin Version: 10.8.0 Kodi Version: Kodi v21 (Omega)

mcarlton00 commented 5 months ago

Looks like fallout from #804. Was this a movie library or something else? I didn't notice any errors from my testing, but it's always possible I missed something.

gurg1e commented 5 months ago

I needed to resync my whole library and i'm getting a failure too. It just sits at 0% stuck on the first episode of the fist show in my library.

Jellyfin 10.8.13 JfK 1.0.1 Kodi 19.5


2024-04-09 10:24:09.575 T:3746     INFO <general>: JELLYFIN.jellyfin_kodi.objects.tvshows -> DEBUG::jellyfin_kodi/objects/tvshows.py:404 Setting episode pathParentId, episode 45b2ab24b3a9d76867094b5a4a4d8144, title Countdown, pathId 4, pathParentId None
2024-04-09 10:24:09.583 T:3746     INFO <general>: JELLYFIN.jellyfin_kodi.objects.tvshows -> DEBUG::jellyfin_kodi/objects/tvshows.py:407 ADD episode [4/2] 45b2ab24b3a9d76867094b5a4a4d8144: Countdown
2024-04-09 10:24:09.592 T:3746     INFO <general>: JELLYFIN.jellyfin_kodi.database -> ERROR::jellyfin_kodi/database/__init__.py:165 type: <class 'sqlite3.OperationalError'> value: table streamdetails has no column named strHdrType
2024-04-09 10:24:09.596 T:3746     INFO <general>: JELLYFIN.jellyfin_kodi.database -> DEBUG::jellyfin_kodi/database/__init__.py:169 [jellyfin] 2 rows updated.
2024-04-09 10:24:09.605 T:3746     INFO <general>: JELLYFIN.jellyfin_kodi.database -> DEBUG::jellyfin_kodi/database/__init__.py:172 ---<[ database: jellyfin ] 68548680
2024-04-09 10:24:09.611 T:3746     INFO <general>: JELLYFIN.jellyfin_kodi.database -> ERROR::jellyfin_kodi/database/__init__.py:165 type: <class 'sqlite3.OperationalError'> value: table streamdetails has no column named strHdrType
2024-04-09 10:24:09.615 T:3746     INFO <general>: JELLYFIN.jellyfin_kodi.database -> DEBUG::jellyfin_kodi/database/__init__.py:169 [video] 81 rows updated.
2024-04-09 10:24:09.629 T:3746     INFO <general>: JELLYFIN.jellyfin_kodi.database -> DEBUG::jellyfin_kodi/database/__init__.py:172 ---<[ database: video ] 70197544 ````
oddstr13 commented 5 months ago

@gurg1e You're seeing a different but related issue

hf-hf commented 5 months ago

@mcarlton00 The sync of both movies and tvshows library programs has this issue.In the problematic program, I printed the track information, and indeed the VideoRangeType field is missing.

Movies sync print logs: 44.649 T:63120 info : JELLYFIN.jellyfin_kodi.database -> DEBUG::jellyfin_kodi\database__init.py:60 --->[ database: jellyfin ] 2039767368688 2024-04-09 14:26:44.654 T:63120 info : JELLYFIN.jellyfin_kodi.objects.movies -> DEBUG::jellyfin_kodi\objects\movies.py:62 MovieId 9d09f6944d1883338fd4f26d47d92b2d not found 2024-04-09 14:26:44.663 T:63120 info : JELLYFIN.jellyfin_kodi.helper.api -> DEBUG::jellyfin_kodi\helper\api.py:75 Track VideoRangeType: {'Codec': 'h264', 'TimeBase': '1/1000', 'VideoRange': 'SDR', 'DisplayTitle': '1080p H264 SDR', 'NalLengthSize': '0', 'IsInterlaced': False, 'IsAVC': False, 'BitRate': 2418371, 'BitDepth': 8, 'RefFrames': 1, 'IsDefault': True, 'IsForced': False, 'Height': 1080, 'Width': 1920, 'AverageFrameRate': 25, 'RealFrameRate': 25, 'Profile': 'High', 'Type': 'Video', 'AspectRatio': '16:9', 'Index': 0, 'IsExternal': False, 'IsTextSubtitleStream': False, 'SupportsExternalStream': False, 'PixelFormat': 'yuv420p', 'Level': 41} 2024-04-09 14:26:44.665 T:63120 info : JELLYFIN.jellyfin_kodi.database -> ERROR::jellyfin_kodi\database\init__.py:165 type: <class 'KeyError'> value: 'VideoRangeType'

Tvshows sync print logs: 2024-04-09 11:51:49.720 T:30480 info : JELLYFIN.jellyfin_kodi.objects.tvshows -> DEBUG::jellyfin_kodi\objects\tvshows.py:299 EpisodeId 7a59de3f51b5df490168513e217c743d not found 2024-04-09 11:51:49.731 T:30480 info : JELLYFIN.jellyfin_kodi.helper.api -> DEBUG::jellyfin_kodi\helper\api.py:75 Track VideoRangeType: {'Codec': 'h264', 'CodecTag': 'avc1', 'Language': 'und', 'ColorSpace': 'bt709', 'ColorTransfer': 'bt709', 'ColorPrimaries': 'bt709', 'TimeBase': '1/12800', 'VideoRange': 'SDR', 'DisplayTitle': '1080p H264 SDR', 'NalLengthSize': '0', 'IsInterlaced': False, 'IsAVC': False, 'BitRate': 1803192, 'BitDepth': 8, 'RefFrames': 1, 'IsDefault': True, 'IsForced': False, 'Height': 1080, 'Width': 1920, 'AverageFrameRate': 24.999517, 'RealFrameRate': 25, 'Profile': 'High', 'Type': 'Video', 'AspectRatio': '16:9', 'Index': 0, 'IsExternal': False, 'IsTextSubtitleStream': False, 'SupportsExternalStream': False, 'PixelFormat': 'yuv420p', 'Level': 40} 2024-04-09 11:51:49.734 T:30480 info : JELLYFIN.jellyfin_kodi.database -> ERROR::jellyfin_kodi\database__init__.py:165 type: <class 'KeyError'> value: 'VideoRangeType'

hf-hf commented 5 months ago

I modified helper/api.py to use VideoRange when VideoRangeType is missing. After building and installing it, the synchronization works properly now.

oddstr13 commented 5 months ago

@hf-hf Should be fixed in 1.0.2