Commit graph

468 commits

Author SHA1 Message Date
Cody Robibero
f682c22b08
Merge pull request #17715 from Shadowghost/fix-people-cleanup
Delete credits nothing maps to and bound item-by-name folder names
2026-08-25 18:28:52 -04:00
Cody Robibero
e79e2cba27
Merge pull request #17714 from Shadowghost/fix-localized-view-ids
Stop deriving user view ids from their localized name
2026-08-25 18:26:09 -04:00
Shadowghost
a81b90f570 Fix tests 2026-08-25 21:03:51 +02:00
Shadowghost
6978dfc294 Delete a credit once no item maps to it any more 2026-08-25 20:31:30 +02:00
Shadowghost
3fafdbc281 Say which image and item failed instead of logging a blank path 2026-08-24 22:12:57 +02:00
Shadowghost
4df580f0e8 Fall back to the ancestor filter when a view has no top parents 2026-08-21 20:40:52 +02:00
Cody Robibero
2a8d168796
Merge pull request #17579 from Shadowghost/fix-removal-notification
Fix missing ItemRemoved events and search fallback after access filtering
2026-08-10 18:28:22 -04:00
brandon
10d108a1f4 Address review on MediaSourceCount batching
Rename GetItemsWithAlternateVersions to GetItemIdsWithAlternateVersions
across the interfaces and implementations since it returns ids. Return
the hashset straight from the query instead of materializing an array
first. Rename the DtoService guard to mayHaveAlternateVersions and
invert it so the computed path is the explicit case. Assert the media
source count value in the batch skip test and add a test covering an
item that is in the returned set still resolving to the correct count.
2026-08-08 12:33:11 -04:00
Shadowghost
e63c05137a Fix missing ItemRemoved events and search fallback after access filtering 2026-08-08 10:59:37 +02:00
brandon
c091ffdc6b Batch alternate version detection in DtoService to remove MediaSourceCount N+1
Browsing a page of videos with the MediaSourceCount field ran one alternate
version query per item, each opening a fresh DbContext. On a large library that
turned a single page into hundreds of sequential round trips and made the Items
endpoint take tens of seconds while holding a request thread the whole time.

Detect which videos own alternate versions once per page with a single query,
mirroring the existing people batch. Videos absent from that set have a single
media source, so the per item lookups are skipped for the common case. Behavior
is unchanged: a video with no alternates already resolved to a count of one.

Adds a regression test asserting the count resolves from the batch and the per
item lookups are never called.
2026-08-07 22:51:45 -04:00
brandon
d6da6906a4 Batch people lookups when building item DTOs
GetBaseItemDtos already batch fetches user data, child counts, played counts
and artists before its per item loop, but AttachPeople still ran one GetPeople
query per item. Rendering a page of items (for example a large playlist) fired
one extra query per row.

Add GetPeopleByItems to IPeopleRepository, which reads every requested item in a
single query over the people mapping table and returns full PersonInfo (role,
type and sort order) grouped by item id. GetBaseItemDtos prefetches this once
when the People field is requested and passes it into AttachPeople, which reads
from the batch instead of querying per item. The single item GetBaseItemDto path
keeps its existing per item behaviour when no batch is supplied.

Adds a DtoService test asserting people resolve from the batch and the per item
GetPeople is never called.
2026-08-07 11:59:17 -04:00
Shadowghost
4e2089b6a1 Keep folder extras with the item that owns the folder 2026-08-03 10:50:33 +02:00
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