Commit Graph

456 Commits

Author SHA1 Message Date
Shadowghost 79a55327dc Fix extras naming and version assignment 2026-07-27 12:12:17 +02:00
Cody Robibero 7f26bd1091 Merge pull request #17399 from Shadowghost/fix-extra-year
Fix incorrect year on local trailers
2026-07-25 12:52:51 -04:00
Cody Robibero ebb66f6ca3 Merge pull request #17395 from paoloantinori/fix/userdata-null-user-nre-master
Avoid NRE when sorting by user-dependent keys without a user
2026-07-25 08:38:43 -04:00
Paolo Antinori 8b70582561 Remove added comments (#17395 review) 2026-07-25 12:50:32 +02:00
Shadowghost 6382563440 Prefer null checks over HasValue everywhere 2026-07-22 08:09:33 +02:00
Paolo Antinori 5d580abb08 fix: avoid NRE when sorting by user-dependent keys without a user
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
2026-07-22 07:43:58 +02:00
Cody Robibero 526f4051e9 Merge pull request #16980 from 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-07-21 20:43:31 -04:00
Bond-009 007515eb73 Merge pull request #10841 from Bond-009/LiveTvImageFix
Refresh live TV channel image when remapped (alt #7843) (fixes #7834)
2026-06-08 19:40:08 +02:00
Bond-009 ec43ea156e Merge pull request #16941 from Shadowghost/fix-external-data-pruning
Fix external data pruning on item deletion
2026-06-07 20:28:34 +02:00
Shadowghost 1b80da0c3d Do not set topParentId if OwnerIds are empty 2026-06-03 19:47:35 +02:00
Tim Eisele 63d1af5fe7 Fix similarity (#16942)
Fix similarity
2026-05-31 17:21:15 +02:00
TheMelmacian 7939f3b009 only fetch language codes for the requested library when generating filter values 2026-05-30 16:33:59 +02:00
Bond-009 2f17516d4b Merge pull request #16856 from Shadowghost/movie-recommendations
Fix movie recommendations
2026-05-27 20:59:18 +02:00
Shadowghost a05bde53d4 Fix external data pruning on item deletion 2026-05-26 20:44:03 +02:00
Bond_009 3d8bcf1ffd Alternate solution to #7843 without extra prop 2026-05-21 20:10:21 +02:00
Bond-009 9d420271ad Merge pull request #9787 from TheMelmacian/feature/language_filters
New filters for audio and subtitle languages
2026-05-15 15:44:22 +02:00
Shadowghost 97c20e6ac5 Fix movie recommendations 2026-05-15 14:37:01 +02:00
Shadowghost 4f81f29a90 Fix multipart version item creation 2026-05-13 23:10:05 +02:00
TheMelmacian 39049a726e move language filters from QueryFiltersLegacy to QueryFilters 2026-05-12 02:12:14 +02:00
Niels van Velzen d359d2f7a8 Merge pull request #16166 from Shadowghost/ignore-caching
Implement ignore rule caching
2026-05-04 17:59:48 +02:00
Niels van Velzen ba268cc3fb Merge pull request #16761 from Shadowghost/fix-recursive-collection-folder
Fix Playlist and Boxset query, save and count performance
2026-05-04 17:58:57 +02:00
Niels van Velzen dcba6c3659 Merge pull request #16616 from dkanada/fix-person-limit
fix person TotalRecordCount when limit is applied
2026-05-04 17:58:27 +02:00
Shadowghost fa65a392b0 Fix Playlist and Boxset query and count perf 2026-05-04 10:25:02 +02:00
dkanada ec990be12a fix person TotalRecordCount when limit is applied 2026-05-04 12:06:11 +09:00
Shadowghost d20c775daf Implement ignore rule caching 2026-05-03 23:35:33 +02:00
Shadowghost d8bbb4dfe8 Fix filters 2026-04-11 17:42:27 +02:00
Shadowghost 24a0df9a39 Merge remote-tracking branch 'upstream/master' into perf-rebased 2026-04-07 21:36:07 +02:00
Shadowghost 99ad70fbc8 Wrap method parameters 2026-04-01 18:01:25 +02:00
Shadowghost ebc15d3e27 Handle removed alternates 2026-03-14 20:26:40 +01:00
Bond_009 946c6b9981 Return BadRequest when an invalid set of filters is given 2026-03-11 21:22:48 +01:00
Shadowghost 352b6c91f8 Safeguard against empty list 2026-03-11 15:39:04 +01:00
Shadowghost a8a029de73 Fix DeleteItemsUnsafeFast usage 2026-03-11 09:16:35 +01:00
Shadowghost 077fa89717 Split BaseItemRepository and IItemRepository 2026-03-07 20:12:42 +01:00
Shadowghost 46ffe0af9c Fix version promotion if multiple versions change 2026-02-27 20:07:09 +01:00
Shadowghost 826e21ecc8 Fix LinkedAlternativeVersion validation 2026-02-27 13:51:51 +01:00
Shadowghost 885b45838c Enable Extras for BD and DVD folders 2026-02-27 13:30:23 +01:00
Shadowghost 2d0d497961 Update saved metadata on primary change 2026-02-25 21:03:46 +01:00
Shadowghost 34c1e45bc2 Fixup 2026-02-23 17:01:38 +01:00
Shadowghost ea0641b659 Fix version promotion 2026-02-23 09:05:43 +01:00
Shadowghost 3a090a5716 Optimize item count calculation for named items 2026-02-18 20:28:42 +01:00
Shadowghost ba356638e8 Fix Extra refresh 2026-02-15 23:13:01 +01:00
Shadowghost 3439d3c017 Migrate PrimaryVersionId to GUID and fix assignment 2026-02-15 23:12:52 +01:00
Shadowghost 71594b4a9a Fix multiple version resolution 2026-02-08 17:22:52 +01:00
Shadowghost 2420ece5fe Fix version resolution and scan handling 2026-02-07 19:01:37 +01:00
Shadowghost 268d88a5fb Optimize Collection Grouping, NextUp and Latest queries 2026-02-07 01:38:06 +01:00
Shadowghost a0346fe5b7 Fix multiple version handling 2026-02-05 01:41:07 +01:00
Shadowghost 2789532aa8 Optimize Validator and Filter Performance 2026-01-31 19:22:04 +01:00
Shadowghost 694db80d4c Reroute on version removal 2026-01-31 19:21:36 +01:00
Shadowghost 5996c4afce Complete LinkedChildren integration and batch DTO optimizations
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-18 19:48:46 +01:00
Collin-Swish afcaec0a89 Backport pull request #15965 from jellyfin/release-10.11.z
Add mblink creation logic to library update endpoint.

Original-merge: 22d593b8e9

Merged-by: crobibero <cody@robibe.ro>

Backported-by: Bond_009 <bond.009@outlook.com>
2026-01-18 11:30:39 -05:00