plexinc / plex-for-kodi

Offical Plex for Kodi add-on releases.
GNU General Public License v2.0
251 stars 124 forks source link

Last movies in the alphabet are missing #382

Open gdlx opened 1 year ago

gdlx commented 1 year ago

Description:

On large movie libraries (100s), movies in the end of the alphabetical order are missing. For example, on a 250 movies library, I don't see those starting with S and after. On a 700 movies library, I don't see those starting with U and after. Also, the A-Z selector points to movies starting with the wrong letter. Changing from grid to list or sorting order doesn't change anything (always the same last movies in the alphabet are missing). Applying a filter may show missing movies. Same issue on on Android TV and Windows. I have no issue on smaller libraries (<100). Searching missing movies works fine.

I think the following log may be related:

2023-01-22 00:26:12.235 T:18152   debug <general>: ------ Window Init (C:\Users\XXXX\AppData\Roaming\Kodi\addons\script.plex\resources\skins\Main\1080i\script-plex-busy.xml) ------
2023-01-22 00:26:12.235 T:18152    info <general>: Loading skin file: C:\Users\XXXX\AppData\Roaming\Kodi\addons\script.plex\resources\skins\Main\1080i\script-plex-busy.xml, load type: LOAD_ON_GUI_INIT
2023-01-22 00:26:12.235 T:41360    info <general>: script.plex: API: GET https://82-64-132-81.384aa259c1e243248602fa2bf37a583d.plex.direct:32400/library/sections/8/firstCharacter?sort=titleSort%3Aasc&X-Plex-Token=****
2023-01-22 00:26:12.333 T:40584    info <general>: script.plex: BGThreader: (queue.0:worker.0): Active
2023-01-22 00:26:12.333 T:40584    info <general>: script.plex: API: GET https://82-64-132-81.384aa259c1e243248602fa2bf37a583d.plex.direct:32400/library/sections/8/all?includeCollections=1&sort=titleSort%3Aasc&X-Plex-Container-Size=200&X-Plex-Container-Start=0&X-Plex-Token=****
2023-01-22 00:26:12.333 T:7436     info <general>: script.plex: BGThreader: (queue.0:worker.1): Active
2023-01-22 00:26:12.334 T:7436     info <general>: script.plex: API: GET https://82-64-132-81.384aa259c1e243248602fa2bf37a583d.plex.direct:32400/library/sections/8/all?includeCollections=1&sort=titleSort%3Aasc&X-Plex-Container-Size=200&X-Plex-Container-Start=200&X-Plex-Token=****
2023-01-22 00:26:12.334 T:38640    info <general>: script.plex: BGThreader: (queue.0:worker.2): Active
2023-01-22 00:26:12.334 T:38640    info <general>: script.plex: API: GET https://82-64-132-81.384aa259c1e243248602fa2bf37a583d.plex.direct:32400/library/sections/8/all?includeCollections=1&sort=titleSort%3Aasc&X-Plex-Container-Size=200&X-Plex-Container-Start=400&X-Plex-Token=****
2023-01-22 00:26:12.335 T:35416    info <general>: script.plex: BGThreader: (queue.0:worker.3): Active
2023-01-22 00:26:12.335 T:35416    info <general>: script.plex: API: GET https://82-64-132-81.384aa259c1e243248602fa2bf37a583d.plex.direct:32400/library/sections/8/all?includeCollections=1&sort=titleSort%3Aasc&X-Plex-Container-Size=200&X-Plex-Container-Start=600&X-Plex-Token=****
2023-01-22 00:26:12.407 T:18152   debug <general>: ------ Window Deinit (C:\Users\XXXX\AppData\Roaming\Kodi\addons\script.plex\resources\skins\Main\1080i\script-plex-busy.xml) ------
2023-01-22 00:26:12.471 T:18152   debug <general>: ------ Window Init (C:\Users\XXXX\AppData\Roaming\Kodi\addons\script.plex\resources\skins\Main\1080i\script-plex-busy.xml) ------
2023-01-22 00:26:12.471 T:18152    info <general>: Loading skin file: C:\Users\XXXX\AppData\Roaming\Kodi\addons\script.plex\resources\skins\Main\1080i\script-plex-busy.xml, load type: LOAD_ON_GUI_INIT
2023-01-22 00:26:12.577 T:18152   debug <general>: ------ Window Deinit (C:\Users\XXXX\AppData\Roaming\Kodi\addons\script.plex\resources\skins\Main\1080i\script-plex-busy.xml) ------
2023-01-22 00:26:12.590 T:40584    info <general>: script.plex: BGThreader (queue.0:worker.0): Idle
2023-01-22 00:26:12.649 T:38640    info <general>: script.plex: BGThreader (queue.0:worker.2): Idle
2023-01-22 00:26:12.666 T:35416   error <general>: EXCEPTION: Index out of range
2023-01-22 00:26:12.669 T:35416   error <general>: _________________________________________________________________________________
2023-01-22 00:26:12.669 T:35416   error <general>: script.plex: ERROR: 
2023-01-22 00:26:12.669 T:35416   error <general>:     Traceback (most recent call last):
2023-01-22 00:26:12.669 T:35416   error <general>:       File "C:\Users\XXXX\AppData\Roaming\Kodi\addons\script.plex\lib\backgroundthread.py", line 91, in _runTask
2023-01-22 00:26:12.669 T:35416   error <general>:         task._run()
2023-01-22 00:26:12.669 T:35416   error <general>:       File "C:\Users\XXXX\AppData\Roaming\Kodi\addons\script.plex\lib\backgroundthread.py", line 45, in _run
2023-01-22 00:26:12.669 T:35416   error <general>:         self.run()
2023-01-22 00:26:12.669 T:35416   error <general>:       File "C:\Users\XXXX\AppData\Roaming\Kodi\addons\script.plex\lib\windows\library.py", line 178, in run
2023-01-22 00:26:12.669 T:35416   error <general>:         self.callback(items, self.start)
2023-01-22 00:26:12.669 T:35416   error <general>:       File "C:\Users\XXXX\AppData\Roaming\Kodi\addons\script.plex\lib\windows\library.py", line 1524, in chunkCallback
2023-01-22 00:26:12.669 T:35416   error <general>:         self._chunkCallback(items, start)
2023-01-22 00:26:12.669 T:35416   error <general>:       File "C:\Users\XXXX\AppData\Roaming\Kodi\addons\script.plex\lib\windows\library.py", line 1603, in _chunkCallback
2023-01-22 00:26:12.669 T:35416   error <general>:         mli = self.showPanelControl[pos]
2023-01-22 00:26:12.669 T:35416   error <general>:       File "C:\Users\XXXX\AppData\Roaming\Kodi\addons\script.plex\lib\windows\kodigui.py", line 409, in __getitem__
2023-01-22 00:26:12.669 T:35416   error <general>:         return self.getListItem(idx)
2023-01-22 00:26:12.669 T:35416   error <general>:       File "C:\Users\XXXX\AppData\Roaming\Kodi\addons\script.plex\lib\windows\kodigui.py", line 501, in getListItem
2023-01-22 00:26:12.669 T:35416   error <general>:         li = self.control.getListItem(pos)
2023-01-22 00:26:12.669 T:35416   error <general>:     RuntimeError: Index out of range
2023-01-22 00:26:12.669 T:35416   error <general>: _________________________________________________________________________________
2023-01-22 00:26:12.669 T:35416   error <general>: `
2023-01-22 00:26:12.669 T:35416    info <general>: script.plex: BGThreader (queue.0:worker.3): Idle
2023-01-22 00:26:12.675 T:7436     info <general>: script.plex: BGThreader (queue.0:worker.1): Idle

Details:

Checklist

gdlx commented 1 year ago

@ruuk I've tried to debug and it seems this is caused by collections being added as movies. showPanelControl only contains as much items as movies, but chunks also contain collections.

Changing includeCollections to 0 here fixes the issue, but I'm not sure this is the way to go: https://github.com/plexinc/plex-for-kodi/blob/master/lib/_included_packages/plexnet/plexlibrary.py#L139

gdlx commented 1 year ago

Knowing this is collections related, I've just found that this is the same issue as #373, #354 and #344