aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/Library/LibraryManager.cs
AgeCommit message (Collapse)Author
20 hoursMerge pull request #17399 from Shadowghost/fix-extra-yearCody Robibero
Fix incorrect year on local trailers
24 hoursMerge pull request #17395 from paoloantinori/fix/userdata-null-user-nre-masterCody Robibero
Avoid NRE when sorting by user-dependent keys without a user
26 hoursRemove added comments (#17395 review)Paolo Antinori
4 daysPrefer null checks over HasValue everywhereShadowghost
4 daysfix: avoid NRE when sorting by user-dependent keys without a userPaolo Antinori
A query sorted by a user-dependent key (PlayCount, IsFavoriteOrLiked, DatePlayed, IsPlayed, IsUnplayed) but carrying no User caused a NullReferenceException inside UserDataManager.GetUserData, surfacing as "Failed to compare two elements in the array" (InvalidOperationException wrapping the NRE from the LINQ sort) and 500-ing the /Items request. Root cause: LibraryManager.GetComparer assigned comparer.User = user without a null guard, so PlayCountComparer.GetValue called UserDataManager.GetUserData(null, item), dereferencing user.Id. Two-part fix: - LibraryManager.GetComparer: when user is null and the sort key requires a user (IUserBaseItemComparer), substitute the SortName comparer so the result stays deterministic instead of 500-ing. SortName is the project's canonical tiebreaker (ItemsController injects it for album-by-artist). - UserDataManager.GetUserData: ArgumentNullException.ThrowIfNull(user) as defense in depth (matches the existing guards on the SaveUserData overloads in the same file). On master this overload was rewritten to use ResolveUserDataRow, so the NRE dereferences user.Id rather than user.InternalId as on the release branch — same bug, different line. Also fixes DateLastMediaAddedComparer being statically mis-tagged as IUserBaseItemComparer: its GetDate is static and never reads User, so it does not need one. Without this, the SortName fallback above would wrongly engage for DateLastContentAdded on anonymous queries (returning SortName order instead of date order). Re-tagged to IBaseItemComparer and dropped the unused User/UserManager/UserDataManager properties. Tests: - UserDataManagerTests.GetUserData_NullUser_ThrowsArgumentNullException: reproduces the crash (NRE -> now ArgumentNullException). Added to master's existing UserDataManagerTests. - LibraryManagerSortTests.Sort_UserDependentKey_NullUser_FallsBackToSortNameWithoutThrowing: Sort with a user-dependent key + null user no longer throws and returns items ordered by the SortName fallback (direction preserved). - LibraryManagerSortTests.Sort_DateLastContentAdded_NullUser_OrdersByDateNotSortName: guards that DateLastContentAdded still sorts by date with no user (fixture chosen so date-desc and SortName-desc disagree, so a revert is caught). Full Jellyfin.Server.Implementations.Tests suite: 642 passed, 0 failed. Fixes #17393
5 daysMerge pull request #16980 from ↵Cody Robibero
TheMelmacian/feature/library_specific_language_filter_values Improve language filters to only fetch language codes that match the requested items/libraries (follow up to #9787)
2026-06-08Merge pull request #10841 from Bond-009/LiveTvImageFixBond-009
Refresh live TV channel image when remapped (alt #7843) (fixes #7834)
2026-06-07Merge pull request #16941 from Shadowghost/fix-external-data-pruningBond-009
Fix external data pruning on item deletion
2026-06-03Do not set topParentId if OwnerIds are emptyShadowghost
2026-05-31Fix similarity (#16942)Tim Eisele
Fix similarity
2026-05-30only fetch language codes for the requested library when generating filter ↵TheMelmacian
values
2026-05-27Merge pull request #16856 from Shadowghost/movie-recommendationsBond-009
Fix movie recommendations
2026-05-26Fix external data pruning on item deletionShadowghost
2026-05-21Alternate solution to #7843 without extra propBond_009
2026-05-15Merge pull request #9787 from TheMelmacian/feature/language_filtersBond-009
New filters for audio and subtitle languages
2026-05-15Fix movie recommendationsShadowghost
2026-05-13Fix multipart version item creationShadowghost
2026-05-12move language filters from QueryFiltersLegacy to QueryFiltersTheMelmacian
2026-05-04Merge pull request #16166 from Shadowghost/ignore-cachingNiels van Velzen
Implement ignore rule caching
2026-05-04Merge pull request #16761 from Shadowghost/fix-recursive-collection-folderNiels van Velzen
Fix Playlist and Boxset query, save and count performance
2026-05-04Merge pull request #16616 from dkanada/fix-person-limitNiels van Velzen
fix person TotalRecordCount when limit is applied
2026-05-04Fix Playlist and Boxset query and count perfShadowghost
2026-05-04fix person TotalRecordCount when limit is applieddkanada
2026-05-03Implement ignore rule cachingShadowghost
2026-04-11Fix filtersShadowghost
2026-04-07Merge remote-tracking branch 'upstream/master' into perf-rebasedShadowghost
2026-04-01Wrap method parametersShadowghost
2026-03-14Handle removed alternatesShadowghost
2026-03-11Return BadRequest when an invalid set of filters is givenBond_009
2026-03-11Safeguard against empty listShadowghost
2026-03-11Fix DeleteItemsUnsafeFast usageShadowghost
2026-03-07Split BaseItemRepository and IItemRepositoryShadowghost
2026-02-27Fix version promotion if multiple versions changeShadowghost
2026-02-27Fix LinkedAlternativeVersion validationShadowghost
2026-02-27Enable Extras for BD and DVD foldersShadowghost
2026-02-25Update saved metadata on primary changeShadowghost
2026-02-23FixupShadowghost
2026-02-23Fix version promotionShadowghost
2026-02-18Optimize item count calculation for named itemsShadowghost
2026-02-15Fix Extra refreshShadowghost
2026-02-15Migrate PrimaryVersionId to GUID and fix assignmentShadowghost
2026-02-08Fix multiple version resolutionShadowghost
2026-02-07Fix version resolution and scan handlingShadowghost
2026-02-07Optimize Collection Grouping, NextUp and Latest queriesShadowghost
2026-02-05Fix multiple version handlingShadowghost
2026-01-31Optimize Validator and Filter PerformanceShadowghost
2026-01-31Reroute on version removalShadowghost
2026-01-18Complete LinkedChildren integration and batch DTO optimizationsShadowghost
This commit integrates remaining performance changes: - Add batch user data fetching in DtoService to reduce N+1 queries - Add GetNextUpEpisodesBatch in TVSeriesManager for efficient batch retrieval - Update Video/Movie/BoxSet to use LibraryManager for alternate versions - Transition LinkedChild to use ItemId instead of Path (obsolete Path/LibraryItemId) - Update providers and controllers for LinkedChildren-based references - Add NextUpEpisodeBatchResult for batched episode queries - Integrate IDescendantQueryProvider in SqliteDatabaseProvider
2026-01-18Backport pull request #15965 from jellyfin/release-10.11.zCollin-Swish
Add mblink creation logic to library update endpoint. Original-merge: 22d593b8e986ecdb42fb1e618bfcf833b0a6f118 Merged-by: crobibero <cody@robibe.ro> Backported-by: Bond_009 <bond.009@outlook.com>
2026-01-18Backport pull request #15899 from jellyfin/release-10.11.zMarcoCoreDuo
Fix watched state not kept on Media replace/rename Original-merge: 8433b6d8a41f66f6eef36bb950927c6a6afa1a36 Merged-by: joshuaboniface <joshua@boniface.me> Backported-by: Bond_009 <bond.009@outlook.com>