-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix GetItems IndexOutOfRangeException when IDs do not exist #8189
Conversation
Can you retarget this PR to the release-10.8.z branch? That way we can include it in an patch update. |
… not exist via /Users/.../Items. Previously it was possible for the 'index' values in 'positions' to refer beyond 'size'. [ERR] Error processing request. URL "GET" "/Users/.../Items". System.IndexOutOfRangeException: Index was outside the bounds of the array. at MediaBrowser.Controller.Entities.Folder.SortItemsByRequest(InternalItemsQuery query, IReadOnlyList`1 items) at MediaBrowser.Controller.Entities.Folder.GetItems(InternalItemsQuery query) at Jellyfin.Api.Controllers.ItemsController.GetItems
4d56e2b
to
3bd2cc9
Compare
Have retargeted it to release-10.8.z now |
Am I crazy or could the entire method not be simplified to |
@lukefor Have you had a chance to look at my suggestion? |
Have made the suggested change. Problematic curl request is working and returning identical results to the previous fix |
Fix GetItems IndexOutOfRangeException when IDs do not exist Original-merge: 527ed06 Merged-by: Claus Vium <cvium@users.noreply.github.com> Backported-by: Joshua M. Boniface <joshua@boniface.me>
Fix GetItems IndexOutOfRangeException when IDs do not exist Original-merge: 527ed06 Merged-by: Claus Vium <cvium@users.noreply.github.com> Backported-by: Joshua M. Boniface <joshua@boniface.me>
Changes
Resolve a System.IndexOutOfRangeException when requesting IDs that do not exist via /Users/.../Items. Previously it was possible for the 'index' values in 'positions' to refer beyond 'size'. It seems the code previously assumed that all requested items exist
It caused jellyfin-kodi automatic syncs (i.e. the sync that happens automatically while Kodi is running) to fail as per #3531. I could get a consistent repro by making the same request via curl. With this change, Kodi is automatically syncing again, and the curl request returns correct results.
Issues
Fixes #3531